Cancel menus on touch outside; fix drawing of menus under the navbar

This commit is contained in:
Alexander Sytnyk 2018-01-15 14:00:46 +02:00
parent eafee0d527
commit bf0df9b29d
2 changed files with 3 additions and 2 deletions

View file

@ -256,7 +256,7 @@
</style> </style>
<style name="OsmandLightTheme.BottomSheet"> <style name="OsmandLightTheme.BottomSheet">
<item name="android:windowIsFloating">true</item> <item name="android:statusBarColor">@color/color_transparent</item>
<item name="android:dialogTheme">@style/BottomSheet.Dialog</item> <item name="android:dialogTheme">@style/BottomSheet.Dialog</item>
<item name="android:windowBackground">@color/color_transparent</item> <item name="android:windowBackground">@color/color_transparent</item>
<item name="android:backgroundDimAmount">0.3</item> <item name="android:backgroundDimAmount">0.3</item>
@ -264,7 +264,7 @@
</style> </style>
<style name="OsmandDarkTheme.BottomSheet"> <style name="OsmandDarkTheme.BottomSheet">
<item name="android:windowIsFloating">true</item> <item name="android:statusBarColor">@color/color_transparent</item>
<item name="android:dialogTheme">@style/BottomSheet.Dialog</item> <item name="android:dialogTheme">@style/BottomSheet.Dialog</item>
<item name="android:windowBackground">@color/color_transparent</item> <item name="android:windowBackground">@color/color_transparent</item>
<item name="android:backgroundDimAmount">0.3</item> <item name="android:backgroundDimAmount">0.3</item>

View file

@ -26,6 +26,7 @@ public abstract class BottomSheetDialogFragment extends DialogFragment {
int themeId = settings.isLightContent() ? R.style.OsmandLightTheme_BottomSheet : R.style.OsmandDarkTheme_BottomSheet; int themeId = settings.isLightContent() ? R.style.OsmandLightTheme_BottomSheet : R.style.OsmandDarkTheme_BottomSheet;
BottomSheetDialog dialog = new BottomSheetDialog(getContext(), themeId); BottomSheetDialog dialog = new BottomSheetDialog(getContext(), themeId);
dialog.setCanceledOnTouchOutside(true);
Window window = dialog.getWindow(); Window window = dialog.getWindow();
if (!getMyApplication().getSettings().DO_NOT_USE_ANIMATIONS.get() && window != null) { if (!getMyApplication().getSettings().DO_NOT_USE_ANIMATIONS.get() && window != null) {
window.getAttributes().windowAnimations = R.style.Animations_PopUpMenu_Bottom; window.getAttributes().windowAnimations = R.style.Animations_PopUpMenu_Bottom;