Merge pull request #4502 from osmandapp/context_menu_hide

Hide topbar and widgets when context menu is open
This commit is contained in:
Alexey 2017-10-02 17:32:53 +03:00 committed by GitHub
commit 6d428ef621
6 changed files with 565 additions and 553 deletions

View file

@ -7,186 +7,186 @@
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <FrameLayout
android:id="@+id/map_markers_top_bar" android:id="@+id/map_markers_top_bar"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:minHeight="@dimen/map_address_height"
android:visibility="gone"
tools:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:clickable="true"
android:minHeight="@dimen/map_address_height"
android:visibility="gone"
tools:visibility="visible">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="vertical">
<FrameLayout <LinearLayout
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:orientation="horizontal">
android:background="@color/markers_top_bar_background"
android:minHeight="50dp">
<LinearLayout <FrameLayout
android:id="@+id/map_marker_row" android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_weight="1"
android:background="?attr/selectableItemBackground" android:background="@color/markers_top_bar_background"
android:gravity="center_vertical" android:minHeight="50dp">
android:orientation="horizontal">
<ImageView
android:id="@+id/map_marker_arrow"
android:layout_width="60dp"
android:layout_height="24dp"
android:src="@drawable/ic_arrow_marker_diretion"/>
<LinearLayout <LinearLayout
android:layout_width="0dp" android:id="@+id/map_marker_row"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="6dp" android:layout_gravity="center_vertical"
android:layout_marginTop="6dp" android:background="?attr/selectableItemBackground"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/map_marker_dist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="500 m"
android:textColor="@color/color_white"
android:textSize="@dimen/default_list_text_size_large"
android:textStyle="bold"/>
<TextView
android:id="@+id/map_marker_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="Dmitrievskaya st., 45"
android:textColor="@color/marker_top_2nd_line_color"
android:textSize="@dimen/default_desc_text_size"
android:textStyle="bold"/>
</LinearLayout>
<ImageButton
android:id="@+id/marker_btn_ok"
android:contentDescription="@string/shared_string_remove"
android:layout_width="50dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_action_done"/>
<ImageButton
android:id="@+id/marker_btn_more"
android:contentDescription="@string/shared_string_more"
android:layout_width="50dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_overflow_menu_white"/>
</LinearLayout>
</FrameLayout>
<FrameLayout
android:id="@+id/map_markers_top_bar_2nd"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/markers_top_bar_2nd_background"
android:minHeight="50dp"
android:visibility="visible">
<LinearLayout
android:id="@+id/map_marker_row_2nd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/map_marker_arrow_2nd"
android:layout_width="60dp"
android:layout_height="24dp"
android:src="@drawable/ic_arrow_marker_diretion"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:layout_marginTop="6dp"
android:layout_weight="1"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="vertical"> android:orientation="horizontal">
<TextView <ImageView
android:id="@+id/map_marker_dist_2nd" android:id="@+id/map_marker_arrow"
android:layout_width="wrap_content" android:layout_width="60dp"
android:layout_height="wrap_content" android:layout_height="24dp"
android:maxLines="1" android:src="@drawable/ic_arrow_marker_diretion"/>
android:text="500 m"
android:textColor="@color/color_white"
android:textSize="@dimen/default_list_text_size_large"
android:textStyle="bold"/>
<TextView <LinearLayout
android:id="@+id/map_marker_address_2nd" android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:layout_marginBottom="6dp"
android:maxLines="1" android:layout_marginTop="6dp"
android:text="Dmitrievskaya st., 45" android:layout_weight="1"
android:textColor="@color/marker_top_2nd_line_color" android:orientation="vertical">
android:textSize="@dimen/default_desc_text_size"
android:textStyle="bold"/> <TextView
android:id="@+id/map_marker_dist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="500 m"
android:textColor="@color/color_white"
android:textSize="@dimen/default_list_text_size_large"
android:textStyle="bold"/>
<TextView
android:id="@+id/map_marker_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="Dmitrievskaya st., 45"
android:textColor="@color/marker_top_2nd_line_color"
android:textSize="@dimen/default_desc_text_size"
android:textStyle="bold"/>
</LinearLayout>
<ImageButton
android:id="@+id/marker_btn_ok"
android:contentDescription="@string/shared_string_remove"
android:layout_width="50dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_action_done"/>
<ImageButton
android:id="@+id/marker_btn_more"
android:contentDescription="@string/shared_string_more"
android:layout_width="50dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_overflow_menu_white"/>
</LinearLayout> </LinearLayout>
<ImageButton
android:id="@+id/marker_btn_ok_2dn"
android:contentDescription="@string/shared_string_remove"
android:layout_width="50dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_action_done"/>
<ImageButton </FrameLayout>
android:id="@+id/marker_btn_more_2nd"
android:contentDescription="@string/shared_string_more"
android:layout_width="50dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_overflow_menu_white"/>
</LinearLayout> <FrameLayout
android:id="@+id/map_markers_top_bar_2nd"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/markers_top_bar_2nd_background"
android:minHeight="50dp"
android:visibility="visible">
</FrameLayout>
<LinearLayout
android:id="@+id/map_marker_row_2nd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/map_marker_arrow_2nd"
android:layout_width="60dp"
android:layout_height="24dp"
android:src="@drawable/ic_arrow_marker_diretion"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:layout_marginTop="6dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/map_marker_dist_2nd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="500 m"
android:textColor="@color/color_white"
android:textSize="@dimen/default_list_text_size_large"
android:textStyle="bold"/>
<TextView
android:id="@+id/map_marker_address_2nd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="Dmitrievskaya st., 45"
android:textColor="@color/marker_top_2nd_line_color"
android:textSize="@dimen/default_desc_text_size"
android:textStyle="bold"/>
</LinearLayout>
<ImageButton
android:id="@+id/marker_btn_ok_2dn"
android:contentDescription="@string/shared_string_remove"
android:layout_width="50dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_action_done"/>
<ImageButton
android:id="@+id/marker_btn_more_2nd"
android:contentDescription="@string/shared_string_more"
android:layout_width="50dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_overflow_menu_white"/>
</LinearLayout>
</FrameLayout>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="@drawable/bg_contextmenu_shadow"
android:foregroundGravity="top|fill_horizontal"/>
</LinearLayout> </LinearLayout>
<FrameLayout </FrameLayout>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="@drawable/bg_contextmenu_shadow"
android:foregroundGravity="top|fill_horizontal"/>
</LinearLayout>
</FrameLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -232,145 +232,145 @@
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <FrameLayout
android:id="@+id/map_top_bar" android:id="@+id/map_top_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/btn_round"
android:minHeight="@dimen/map_address_height">
<FrameLayout
android:layout_width="wrap_content"
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"/>
<ImageButton <ImageView
android:id="@+id/waypoint_close" android:id="@+id/waypoint_icon"
android:contentDescription="@string/shared_string_close" android:layout_width="wrap_content"
android:layout_width="@dimen/map_address_height" android:layout_height="wrap_content"
android:layout_height="@dimen/map_address_height" android:layout_gravity="center_vertical"
android:background="@drawable/btn_circle_transparent" android:layout_marginLeft="@dimen/map_button_margin"
android:src="@drawable/ic_action_test_light"/> android:layout_marginRight="@dimen/map_button_margin"
</LinearLayout> android:src="@drawable/ic_action_test_light"/>
</FrameLayout>
<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>
<FrameLayout <FrameLayout
android:id="@+id/widget_top_bar" android:id="@+id/widget_top_bar"

View file

@ -9,145 +9,145 @@
<!-- TOP ROW --> <!-- TOP ROW -->
<FrameLayout <FrameLayout
android:id="@+id/map_top_bar" android:id="@+id/map_top_bar"
android:layout_width="fill_parent"
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
android:layout_width="wrap_content"
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
</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"
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
android:id="@+id/widget_top_bar" android:id="@+id/widget_top_bar"
@ -285,175 +285,175 @@
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:id="@+id/map_markers_top_bar" android:id="@+id/map_markers_top_bar"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:minHeight="@dimen/map_address_height"
android:visibility="gone"
tools:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:clickable="true"
android:minHeight="@dimen/map_address_height"
android:visibility="gone"
tools:visibility="visible">
<FrameLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="60dp" android:orientation="vertical">
android:background="@color/markers_top_bar_background">
<LinearLayout <FrameLayout
android:id="@+id/map_marker_row"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground" android:minHeight="60dp"
android:layout_gravity="center_vertical" android:background="@color/markers_top_bar_background">
android:gravity="center_vertical"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/map_marker_arrow"
android:layout_width="66dp"
android:layout_height="36dp"
android:src="@drawable/ic_arrow_marker_diretion"/>
<LinearLayout <LinearLayout
android:layout_width="0dp" android:id="@+id/map_marker_row"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:background="?attr/selectableItemBackground"
android:orientation="vertical"> android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:orientation="horizontal">
<TextView <ImageView
android:id="@+id/map_marker_dist" android:id="@+id/map_marker_arrow"
android:layout_width="wrap_content" android:layout_width="66dp"
android:layout_height="wrap_content" android:layout_height="36dp"
android:textStyle="bold" android:src="@drawable/ic_arrow_marker_diretion"/>
android:textSize="26sp"
android:textColor="@color/color_white"
android:text="500 m"/>
<TextView <LinearLayout
android:id="@+id/map_marker_address" android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/marker_top_2nd_line_color" android:layout_weight="1"
android:textStyle="bold" android:orientation="vertical">
android:maxLines="1"
android:ellipsize="end" <TextView
android:textSize="@dimen/default_list_text_size" android:id="@+id/map_marker_dist"
android:text="Dmitrievskaya st., 45"/> android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textSize="26sp"
android:textColor="@color/color_white"
android:text="500 m"/>
<TextView
android:id="@+id/map_marker_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/marker_top_2nd_line_color"
android:textStyle="bold"
android:maxLines="1"
android:ellipsize="end"
android:textSize="@dimen/default_list_text_size"
android:text="Dmitrievskaya st., 45"/>
</LinearLayout>
<ImageButton
android:id="@+id/marker_btn_ok"
android:contentDescription="@string/shared_string_remove"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_action_done"/>
<ImageButton
android:id="@+id/marker_btn_more"
android:contentDescription="@string/shared_string_more"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_overflow_menu_white"/>
</LinearLayout> </LinearLayout>
<ImageButton
android:id="@+id/marker_btn_ok"
android:contentDescription="@string/shared_string_remove"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_action_done"/>
<ImageButton </FrameLayout>
android:id="@+id/marker_btn_more"
android:contentDescription="@string/shared_string_more"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_overflow_menu_white"/>
</LinearLayout>
</FrameLayout>
<FrameLayout
android:id="@+id/map_markers_top_bar_2nd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="50dp"
android:background="@color/markers_top_bar_2nd_background"
android:visibility="visible">
<FrameLayout <FrameLayout
android:id="@+id/map_markers_top_bar_2nd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="50dp"
android:background="@color/markers_top_bar_2nd_background"
android:visibility="visible">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="@drawable/bg_contextmenu_shadow"
android:foregroundGravity="top|fill_horizontal"/>
<LinearLayout
android:id="@+id/map_marker_row_2nd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/map_marker_arrow_2nd"
android:layout_width="66dp"
android:layout_height="24dp"
android:src="@drawable/ic_arrow_marker_diretion"/>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/map_marker_dist_2nd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="500 m"
android:textColor="@color/color_white"
android:textSize="@dimen/default_list_text_size_large"
android:textStyle="bold"/>
<TextView
android:id="@+id/map_marker_address_2nd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/map_marker_dist_2nd"
android:layout_toRightOf="@+id/map_marker_dist_2nd"
android:ellipsize="end"
android:maxLines="1"
android:text=" • Dmitr"
android:textColor="@color/marker_top_2nd_line_color"
android:textSize="@dimen/default_list_text_size"
android:textStyle="bold"/>
</RelativeLayout>
<ImageButton
android:id="@+id/marker_btn_ok_2dn"
android:contentDescription="@string/shared_string_remove"
android:layout_width="50dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_action_done"/>
</LinearLayout>
</FrameLayout>
<FrameLayout
android:id="@+id/map_markers_top_bar_shadow"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:foreground="@drawable/bg_contextmenu_shadow" android:foreground="@drawable/bg_contextmenu_shadow"
android:foregroundGravity="top|fill_horizontal"/> android:foregroundGravity="top|fill_horizontal"/>
<LinearLayout </LinearLayout>
android:id="@+id/map_marker_row_2nd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView </FrameLayout>
android:id="@+id/map_marker_arrow_2nd"
android:layout_width="66dp"
android:layout_height="24dp"
android:src="@drawable/ic_arrow_marker_diretion"/>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/map_marker_dist_2nd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="500 m"
android:textColor="@color/color_white"
android:textSize="@dimen/default_list_text_size_large"
android:textStyle="bold"/>
<TextView
android:id="@+id/map_marker_address_2nd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/map_marker_dist_2nd"
android:layout_toRightOf="@+id/map_marker_dist_2nd"
android:ellipsize="end"
android:maxLines="1"
android:text=" • Dmitr"
android:textColor="@color/marker_top_2nd_line_color"
android:textSize="@dimen/default_list_text_size"
android:textStyle="bold"/>
</RelativeLayout>
<ImageButton
android:id="@+id/marker_btn_ok_2dn"
android:contentDescription="@string/shared_string_remove"
android:layout_width="50dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_action_done"/>
</LinearLayout>
</FrameLayout>
<FrameLayout
android:id="@+id/map_markers_top_bar_shadow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="@drawable/bg_contextmenu_shadow"
android:foregroundGravity="top|fill_horizontal"/>
</LinearLayout>
</FrameLayout>
<!-- Widgets --> <!-- Widgets -->

View file

@ -368,6 +368,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
fragmentRef.get().centerMarkerLocation(); fragmentRef.get().centerMarkerLocation();
} }
} }
updateWidgetsVisibility(false);
} }
public void show(@NonNull LatLon latLon, public void show(@NonNull LatLon latLon,
@ -388,6 +389,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
} }
centerMarker = false; centerMarker = false;
autoHide = false; autoHide = false;
updateWidgetsVisibility(false);
} }
public void update(LatLon latLon, PointDescription pointDescription, Object object) { public void update(LatLon latLon, PointDescription pointDescription, Object object) {
@ -446,6 +448,15 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
if (fragmentRef != null) { if (fragmentRef != null) {
fragmentRef.get().dismissMenu(); fragmentRef.get().dismissMenu();
} }
updateWidgetsVisibility(true);
}
private void updateWidgetsVisibility(boolean visible) {
int visibility = visible ? View.VISIBLE : View.GONE;
mapActivity.findViewById(R.id.map_center_info).setVisibility(visibility);
mapActivity.findViewById(R.id.map_left_widgets_panel).setVisibility(visibility);
mapActivity.findViewById(R.id.map_right_widgets_panel).setVisibility(visibility);
mapActivity.refreshMap();
} }
// timeout in msec // timeout in msec
@ -638,15 +649,15 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
} }
if (searchDoneAction != null) { if (searchDoneAction != null) {
if (searchDoneAction.dlg != null) { if (searchDoneAction.dlg != null) {
try { try {
searchDoneAction.dlg.dismiss(); searchDoneAction.dlg.dismiss();
} catch (Exception e) { } catch (Exception e) {
// ignore // ignore
} finally { } finally {
searchDoneAction.dlg = null; searchDoneAction.dlg = null;
}
} }
}
searchDoneAction.run(); searchDoneAction.run();
searchDoneAction = null; searchDoneAction = null;
} }
@ -713,7 +724,6 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
} }
public void buttonFavoritePressed() { public void buttonFavoritePressed() {
if (object != null && object instanceof FavouritePoint) { if (object != null && object instanceof FavouritePoint) {
getFavoritePointEditor().edit((FavouritePoint) object); getFavoritePointEditor().edit((FavouritePoint) object);
@ -815,7 +825,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
} }
} }
public void addWptPt(LatLon latLon, String title, String categoryName, int categoryColor, boolean skipDialog){ public void addWptPt(LatLon latLon, String title, String categoryName, int categoryColor, boolean skipDialog) {
final List<SelectedGpxFile> list final List<SelectedGpxFile> list
= mapActivity.getMyApplication().getSelectedGpxHelper().getSelectedGPXFiles(); = mapActivity.getMyApplication().getSelectedGpxHelper().getSelectedGPXFiles();
@ -833,7 +843,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
} }
} }
public AlertDialog addNewWptToGPXFile(final LatLon latLon, final String title, public AlertDialog addNewWptToGPXFile(final LatLon latLon, final String title,
final String categoryName, final String categoryName,
final int categoryColor, final boolean skipDialog) { final int categoryColor, final boolean skipDialog) {
CallbackWithObject<GPXFile[]> callbackWithObject = new CallbackWithObject<GPXFile[]>() { CallbackWithObject<GPXFile[]> callbackWithObject = new CallbackWithObject<GPXFile[]>() {

View file

@ -708,11 +708,12 @@ public class MapControlsLayer extends OsmandMapLayer {
boolean routeFollowingMode = !routePlanningMode && rh.isFollowingMode(); boolean routeFollowingMode = !routePlanningMode && rh.isFollowingMode();
boolean routeDialogOpened = MapRouteInfoMenu.isVisible(); boolean routeDialogOpened = MapRouteInfoMenu.isVisible();
boolean trackDialogOpened = TrackDetailsMenu.isVisible(); boolean trackDialogOpened = TrackDetailsMenu.isVisible();
boolean contextMenuOpened = mapActivity.getContextMenu().isVisible();
boolean showRouteCalculationControls = routePlanningMode || boolean showRouteCalculationControls = routePlanningMode ||
((app.accessibilityEnabled() || (System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS)) && routeFollowingMode); ((app.accessibilityEnabled() || (System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS)) && routeFollowingMode);
updateMyLocation(rh, routeDialogOpened || trackDialogOpened); updateMyLocation(rh, routeDialogOpened || trackDialogOpened || contextMenuOpened);
boolean showButtons = (showRouteCalculationControls || !routeFollowingMode) boolean showButtons = (showRouteCalculationControls || !routeFollowingMode)
&& !isInMovingMarkerMode() && !isInGpxDetailsMode() && !isInMeasurementToolMode() && !isInPlanRouteMode(); && !isInMovingMarkerMode() && !isInGpxDetailsMode() && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened;
//routePlanningBtn.setIconResId(routeFollowingMode ? R.drawable.ic_action_gabout_dark : R.drawable.map_directions); //routePlanningBtn.setIconResId(routeFollowingMode ? R.drawable.ic_action_gabout_dark : R.drawable.map_directions);
if (rh.isFollowingMode()) { if (rh.isFollowingMode()) {
routePlanningBtn.setIconResId(R.drawable.map_start_navigation); routePlanningBtn.setIconResId(R.drawable.map_start_navigation);
@ -727,16 +728,16 @@ public class MapControlsLayer extends OsmandMapLayer {
routePlanningBtn.updateVisibility(showButtons); routePlanningBtn.updateVisibility(showButtons);
menuControl.updateVisibility(showButtons); menuControl.updateVisibility(showButtons);
mapZoomIn.updateVisibility(!routeDialogOpened); mapZoomIn.updateVisibility(!routeDialogOpened && !contextMenuOpened);
mapZoomOut.updateVisibility(!routeDialogOpened); mapZoomOut.updateVisibility(!routeDialogOpened && !contextMenuOpened);
compassHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && shouldShowCompass() compassHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && shouldShowCompass()
&& !isInMeasurementToolMode() && !isInPlanRouteMode()); && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened);
if (layersHud.setIconResId(settings.getApplicationMode().getMapIconId())) { if (layersHud.setIconResId(settings.getApplicationMode().getMapIconId())) {
layersHud.update(app, isNight); layersHud.update(app, isNight);
} }
layersHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode()); layersHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened);
quickSearchHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode()); quickSearchHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened);
if (!routePlanningMode && !routeFollowingMode) { if (!routePlanningMode && !routeFollowingMode) {
if (mapView.isZooming()) { if (mapView.isZooming()) {

View file

@ -577,7 +577,7 @@ public class MapInfoWidgetsFactory {
initToolbar(defaultController); initToolbar(defaultController);
defaultController.updateToolbar(this); defaultController.updateToolbar(this);
} }
updateVisibility(controller != null); updateVisibility(controller != null && (!map.getContextMenu().isVisible() || controller.getType() == TopToolbarControllerType.CONTEXT_MENU));
} }
public void updateColors(TopToolbarController controller) { public void updateColors(TopToolbarController controller) {
@ -801,7 +801,7 @@ public class MapInfoWidgetsFactory {
} }
} }
} }
if (map.isTopToolbarActive()) { if (map.isTopToolbarActive() || map.getContextMenu().isVisible()) {
updateVisibility(false); updateVisibility(false);
} else if (!showNextTurn && updateWaypoint()) { } else if (!showNextTurn && updateWaypoint()) {
updateVisibility(true); updateVisibility(true);

View file

@ -197,7 +197,8 @@ public class MapMarkersWidgetsFactory {
|| map.getMyApplication().getRoutingHelper().isRoutePlanningMode() || map.getMyApplication().getRoutingHelper().isRoutePlanningMode()
|| MapRouteInfoMenu.isVisible() || MapRouteInfoMenu.isVisible()
|| addressTopBar.getVisibility() == View.VISIBLE || addressTopBar.getVisibility() == View.VISIBLE
|| map.isTopToolbarActive()) { || map.isTopToolbarActive()
|| map.getContextMenu().isVisible()) {
updateVisibility(false); updateVisibility(false);
return; return;
} }