Removed shadow over button on map screen.

This commit is contained in:
GaidamakUA 2016-04-13 15:40:43 +03:00
parent eb733772b4
commit f0ffa51a09
3 changed files with 75 additions and 106 deletions

View file

@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" xmlns:tools="http://schemas.android.com/tools"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:layout_gravity="bottom" android:layout_height="wrap_content"
android:orientation="horizontal" > android:layout_gravity="bottom"
android:orientation="horizontal">
<FrameLayout <FrameLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|left" > android:layout_gravity="bottom|left">
<!-- ALARM --> <!-- ALARM -->
@ -18,67 +19,50 @@
android:layout_height="@dimen/map_alarm_size" android:layout_height="@dimen/map_alarm_size"
android:layout_gravity="bottom|left" android:layout_gravity="bottom|left"
android:layout_marginBottom="@dimen/map_alarm_bottom_margin_land" android:layout_marginBottom="@dimen/map_alarm_bottom_margin_land"
android:layout_marginLeft="@dimen/map_button_shadow_margin" > android:layout_marginLeft="@dimen/map_button_shadow_margin">
<ImageView <ImageView
android:id="@+id/map_alarm_warning_icon" android:id="@+id/map_alarm_warning_icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/warnings_limit" /> android:src="@drawable/warnings_limit"/>
<TextView <TextView
android:id="@+id/map_alarm_warning_text" android:id="@+id/map_alarm_warning_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:text="60" tools:text="60"
android:textColor="@color/color_black" android:textColor="@color/color_black"
android:textSize="@dimen/map_alarm_text_size" android:textSize="@dimen/map_alarm_text_size"
android:textStyle="bold" /> android:textStyle="bold"/>
</FrameLayout> </FrameLayout>
<!-- SHADOW --> <TextView
android:id="@+id/map_app_mode_text"
<FrameLayout android:layout_width="wrap_content"
android:id="@+id/map_app_mode_shadow" android:layout_height="wrap_content"
android:layout_width="@dimen/map_button_shadow_width" android:layout_gravity="bottom"
android:layout_height="@dimen/map_button_shadow_height" android:layout_marginBottom="130dp"
android:layout_gravity="bottom|left" android:layout_marginLeft="@dimen/map_button_margin"
android:layout_marginBottom="@dimen/map_button_shadow_margin" android:gravity="center_horizontal"
android:layout_marginLeft="@dimen/map_button_shadow_margin" android:textSize="@dimen/map_button_text_size"
android:background="@drawable/btn_round_trans" > tools:text="13.88"/>
<ImageView
android:id="@+id/map_app_mode_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|center"
android:layout_marginTop="3dp"
android:src="@drawable/ic_action_test_light" />
<TextView
android:id="@+id/map_app_mode_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|center"
android:gravity="center_horizontal"
android:textSize="@dimen/map_button_text_size" />
</FrameLayout>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|left" > android:layout_gravity="bottom|left">
<!-- PREPARATION SCREEN --> <!-- PREPARATION SCREEN -->
<include <include
layout="@layout/recording_note_fragment"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|left" android:layout_gravity="bottom|left"
android:visibility="gone" android:visibility="gone"/>
layout="@layout/recording_note_fragment" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -87,24 +71,24 @@
android:layout_marginBottom="@dimen/map_button_margin" android:layout_marginBottom="@dimen/map_button_margin"
android:layout_marginLeft="@dimen/map_button_margin" android:layout_marginLeft="@dimen/map_button_margin"
android:layout_marginRight="@dimen/map_button_spacing_land" android:layout_marginRight="@dimen/map_button_spacing_land"
android:orientation="horizontal" > android:orientation="horizontal">
<ImageButton <ImageButton
android:id="@+id/map_menu_button" android:id="@+id/map_menu_button"
android:contentDescription="@string/backToMenu"
android:layout_width="@dimen/map_button_size" android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size" android:layout_height="@dimen/map_button_size"
android:background="@drawable/btn_round" android:background="@drawable/btn_round"
android:src="@drawable/ic_action_test_light" /> android:contentDescription="@string/backToMenu"
tools:src="@drawable/ic_action_test_light"/>
<ImageButton <ImageButton
android:id="@+id/map_route_info_button" android:id="@+id/map_route_info_button"
android:contentDescription="@string/layer_route"
android:layout_width="@dimen/map_button_size" android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size" android:layout_height="@dimen/map_button_size"
android:layout_marginLeft="@dimen/map_button_spacing_land" android:layout_marginLeft="@dimen/map_button_spacing_land"
android:background="@drawable/btn_round" android:background="@drawable/btn_round"
android:src="@drawable/ic_action_test_light" /> android:contentDescription="@string/layer_route"
tools:src="@drawable/ic_action_test_light"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
@ -114,7 +98,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/map_button_margin" android:layout_marginBottom="@dimen/map_button_margin"
android:layout_weight="1" > android:layout_weight="1">
<!-- RULER --> <!-- RULER -->
@ -122,12 +106,12 @@
android:id="@+id/map_ruler_layout" android:id="@+id/map_ruler_layout"
android:layout_width="@dimen/map_ruler_width" android:layout_width="@dimen/map_ruler_width"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" > android:layout_gravity="bottom">
<FrameLayout <FrameLayout
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:layout_marginBottom="@dimen/map_ruler_bottom_margin" > android:layout_marginBottom="@dimen/map_ruler_bottom_margin">
<TextView <TextView
android:id="@+id/map_ruler_text_shadow" android:id="@+id/map_ruler_text_shadow"
@ -136,8 +120,8 @@
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:lineSpacingMultiplier="0.9" android:lineSpacingMultiplier="0.9"
android:text="100 m" tools:text="100 m"
android:textSize="@dimen/map_widget_text_size_small" /> android:textSize="@dimen/map_widget_text_size_small"/>
<TextView <TextView
android:id="@+id/map_ruler_text" android:id="@+id/map_ruler_text"
@ -146,8 +130,8 @@
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:lineSpacingMultiplier="0.9" android:lineSpacingMultiplier="0.9"
android:text="100 m" tools:text="100 m"
android:textSize="@dimen/map_widget_text_size_small" /> android:textSize="@dimen/map_widget_text_size_small"/>
</FrameLayout> </FrameLayout>
<ImageView <ImageView
@ -155,7 +139,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:background="@drawable/ruler" /> android:background="@drawable/ruler"/>
</FrameLayout> </FrameLayout>
<!-- TRANSPARENCY --> <!-- TRANSPARENCY -->
@ -166,22 +150,22 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|center" android:layout_gravity="bottom|center"
android:layout_marginBottom="@dimen/map_button_size" android:layout_marginBottom="@dimen/map_button_size"
android:orientation="horizontal" > android:orientation="horizontal">
<SeekBar <SeekBar
android:id="@+id/map_transparency_seekbar" android:id="@+id/map_transparency_seekbar"
android:layout_width="@dimen/map_trans_seek_size" android:layout_width="@dimen/map_trans_seek_size"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" /> android:layout_gravity="center"/>
<ImageButton <ImageButton
android:id="@+id/map_transparency_hide" android:id="@+id/map_transparency_hide"
android:contentDescription="@string/shared_string_hide"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/btn_circle_transparent" android:background="@drawable/btn_circle_transparent"
android:src="@drawable/headliner_close" /> android:contentDescription="@string/shared_string_hide"
android:src="@drawable/headliner_close"/>
</LinearLayout> </LinearLayout>
<!-- CONTEXT MENU --> <!-- CONTEXT MENU -->
@ -192,14 +176,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:background="@drawable/btn_flat" android:background="@drawable/btn_flat"
android:visibility="gone" > android:visibility="gone">
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1" android:layout_weight="1"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center" > android:gravity="center">
</TextView> </TextView>
<ImageButton <ImageButton
@ -207,14 +191,14 @@
android:layout_height="@dimen/map_address_height" android:layout_height="@dimen/map_address_height"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="@drawable/btn_circle_transparent" android:background="@drawable/btn_circle_transparent"
android:src="@drawable/ic_action_test_light" /> tools:src="@drawable/ic_action_test_light"/>
<ImageButton <ImageButton
android:layout_width="@dimen/map_address_height" android:layout_width="@dimen/map_address_height"
android:layout_height="@dimen/map_address_height" android:layout_height="@dimen/map_address_height"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="@drawable/btn_circle_transparent" android:background="@drawable/btn_circle_transparent"
android:src="@drawable/ic_action_test_light" /> tools:src="@drawable/ic_action_test_light"/>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
@ -226,40 +210,40 @@
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/map_button_margin" android:layout_marginBottom="@dimen/map_button_margin"
android:layout_marginLeft="@dimen/map_button_spacing_land" android:layout_marginLeft="@dimen/map_button_spacing_land"
android:layout_marginRight="@dimen/map_button_margin" > android:layout_marginRight="@dimen/map_button_margin">
<ImageButton <ImageButton
android:id="@+id/map_my_location_button" android:id="@+id/map_my_location_button"
android:contentDescription="@string/shared_string_my_location"
android:layout_width="@dimen/map_button_size" android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size" android:layout_height="@dimen/map_button_size"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:background="@drawable/btn_circle" android:background="@drawable/btn_circle"
android:src="@drawable/ic_action_test_light" /> android:contentDescription="@string/shared_string_my_location"
tools:src="@drawable/ic_action_test_light"/>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginLeft="@dimen/map_button_spacing_land" android:layout_marginLeft="@dimen/map_button_spacing_land"
android:orientation="vertical" > android:orientation="vertical">
<ImageButton <ImageButton
android:id="@+id/map_zoom_in_button" android:id="@+id/map_zoom_in_button"
android:contentDescription="@string/zoomIn"
android:layout_width="@dimen/map_button_size" android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size" android:layout_height="@dimen/map_button_size"
android:background="@drawable/btn_circle" android:background="@drawable/btn_circle"
android:src="@drawable/ic_action_test_light" /> android:contentDescription="@string/zoomIn"
tools:src="@drawable/ic_action_test_light"/>
<ImageButton <ImageButton
android:id="@+id/map_zoom_out_button" android:id="@+id/map_zoom_out_button"
android:contentDescription="@string/zoomOut"
android:layout_width="@dimen/map_button_size" android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size" android:layout_height="@dimen/map_button_size"
android:layout_marginTop="@dimen/map_button_spacing_land" android:layout_marginTop="@dimen/map_button_spacing_land"
android:background="@drawable/btn_circle" android:background="@drawable/btn_circle"
android:src="@drawable/ic_action_test_light" /> android:contentDescription="@string/zoomOut"
tools:src="@drawable/ic_action_test_light"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -36,23 +36,16 @@
tools:text="60"/> tools:text="60"/>
</FrameLayout> </FrameLayout>
<FrameLayout <TextView
android:id="@+id/map_app_mode_shadow" android:id="@+id/map_app_mode_text"
android:layout_width="@dimen/map_button_shadow_width" android:layout_width="wrap_content"
android:layout_height="@dimen/map_button_shadow_height" android:layout_height="wrap_content"
android:gravity="center_horizontal"
tools:text="13.44"
android:layout_marginBottom="56dp"
android:layout_marginLeft="8dp"
android:layout_gravity="bottom|left" android:layout_gravity="bottom|left"
android:layout_marginBottom="@dimen/map_button_shadow_margin" android:textSize="@dimen/map_button_text_size"/>
android:layout_marginLeft="@dimen/map_button_shadow_margin"
android:background="@drawable/btn_round_trans">
<TextView
android:id="@+id/map_app_mode_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|center"
android:gravity="center_horizontal"
android:textSize="@dimen/map_button_text_size"/>
</FrameLayout>
<LinearLayout <LinearLayout
android:id="@+id/map_transparency_layout" android:id="@+id/map_transparency_layout"
@ -72,11 +65,11 @@
<ImageButton <ImageButton
android:id="@+id/map_transparency_hide" android:id="@+id/map_transparency_hide"
android:contentDescription="@string/shared_string_hide"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/btn_circle_transparent" android:background="@drawable/btn_circle_transparent"
android:contentDescription="@string/shared_string_hide"
android:src="@drawable/headliner_close"/> android:src="@drawable/headliner_close"/>
</LinearLayout> </LinearLayout>
@ -89,20 +82,20 @@
<ImageButton <ImageButton
android:id="@+id/map_menu_button" android:id="@+id/map_menu_button"
android:contentDescription="@string/backToMenu"
android:layout_width="@dimen/map_button_size" android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size" android:layout_height="@dimen/map_button_size"
android:background="@drawable/btn_round" android:background="@drawable/btn_round"
android:src="@drawable/ic_action_test_light"/> android:contentDescription="@string/backToMenu"
tools:src="@drawable/ic_action_test_light"/>
<ImageButton <ImageButton
android:id="@+id/map_route_info_button" android:id="@+id/map_route_info_button"
android:contentDescription="@string/layer_route"
android:layout_width="@dimen/map_button_size" android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size" android:layout_height="@dimen/map_button_size"
android:layout_marginLeft="@dimen/map_button_spacing" android:layout_marginLeft="@dimen/map_button_spacing"
android:background="@drawable/btn_round" android:background="@drawable/btn_round"
android:src="@drawable/ic_action_test_light"/> android:contentDescription="@string/layer_route"
tools:src="@drawable/ic_action_test_light"/>
<FrameLayout <FrameLayout
android:id="@+id/map_ruler_layout" android:id="@+id/map_ruler_layout"
@ -157,12 +150,12 @@
<ImageButton <ImageButton
android:id="@+id/map_my_location_button" android:id="@+id/map_my_location_button"
android:contentDescription="@string/shared_string_my_location"
android:layout_width="@dimen/map_button_size" android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size" android:layout_height="@dimen/map_button_size"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:background="@drawable/btn_circle" android:background="@drawable/btn_circle"
android:src="@drawable/ic_action_test_light"/> android:contentDescription="@string/shared_string_my_location"
tools:src="@drawable/ic_action_test_light"/>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -173,20 +166,20 @@
<ImageButton <ImageButton
android:id="@+id/map_zoom_in_button" android:id="@+id/map_zoom_in_button"
android:contentDescription="@string/zoomIn"
android:layout_width="@dimen/map_button_size" android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size" android:layout_height="@dimen/map_button_size"
android:background="@drawable/btn_circle" android:background="@drawable/btn_circle"
android:src="@drawable/ic_action_test_light"/> android:contentDescription="@string/zoomIn"
tools:src="@drawable/ic_action_test_light"/>
<ImageButton <ImageButton
android:id="@+id/map_zoom_out_button" android:id="@+id/map_zoom_out_button"
android:contentDescription="@string/zoomOut"
android:layout_width="@dimen/map_button_size" android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size" android:layout_height="@dimen/map_button_size"
android:layout_marginTop="@dimen/map_button_spacing" android:layout_marginTop="@dimen/map_button_spacing"
android:background="@drawable/btn_circle" android:background="@drawable/btn_circle"
android:src="@drawable/ic_action_test_light"/> android:contentDescription="@string/zoomOut"
tools:src="@drawable/ic_action_test_light"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
@ -218,14 +211,14 @@
android:layout_height="@dimen/map_address_height" android:layout_height="@dimen/map_address_height"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="@drawable/btn_circle_transparent" android:background="@drawable/btn_circle_transparent"
android:src="@drawable/ic_action_test_light"/> tools:src="@drawable/ic_action_test_light"/>
<ImageButton <ImageButton
android:layout_width="@dimen/map_address_height" android:layout_width="@dimen/map_address_height"
android:layout_height="@dimen/map_address_height" android:layout_height="@dimen/map_address_height"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="@drawable/btn_circle_transparent" android:background="@drawable/btn_circle_transparent"
android:src="@drawable/ic_action_test_light"/> tools:src="@drawable/ic_action_test_light"/>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>

View file

@ -81,7 +81,6 @@ public class MapControlsLayer extends OsmandMapLayer {
private TextView zoomText; private TextView zoomText;
private OsmandMapTileView mapView; private OsmandMapTileView mapView;
private OsmandApplication app; private OsmandApplication app;
private View mapAppModeShadow;
private MapHudButton routePlanningBtn; private MapHudButton routePlanningBtn;
private long touchEvent; private long touchEvent;
private MapHudButton mapZoomOut; private MapHudButton mapZoomOut;
@ -324,8 +323,6 @@ public class MapControlsLayer extends OsmandMapLayer {
} }
} }
}); });
controls.add(createHudButton(mapActivity.findViewById(R.id.map_app_mode_shadow), 0).setBg(
R.drawable.btn_round_trans, R.drawable.btn_round_transparent));
View backToMenuButton = mapActivity.findViewById(R.id.map_menu_button); View backToMenuButton = mapActivity.findViewById(R.id.map_menu_button);
final boolean dash = settings.SHOW_DASHBOARD_ON_MAP_SCREEN.get(); final boolean dash = settings.SHOW_DASHBOARD_ON_MAP_SCREEN.get();
@ -344,7 +341,6 @@ public class MapControlsLayer extends OsmandMapLayer {
} }
} }
}); });
mapAppModeShadow = mapActivity.findViewById(R.id.map_app_mode_shadow);
appModeIcon = (ImageView) mapActivity.findViewById(R.id.map_layers_button); appModeIcon = (ImageView) mapActivity.findViewById(R.id.map_layers_button);
zoomText = (TextView) mapActivity.findViewById(R.id.map_app_mode_text); zoomText = (TextView) mapActivity.findViewById(R.id.map_app_mode_text);
@ -527,14 +523,10 @@ public class MapControlsLayer extends OsmandMapLayer {
compassHud.updateVisibility(!dialogOpened); compassHud.updateVisibility(!dialogOpened);
layersHud.updateVisibility(!dialogOpened); layersHud.updateVisibility(!dialogOpened);
if (routePlanningMode || routeFollowingMode) { if (!routePlanningMode && !routeFollowingMode) {
mapAppModeShadow.setVisibility(View.GONE);
} else {
if (mapView.isZooming()) { if (mapView.isZooming()) {
lastZoom = System.currentTimeMillis(); lastZoom = System.currentTimeMillis();
} }
mapAppModeShadow.setVisibility(View.VISIBLE);
mapAppModeShadow.setContentDescription(settings.getApplicationMode().toHumanString(app));
//if (!mapView.isZooming() || !OsmandPlugin.isDevelopment()) { //if (!mapView.isZooming() || !OsmandPlugin.isDevelopment()) {
if ((System.currentTimeMillis() - lastZoom > 1000) || !OsmandPlugin.isDevelopment()) { if ((System.currentTimeMillis() - lastZoom > 1000) || !OsmandPlugin.isDevelopment()) {
zoomText.setVisibility(View.GONE); zoomText.setVisibility(View.GONE);