Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2018-03-12 12:58:38 +01:00
commit 9a714457e8
2 changed files with 14 additions and 6 deletions

View file

@ -142,14 +142,12 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
scrollView.requestLayout();
}
// 8dp is the shadow height
boolean showTopShadow = screenHeight - statusBarHeight - mainView.getHeight() >= AndroidUtils.dpToPx(activity, 8);
if (AndroidUiHelper.isOrientationPortrait(activity)) {
mainView.setBackgroundResource(getPortraitBgResId());
mainView.setBackgroundResource(showTopShadow ? getPortraitBgResId() : getBgColorId());
} else {
if (screenHeight - statusBarHeight - mainView.getHeight() >= getResources().getDimension(R.dimen.bottom_sheet_content_padding_small)) {
mainView.setBackgroundResource(getLandscapeTopsidesBgResId());
} else {
mainView.setBackgroundResource(getLandscapeSidesBgResId());
}
mainView.setBackgroundResource(showTopShadow ? getLandscapeTopsidesBgResId() : getLandscapeSidesBgResId());
}
ViewTreeObserver obs = mainView.getViewTreeObserver();
@ -176,6 +174,11 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
}
@ColorRes
protected int getBgColorId() {
return nightMode ? R.color.bg_color_dark : R.color.bg_color_light;
}
@DrawableRes
protected int getPortraitBgResId() {
return nightMode ? R.drawable.bg_bottom_menu_dark : R.drawable.bg_bottom_menu_light;

View file

@ -144,6 +144,11 @@ public class AddWaypointBottomSheetDialogFragment extends MenuBottomSheetDialogF
return getIcon(id, nightMode ? R.color.ctx_menu_direction_color_dark : R.color.map_widget_blue);
}
@Override
protected int getBgColorId() {
return nightMode ? R.color.ctx_menu_bg_dark : R.color.bg_color_light;
}
@Override
protected int getPortraitBgResId() {
return nightMode ? R.drawable.bg_additional_menu_dark : R.drawable.bg_bottom_menu_light;