diff --git a/OsmAnd/res/drawable/bg_top_menu_dark.xml b/OsmAnd/res/drawable/bg_top_menu_dark.xml index 47de9f6025..2ef9d04f24 100644 --- a/OsmAnd/res/drawable/bg_top_menu_dark.xml +++ b/OsmAnd/res/drawable/bg_top_menu_dark.xml @@ -6,8 +6,8 @@ - + \ No newline at end of file diff --git a/OsmAnd/res/drawable/bg_top_menu_light.xml b/OsmAnd/res/drawable/bg_top_menu_light.xml index 3a48a32f5e..0bc7186f50 100644 --- a/OsmAnd/res/drawable/bg_top_menu_light.xml +++ b/OsmAnd/res/drawable/bg_top_menu_light.xml @@ -6,8 +6,8 @@ - + \ No newline at end of file diff --git a/OsmAnd/res/drawable/bg_top_sheet_bottom_sides_landscape_dark.xml b/OsmAnd/res/drawable/bg_top_sheet_bottom_sides_landscape_dark.xml index 6d4b38d914..7abde0796c 100644 --- a/OsmAnd/res/drawable/bg_top_sheet_bottom_sides_landscape_dark.xml +++ b/OsmAnd/res/drawable/bg_top_sheet_bottom_sides_landscape_dark.xml @@ -6,8 +6,8 @@ - + \ No newline at end of file diff --git a/OsmAnd/res/drawable/bg_top_sheet_bottom_sides_landscape_light.xml b/OsmAnd/res/drawable/bg_top_sheet_bottom_sides_landscape_light.xml index cc00abd48e..ff0f70412f 100644 --- a/OsmAnd/res/drawable/bg_top_sheet_bottom_sides_landscape_light.xml +++ b/OsmAnd/res/drawable/bg_top_sheet_bottom_sides_landscape_light.xml @@ -6,8 +6,8 @@ - + \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/base/OsmandSheetDialog.java b/OsmAnd/src/net/osmand/plus/base/OsmandSheetDialog.java index 5867139e4f..065a99c4f0 100644 --- a/OsmAnd/src/net/osmand/plus/base/OsmandSheetDialog.java +++ b/OsmAnd/src/net/osmand/plus/base/OsmandSheetDialog.java @@ -17,11 +17,11 @@ import android.view.Window; import android.view.WindowManager; import android.widget.FrameLayout; -import net.osmand.plus.R; - import static net.osmand.plus.base.SheetDialogType.*; public class OsmandSheetDialog extends Dialog { + + public final static int CONTAINER_ID = 111111; private boolean cancelable = true; private boolean canceledOnTouchOutside = true; @@ -168,6 +168,7 @@ public class OsmandSheetDialog extends Dialog { params.gravity = gravity; FrameLayout container = new FrameLayout(getContext()); container.setLayoutParams(params); + container.setId(CONTAINER_ID); return container; } diff --git a/OsmAnd/src/net/osmand/plus/download/ui/DownloadMapDialogFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/DownloadMapDialogFragment.java index 769ebe6461..cbe215da9c 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/DownloadMapDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/DownloadMapDialogFragment.java @@ -23,6 +23,7 @@ import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.OsmAndSheetDialogFragment; +import net.osmand.plus.base.OsmandSheetDialog; import net.osmand.plus.base.SheetDialogType; import net.osmand.plus.download.DownloadValidationManager; import net.osmand.plus.download.IndexItem; @@ -84,12 +85,15 @@ public class DownloadMapDialogFragment extends OsmAndSheetDialogFragment { @Override public void onStart() { super.onStart(); - final Window window = getDialog().getWindow(); FragmentActivity activity = requireActivity(); - if (window != null && !AndroidUiHelper.isOrientationPortrait(activity)) { - WindowManager.LayoutParams params = window.getAttributes(); - params.width = activity.getResources().getDimensionPixelSize(R.dimen.landscape_bottom_sheet_dialog_fragment_width); - window.setAttributes(params); + if (!AndroidUiHelper.isOrientationPortrait(activity)) { + final Window window = getDialog().getWindow(); + if (window != null) { + View container = window.findViewById(OsmandSheetDialog.CONTAINER_ID); + if (container != null) { + container.getLayoutParams().width = activity.getResources().getDimensionPixelSize(R.dimen.landscape_bottom_sheet_dialog_fragment_width); + } + } } }