Merge branch 'r3.3'

This commit is contained in:
crimean 2019-03-28 14:44:53 +03:00
commit 2766972b5c
6 changed files with 13 additions and 17 deletions

View file

@ -36,6 +36,7 @@
<dimen name="dashboard_land_width">360dp</dimen>
<dimen name="dashboard_map_toolbar">56dp</dimen>
<dimen name="dash_parking_height">78dp</dimen>
<dimen name="dashboard_land_shadow_width">15dp</dimen>
<dimen name="subHeaderPadding">2dp</dimen>
<dimen name="subHeaderMarginLeft">15dp</dimen>

View file

@ -141,6 +141,10 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
return getResources().getDimensionPixelSize(R.dimen.dashboard_land_width);
}
public int getLandscapeNoShadowWidth() {
return getLandscapeWidth() - getResources().getDimensionPixelSize(R.dimen.dashboard_land_shadow_width);
}
public abstract int getToolbarHeight();
public boolean isSingleFragment() {
@ -266,8 +270,10 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
final TypedValue typedValueAttr = new TypedValue();
mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true);
mainView.setBackgroundResource(typedValueAttr.resourceId);
mainView.setLayoutParams(new FrameLayout.LayoutParams(getLandscapeWidth(), ViewGroup.LayoutParams.MATCH_PARENT));
} else {
mainView.setLayoutParams(new FrameLayout.LayoutParams(getLandscapeNoShadowWidth(), ViewGroup.LayoutParams.MATCH_PARENT));
}
mainView.setLayoutParams(new FrameLayout.LayoutParams(getLandscapeWidth(), ViewGroup.LayoutParams.MATCH_PARENT));
}
processScreenHeight(container);

View file

@ -124,7 +124,8 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
this.viewPager = viewPager;
if (!portrait) {
initialMenuState = MenuState.FULL_SCREEN;
solidToolbarView.setLayoutParams(new FrameLayout.LayoutParams(AndroidUtils.dpToPx(mapActivity, 345f), ViewGroup.LayoutParams.WRAP_CONTENT));
int width = getResources().getDimensionPixelSize(R.dimen.dashboard_land_width) - getResources().getDimensionPixelSize(R.dimen.dashboard_land_shadow_width);
solidToolbarView.setLayoutParams(new FrameLayout.LayoutParams(width, ViewGroup.LayoutParams.WRAP_CONTENT));
solidToolbarView.setVisibility(View.VISIBLE);
final TypedValue typedValueAttr = new TypedValue();
mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true);

View file

@ -68,11 +68,6 @@ public class MapRouteInfoMenuFragment extends ContextMenuFragment {
return true;
}
@Override
public int getLandscapeWidth() {
return getResources().getDimensionPixelSize(R.dimen.dashboard_land_width);
}
@Override
public int getToolbarHeight() {
return 0;
@ -136,7 +131,7 @@ public class MapRouteInfoMenuFragment extends ContextMenuFragment {
if (!isPortrait()) {
view.findViewById(R.id.app_modes_fold_container).setVisibility(View.GONE);
int widthNoShadow = AndroidUtils.dpToPx(mapActivity, 345f);
int widthNoShadow = getLandscapeNoShadowWidth();
modesLayoutToolbar.setLayoutParams(new FrameLayout.LayoutParams(widthNoShadow, ViewGroup.LayoutParams.WRAP_CONTENT));
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(widthNoShadow, ViewGroup.LayoutParams.WRAP_CONTENT);
params.gravity = Gravity.BOTTOM;

View file

@ -100,7 +100,6 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
private String destinationStreetStr = "";
private int pageMarginPx;
private int toolbarHeightPx;
private int landscapeWidthPx;
private GPXFile gpx;
@Nullable
@ -137,11 +136,6 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
return false;
}
@Override
public int getLandscapeWidth() {
return landscapeWidthPx;
}
public int getRouteId() {
return routeId;
}
@ -155,7 +149,6 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
}
pageMarginPx = dpToPx(PAGE_MARGIN);
toolbarHeightPx = getResources().getDimensionPixelSize(R.dimen.dashboard_map_toolbar);
landscapeWidthPx = dpToPx(345f);
View view = super.onCreateView(inflater, container, savedInstanceState);
if (view != null) {

View file

@ -159,8 +159,8 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true);
mainView.setBackgroundResource(typedValueAttr.resourceId);
mainView.setLayoutParams(new FrameLayout.LayoutParams(getResources().getDimensionPixelSize(R.dimen.dashboard_land_width), ViewGroup.LayoutParams.MATCH_PARENT));
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(AndroidUtils.dpToPx(app, 345f), ViewGroup.LayoutParams.WRAP_CONTENT);
int width = getResources().getDimensionPixelSize(R.dimen.dashboard_land_width) - getResources().getDimensionPixelSize(R.dimen.dashboard_land_shadow_width);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(width, ViewGroup.LayoutParams.WRAP_CONTENT);
params.gravity = Gravity.BOTTOM;
view.findViewById(R.id.control_buttons).setLayoutParams(params);