From f29c5944eb607eb6cc607d22dcce5604e6bf3acc Mon Sep 17 00:00:00 2001 From: Chumva Date: Wed, 7 Mar 2018 14:25:25 +0200 Subject: [PATCH] added offset for popup which depends on orientation --- .../plus/activities/EditFavoriteGroupDialogFragment.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java b/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java index 6f4cda487f..5016942abe 100644 --- a/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java @@ -2,7 +2,6 @@ package net.osmand.plus.activities; import android.content.Context; import android.content.DialogInterface; -import android.content.res.Configuration; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.Fragment; @@ -33,6 +32,7 @@ import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithCompoundButton; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerHalfItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem; +import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.helpers.ColorDialogs; import net.osmand.util.Algorithms; @@ -107,8 +107,8 @@ public class EditFavoriteGroupDialogFragment extends MenuBottomSheetDialogFragme popup.setContentWidth(AndroidUtils.dpToPx(app, 200f)); popup.setModal(true); popup.setDropDownGravity(Gravity.END | Gravity.TOP); - getResources().getConfiguration(); - if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { + boolean orientationPortrait = AndroidUiHelper.isOrientationPortrait(getActivity()); + if (orientationPortrait) { popup.setVerticalOffset(AndroidUtils.dpToPx(app, 48f)); } else { popup.setVerticalOffset(AndroidUtils.dpToPx(app, -48f));