From 637a0510338bfcae9d542faea479d15fef8a2f79 Mon Sep 17 00:00:00 2001 From: Harry Bond Date: Fri, 20 Dec 2024 15:58:03 +0000 Subject: [PATCH] return getcustomtheme still needed --- .../organicmaps/base/BaseMwmDialogFragment.java | 16 ++++++++++++++++ .../widget/placepage/DirectionFragment.java | 7 +++++++ .../widget/placepage/EditBookmarkFragment.java | 6 ++++++ 3 files changed, 29 insertions(+) diff --git a/android/app/src/main/java/app/organicmaps/base/BaseMwmDialogFragment.java b/android/app/src/main/java/app/organicmaps/base/BaseMwmDialogFragment.java index aebb8d757e..df1f2abc3b 100644 --- a/android/app/src/main/java/app/organicmaps/base/BaseMwmDialogFragment.java +++ b/android/app/src/main/java/app/organicmaps/base/BaseMwmDialogFragment.java @@ -19,6 +19,22 @@ public class BaseMwmDialogFragment extends DialogFragment return STYLE_NORMAL; } + protected @StyleRes int getCustomTheme() + { + return 0; + } + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + int style = getStyle(); + int theme = getCustomTheme(); + if (style != STYLE_NORMAL || theme != 0) + setStyle(style, theme); + } + @NonNull protected Application getAppContextOrThrow() { 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 59cba0d921..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 @@ -35,6 +35,13 @@ public class DirectionFragment extends BaseMwmDialogFragment private TextView mTvDistance; private MapObject mMapObject; + + @Override + protected int getCustomTheme() + { + return R.style.MwmTheme_DialogFragment_Fullscreen_Translucent; + } + @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { diff --git a/android/app/src/main/java/app/organicmaps/widget/placepage/EditBookmarkFragment.java b/android/app/src/main/java/app/organicmaps/widget/placepage/EditBookmarkFragment.java index be1696a5b6..66e4ffac81 100644 --- a/android/app/src/main/java/app/organicmaps/widget/placepage/EditBookmarkFragment.java +++ b/android/app/src/main/java/app/organicmaps/widget/placepage/EditBookmarkFragment.java @@ -103,6 +103,12 @@ public class EditBookmarkFragment extends BaseMwmDialogFragment implements View. public EditBookmarkFragment() {} + @Override + protected int getCustomTheme() + { + return R.style.MwmTheme_DialogFragment_Fullscreen; + } + @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)