Remove fab and shadow

This commit is contained in:
PavelRatushny 2017-11-27 15:56:24 +02:00
parent 821683cf5f
commit a3c1e42960
2 changed files with 2 additions and 52 deletions

View file

@ -13,14 +13,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:id="@+id/context_menu_top_shadow"
android:layout_width="match_parent"
android:layout_height="@dimen/context_menu_top_shadow_h"
android:orientation="horizontal">
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/context_menu_top_shadow_all" android:id="@+id/context_menu_top_shadow_all"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -491,17 +483,6 @@
tools:src="@drawable/ic_action_test_light"/> tools:src="@drawable/ic_action_test_light"/>
</LinearLayout> </LinearLayout>
<ImageView
android:id="@+id/context_menu_fab_view"
android:contentDescription="@string/layer_route"
android:layout_width="@dimen/fab_size_with_shadow"
android:layout_height="@dimen/fab_size_with_shadow"
android:layout_gravity="right"
android:layout_marginRight="@dimen/fab_margin_right"
android:background="@drawable/fab_background_style"
android:scaleType="center"
android:src="@drawable/map_directions"/>
</FrameLayout> </FrameLayout>
</FrameLayout> </FrameLayout>

View file

@ -68,7 +68,6 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
private View view; private View view;
private View mainView; private View mainView;
private ImageView fabView;
private View zoomButtonsView; private View zoomButtonsView;
private ImageButton zoomInButtonView; private ImageButton zoomInButtonView;
private ImageButton zoomOutButtonView; private ImageButton zoomOutButtonView;
@ -77,7 +76,6 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
private OnLayoutChangeListener containerLayoutListener; private OnLayoutChangeListener containerLayoutListener;
private int menuTopViewHeight; private int menuTopViewHeight;
private int menuTopShadowHeight;
private int menuTopShadowAllHeight; private int menuTopShadowAllHeight;
private int menuTitleHeight; private int menuTitleHeight;
private int menuBottomViewHeight; private int menuBottomViewHeight;
@ -345,8 +343,6 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
View topView = view.findViewById(R.id.context_menu_top_view); View topView = view.findViewById(R.id.context_menu_top_view);
topView.setOnTouchListener(slideTouchListener); topView.setOnTouchListener(slideTouchListener);
View topShadowView = view.findViewById(R.id.context_menu_top_shadow);
topShadowView.setOnTouchListener(slideTouchListener);
View topShadowAllView = view.findViewById(R.id.context_menu_top_shadow_all); View topShadowAllView = view.findViewById(R.id.context_menu_top_shadow_all);
AndroidUtils.setBackground(getMapActivity(), topShadowAllView, nightMode, R.drawable.bg_map_context_menu_light, AndroidUtils.setBackground(getMapActivity(), topShadowAllView, nightMode, R.drawable.bg_map_context_menu_light,
R.drawable.bg_map_context_menu_dark); R.drawable.bg_map_context_menu_dark);
@ -383,25 +379,6 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
AndroidUtils.setTextSecondaryColor(getMapActivity(), AndroidUtils.setTextSecondaryColor(getMapActivity(),
(TextView) view.findViewById(R.id.progressTitle), nightMode); (TextView) view.findViewById(R.id.progressTitle), nightMode);
// FAB
fabView = (ImageView) view.findViewById(R.id.context_menu_fab_view);
if (menu.fabVisible()) {
fabView.setImageDrawable(getIcon(menu.getFabIconId(), 0));
if (menu.isLandscapeLayout()) {
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) fabView.getLayoutParams();
params.setMargins(0, 0, dpToPx(28f), 0);
fabView.setLayoutParams(params);
}
fabView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
menu.fabPressed();
}
});
} else {
fabView.setVisibility(View.GONE);
}
// Zoom buttons // Zoom buttons
zoomButtonsView = view.findViewById(R.id.context_menu_zoom_buttons); zoomButtonsView = view.findViewById(R.id.context_menu_zoom_buttons);
zoomInButtonView = (ImageButton) view.findViewById(R.id.context_menu_zoom_in_button); zoomInButtonView = (ImageButton) view.findViewById(R.id.context_menu_zoom_in_button);
@ -668,11 +645,6 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
}) })
.start(); .start();
fabView.animate().y(getFabY(posY))
.setDuration(200)
.setInterpolator(new DecelerateInterpolator())
.start();
zoomButtonsView.animate().y(getZoomButtonsY(posY)) zoomButtonsView.animate().y(getZoomButtonsY(posY))
.setDuration(200) .setDuration(200)
.setInterpolator(new DecelerateInterpolator()) .setInterpolator(new DecelerateInterpolator())
@ -997,7 +969,6 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
} }
int newMenuTopViewHeight = view.findViewById(R.id.context_menu_top_view).getHeight(); int newMenuTopViewHeight = view.findViewById(R.id.context_menu_top_view).getHeight();
menuTopShadowHeight = view.findViewById(R.id.context_menu_top_shadow).getHeight();
int newMenuTopShadowAllHeight = view.findViewById(R.id.context_menu_top_shadow_all).getHeight(); int newMenuTopShadowAllHeight = view.findViewById(R.id.context_menu_top_shadow_all).getHeight();
menuFullHeight = view.findViewById(R.id.context_menu_main).getHeight(); menuFullHeight = view.findViewById(R.id.context_menu_main).getHeight();
zoomButtonsHeight = zoomButtonsView.getHeight(); zoomButtonsHeight = zoomButtonsView.getHeight();
@ -1061,7 +1032,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
} }
menuTopViewHeight = newMenuTopViewHeight; menuTopViewHeight = newMenuTopViewHeight;
menuTopShadowAllHeight = newMenuTopShadowAllHeight; menuTopShadowAllHeight = newMenuTopShadowAllHeight;
menuTitleHeight = menuTopShadowHeight + menuTopShadowAllHeight + dy; menuTitleHeight = menuTopShadowAllHeight + dy;
menuBottomViewHeight = view.findViewById(R.id.context_menu_bottom_view).getHeight(); menuBottomViewHeight = view.findViewById(R.id.context_menu_bottom_view).getHeight();
menuFullHeightMax = menuTitleHeight + menuBottomViewHeight; menuFullHeightMax = menuTitleHeight + menuBottomViewHeight;
@ -1231,7 +1202,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
posY = Math.max(posY, minHalfY); posY = Math.max(posY, minHalfY);
break; break;
case MenuState.FULL_SCREEN: case MenuState.FULL_SCREEN:
posY = -menuTopShadowHeight - dpToPx(SHADOW_HEIGHT_TOP_DP); posY = -dpToPx(SHADOW_HEIGHT_TOP_DP);
posY = addStatusBarHeightIfNeeded(posY); posY = addStatusBarHeightIfNeeded(posY);
break; break;
default: default:
@ -1274,11 +1245,9 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
private void setViewY(int y, boolean animated, boolean adjustMapPos) { private void setViewY(int y, boolean animated, boolean adjustMapPos) {
if (!oldAndroid()) { if (!oldAndroid()) {
mainView.setY(y); mainView.setY(y);
fabView.setY(getFabY(y));
zoomButtonsView.setY(getZoomButtonsY(y)); zoomButtonsView.setY(getZoomButtonsY(y));
} else { } else {
mainView.setPadding(0, y, 0, 0); mainView.setPadding(0, y, 0, 0);
fabView.setPadding(0, getFabY(y), 0, 0);
zoomButtonsView.setPadding(0, getZoomButtonsY(y), 0, 0); zoomButtonsView.setPadding(0, getZoomButtonsY(y), 0, 0);
} }
if (!customMapCenter) { if (!customMapCenter) {