diff --git a/android/app/src/main/java/app/organicmaps/MwmActivity.java b/android/app/src/main/java/app/organicmaps/MwmActivity.java
index c5ef4d11a0..0dd6378397 100644
--- a/android/app/src/main/java/app/organicmaps/MwmActivity.java
+++ b/android/app/src/main/java/app/organicmaps/MwmActivity.java
@@ -696,6 +696,16 @@ public class MwmActivity extends BaseMwmFragmentActivity
}
}
+ /** Hides/shows UI while keeping state
+ * @param isUiHidden True to hide the UI
+ **/
+ public void hideOrShowUIWithoutClosingPlacePage(boolean isUiHidden)
+ {
+ // Used instead of closeBottomSheet to preserve state and hide instantly
+ UiUtils.showIf(!isUiHidden, findViewById(R.id.place_page_container_fragment));
+ mMapButtonsViewModel.setButtonsHidden(isUiHidden);
+ }
+
private void showSearchToolbar()
{
mSearchController.show();
diff --git a/android/app/src/main/java/app/organicmaps/widget/placepage/DirectionFragment.java b/android/app/src/main/java/app/organicmaps/widget/placepage/DirectionFragment.java
index aeb6363b6e..28cbf2b032 100644
--- a/android/app/src/main/java/app/organicmaps/widget/placepage/DirectionFragment.java
+++ b/android/app/src/main/java/app/organicmaps/widget/placepage/DirectionFragment.java
@@ -11,6 +11,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import app.organicmaps.Framework;
+import app.organicmaps.MwmActivity;
import app.organicmaps.R;
import app.organicmaps.base.BaseMwmDialogFragment;
import app.organicmaps.bookmarks.data.DistanceAndAzimut;
@@ -46,6 +47,7 @@ public class DirectionFragment extends BaseMwmDialogFragment
{
final View root = inflater.inflate(R.layout.fragment_direction, container, false);
root.setOnTouchListener((v, event) -> {
+ root.performClick();
dismiss();
return false;
});
@@ -99,6 +101,7 @@ public class DirectionFragment extends BaseMwmDialogFragment
super.onResume();
LocationHelper.from(requireContext()).addListener(this);
SensorHelper.from(requireContext()).addListener(this);
+ ((MwmActivity) requireActivity()).hideOrShowUIWithoutClosingPlacePage(true);
refreshViews();
}
@@ -110,6 +113,13 @@ public class DirectionFragment extends BaseMwmDialogFragment
SensorHelper.from(requireContext()).removeListener(this);
}
+ @Override
+ public void onStop()
+ {
+ super.onStop();
+ ((MwmActivity) requireActivity()).hideOrShowUIWithoutClosingPlacePage(false);
+ }
+
@Override
public void onLocationUpdated(@NonNull Location location)
{
diff --git a/android/app/src/main/res/values/themes.xml b/android/app/src/main/res/values/themes.xml
index deabcfb5cd..47a97a0165 100644
--- a/android/app/src/main/res/values/themes.xml
+++ b/android/app/src/main/res/values/themes.xml
@@ -134,6 +134,7 @@
- @android:color/black
- @color/bg_dialog_translucent
- true
+ - @android:color/transparent