Hide topbar

This commit is contained in:
PavelRatushny 2017-10-02 15:24:58 +03:00
parent 23010da7a2
commit f1c42f6d2b
3 changed files with 246 additions and 242 deletions

View file

@ -239,144 +239,151 @@
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <FrameLayout
android:id="@+id/map_top_bar" android:id="@+id/map_top_bar_layout"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:background="@drawable/btn_round"
android:minHeight="@dimen/map_address_height">
<FrameLayout <FrameLayout
android:layout_width="wrap_content" android:id="@+id/map_top_bar"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
>
<TextView
android:id="@+id/map_address_text_shadow"
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/color_black"
android:textSize="@dimen/map_widget_text_size"
tools:text="Long Street Name">
</TextView>
<TextView
android:id="@+id/map_address_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/color_black"
android:textSize="@dimen/map_widget_text_size"
tools:text="Long Street Name">
</TextView>
</FrameLayout>
<LinearLayout
android:id="@+id/waypoint_info_bar"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:background="@drawable/btn_round"
android:minHeight="@dimen/map_address_height">
<ImageView <FrameLayout
android:id="@+id/waypoint_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/map_button_margin"
android:layout_marginRight="@dimen/map_button_margin"
android:src="@drawable/ic_action_test_light"/>
<LinearLayout
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:orientation="vertical"> android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
>
<TextView <TextView
android:id="@+id/waypoint_dist" android:id="@+id/map_address_text_shadow"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="2dp"
android:maxLines="2"
android:textColor="@color/osmand_orange"
android:textSize="@dimen/default_list_text_size"
android:textStyle="bold"/>
<TextView
android:id="@+id/waypoint_deviation"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="2dp"
android:drawablePadding="2dp"
android:maxLines="1"
android:textColor="@color/osmand_orange"
android:textSize="@dimen/default_list_text_size"
android:textStyle="bold"
android:visibility="gone"/>
</LinearLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_weight="1">
<TextView
android:id="@+id/waypoint_text_shadow"
android:importantForAccessibility="no" android:importantForAccessibility="no"
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:ellipsize="end" android:ellipsize="end"
android:maxLines="2" android:maxLines="1"
android:singleLine="true"
android:textColor="@color/color_black" android:textColor="@color/color_black"
android:textSize="@dimen/map_button_text_size" android:textSize="@dimen/map_widget_text_size"
tools:text="Waypoint"/> tools:text="Long Street Name">
</TextView>
<TextView <TextView
android:id="@+id/waypoint_text" android:id="@+id/map_address_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:ellipsize="end" android:ellipsize="end"
android:maxLines="2" android:maxLines="1"
android:singleLine="true"
android:textColor="@color/color_black" android:textColor="@color/color_black"
android:textSize="@dimen/map_button_text_size" android:textSize="@dimen/map_widget_text_size"
tools:text="Waypoint"/> tools:text="Long Street Name">
</TextView>
</FrameLayout> </FrameLayout>
<ImageButton <LinearLayout
android:id="@+id/waypoint_more" android:id="@+id/waypoint_info_bar"
android:contentDescription="@string/shared_string_more" android:layout_width="fill_parent"
android:layout_width="@dimen/map_address_height" android:layout_height="wrap_content"
android:layout_height="@dimen/map_address_height" android:orientation="horizontal">
android:background="@drawable/btn_circle_transparent"
android:src="@drawable/ic_overflow_menu_white"/> <ImageView
android:id="@+id/waypoint_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/map_button_margin"
android:layout_marginRight="@dimen/map_button_margin"
android:src="@drawable/ic_action_test_light"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/waypoint_dist"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="2dp"
android:maxLines="2"
android:textColor="@color/osmand_orange"
android:textSize="@dimen/default_list_text_size"
android:textStyle="bold"/>
<TextView
android:id="@+id/waypoint_deviation"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="2dp"
android:drawablePadding="2dp"
android:maxLines="1"
android:textColor="@color/osmand_orange"
android:textSize="@dimen/default_list_text_size"
android:textStyle="bold"
android:visibility="gone"/>
</LinearLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_weight="1">
<TextView
android:id="@+id/waypoint_text_shadow"
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@color/color_black"
android:textSize="@dimen/map_button_text_size"
tools:text="Waypoint"/>
<TextView
android:id="@+id/waypoint_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@color/color_black"
android:textSize="@dimen/map_button_text_size"
tools:text="Waypoint"/>
</FrameLayout>
<ImageButton
android:id="@+id/waypoint_more"
android:contentDescription="@string/shared_string_more"
android:layout_width="@dimen/map_address_height"
android:layout_height="@dimen/map_address_height"
android:background="@drawable/btn_circle_transparent"
android:src="@drawable/ic_overflow_menu_white"/>
<ImageButton
android:id="@+id/waypoint_close"
android:contentDescription="@string/shared_string_close"
android:layout_width="@dimen/map_address_height"
android:layout_height="@dimen/map_address_height"
android:background="@drawable/btn_circle_transparent"
android:src="@drawable/ic_action_test_light"/>
</LinearLayout>
</FrameLayout>
<ImageButton
android:id="@+id/waypoint_close"
android:contentDescription="@string/shared_string_close"
android:layout_width="@dimen/map_address_height"
android:layout_height="@dimen/map_address_height"
android:background="@drawable/btn_circle_transparent"
android:src="@drawable/ic_action_test_light"/>
</LinearLayout>
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout

View file

@ -9,144 +9,151 @@
<!-- TOP ROW --> <!-- TOP ROW -->
<FrameLayout <FrameLayout
android:id="@+id/map_top_bar" android:id="@+id/map_top_bar_layout"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:background="@drawable/btn_flat"
android:minHeight="@dimen/map_address_height">
<!-- android:layout_weight="1" to show properly next turn -->
<FrameLayout <FrameLayout
android:layout_width="wrap_content" android:id="@+id/map_top_bar"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp">
<TextView
android:id="@+id/map_address_text_shadow"
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/color_black"
android:textSize="@dimen/map_widget_text_size"
tools:text="Long Street Name">
</TextView>
<TextView
android:id="@+id/map_address_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/color_black"
android:textSize="@dimen/map_widget_text_size"
tools:text="Long Street Name">
</TextView>
</FrameLayout>
<LinearLayout
android:id="@+id/waypoint_info_bar"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:background="@drawable/btn_flat"
android:visibility="gone"> android:minHeight="@dimen/map_address_height">
<ImageView <!-- android:layout_weight="1" to show properly next turn -->
android:id="@+id/waypoint_icon" <FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/map_button_margin"
android:layout_marginRight="@dimen/map_button_margin"
tools:src="@drawable/ic_action_test_light"/>
<LinearLayout
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:orientation="vertical"> android:layout_marginLeft="5dp"
android:layout_marginRight="5dp">
<TextView <TextView
android:id="@+id/waypoint_dist" android:id="@+id/map_address_text_shadow"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="2dp"
android:maxLines="2"
android:textColor="@color/osmand_orange"
android:textSize="@dimen/default_list_text_size"
android:textStyle="bold"/>
<TextView
android:id="@+id/waypoint_deviation"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="2dp"
android:drawablePadding="2dp"
android:maxLines="1"
android:textColor="@color/osmand_orange"
android:textSize="@dimen/default_list_text_size"
android:textStyle="bold"
android:visibility="gone"/>
</LinearLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_weight="1">
<TextView
android:id="@+id/waypoint_text_shadow"
android:importantForAccessibility="no" android:importantForAccessibility="no"
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:ellipsize="end" android:ellipsize="end"
android:maxLines="2" android:maxLines="1"
android:singleLine="true"
android:textColor="@color/color_black" android:textColor="@color/color_black"
android:textSize="@dimen/map_button_text_size" android:textSize="@dimen/map_widget_text_size"
tools:text="Waypoint"/> tools:text="Long Street Name">
</TextView>
<TextView <TextView
android:id="@+id/waypoint_text" android:id="@+id/map_address_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:ellipsize="end" android:ellipsize="end"
android:maxLines="2" android:maxLines="1"
android:singleLine="true"
android:textColor="@color/color_black" android:textColor="@color/color_black"
android:textSize="@dimen/map_button_text_size" android:textSize="@dimen/map_widget_text_size"
tools:text="Waypoint"/> tools:text="Long Street Name">
</TextView>
</FrameLayout> </FrameLayout>
<ImageButton
android:id="@+id/waypoint_more"
android:contentDescription="@string/shared_string_more"
android:layout_width="@dimen/map_address_height"
android:layout_height="@dimen/map_address_height"
android:background="@drawable/btn_circle_transparent"
tools:src="@drawable/ic_action_test_light"/>
<ImageButton <LinearLayout
android:id="@+id/waypoint_close" android:id="@+id/waypoint_info_bar"
android:contentDescription="@string/shared_string_close" android:layout_width="fill_parent"
android:layout_width="@dimen/map_address_height" android:layout_height="wrap_content"
android:layout_height="@dimen/map_address_height" android:orientation="horizontal"
android:background="@drawable/bottom_shadow" android:visibility="gone">
tools:src="@drawable/ic_action_test_light"/>
</LinearLayout> <ImageView
android:id="@+id/waypoint_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/map_button_margin"
android:layout_marginRight="@dimen/map_button_margin"
tools:src="@drawable/ic_action_test_light"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/waypoint_dist"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="2dp"
android:maxLines="2"
android:textColor="@color/osmand_orange"
android:textSize="@dimen/default_list_text_size"
android:textStyle="bold"/>
<TextView
android:id="@+id/waypoint_deviation"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="2dp"
android:drawablePadding="2dp"
android:maxLines="1"
android:textColor="@color/osmand_orange"
android:textSize="@dimen/default_list_text_size"
android:textStyle="bold"
android:visibility="gone"/>
</LinearLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_weight="1">
<TextView
android:id="@+id/waypoint_text_shadow"
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@color/color_black"
android:textSize="@dimen/map_button_text_size"
tools:text="Waypoint"/>
<TextView
android:id="@+id/waypoint_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@color/color_black"
android:textSize="@dimen/map_button_text_size"
tools:text="Waypoint"/>
</FrameLayout>
<ImageButton
android:id="@+id/waypoint_more"
android:contentDescription="@string/shared_string_more"
android:layout_width="@dimen/map_address_height"
android:layout_height="@dimen/map_address_height"
android:background="@drawable/btn_circle_transparent"
tools:src="@drawable/ic_action_test_light"/>
<ImageButton
android:id="@+id/waypoint_close"
android:contentDescription="@string/shared_string_close"
android:layout_width="@dimen/map_address_height"
android:layout_height="@dimen/map_address_height"
android:background="@drawable/bottom_shadow"
tools:src="@drawable/ic_action_test_light"/>
</LinearLayout>
</FrameLayout>
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout

View file

@ -452,26 +452,16 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
} }
private void updateWidgetsAndTopbarsVisibility(boolean visible) { private void updateWidgetsAndTopbarsVisibility(boolean visible) {
updateVisibility(mapActivity.findViewById(R.id.map_markers_top_bar_layout), visible); int visibility = visible ? View.VISIBLE : View.GONE;
mapActivity.findViewById(R.id.map_top_bar_layout).setVisibility(visibility);
mapActivity.findViewById(R.id.map_markers_top_bar_layout).setVisibility(visibility);
TopToolbarController controller = mapActivity.getTopToolbarController(); TopToolbarController controller = mapActivity.getTopToolbarController();
if (controller != null && controller.getType() != TopToolbarControllerType.CONTEXT_MENU) { if (controller != null && controller.getType() != TopToolbarControllerType.CONTEXT_MENU) {
updateVisibility(mapActivity.findViewById(R.id.widget_top_bar), visible); mapActivity.findViewById(R.id.widget_top_bar).setVisibility(visibility);
} }
updateVisibility(mapActivity.findViewById(R.id.map_left_widgets_panel), visible); mapActivity.findViewById(R.id.map_center_info).setVisibility(visibility);
updateVisibility(mapActivity.findViewById(R.id.map_right_widgets_panel), visible); mapActivity.findViewById(R.id.map_left_widgets_panel).setVisibility(visibility);
} mapActivity.findViewById(R.id.map_right_widgets_panel).setVisibility(visibility);
public boolean updateVisibility(View v, boolean visible) {
if (visible != (v.getVisibility() == View.VISIBLE)) {
if (visible) {
v.setVisibility(View.VISIBLE);
} else {
v.setVisibility(View.GONE);
}
v.invalidate();
return true;
}
return false;
} }
// timeout in msec // timeout in msec