Map update
This commit is contained in:
parent
e5b240b728
commit
8f8c4b0874
20 changed files with 571 additions and 78 deletions
13
OsmAnd/res/drawable/btn_circle.xml
Normal file
13
OsmAnd/res/drawable/btn_circle.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true"><shape android:shape="oval">
|
||||
<solid android:color="@color/map_widget_light_pressed" />
|
||||
<stroke android:color="@color/map_widget_stroke" android:width="@dimen/map_button_stroke"/>
|
||||
</shape></item>
|
||||
<item><shape android:shape="oval">
|
||||
<solid android:color="@color/map_widget_light" />
|
||||
<stroke android:color="@color/map_widget_stroke" android:width="@dimen/map_button_stroke"/>
|
||||
</shape></item>
|
||||
|
||||
</selector>
|
9
OsmAnd/res/drawable/btn_circle_transparent.xml
Normal file
9
OsmAnd/res/drawable/btn_circle_transparent.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true"><inset android:insetBottom="@dimen/map_button_inset" android:insetLeft="@dimen/map_button_inset" android:insetRight="@dimen/map_button_inset" android:insetTop="@dimen/map_button_inset">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/map_widget_light_pressed" />
|
||||
</shape>
|
||||
</inset></item>
|
||||
</selector>
|
14
OsmAnd/res/drawable/btn_flat.xml
Normal file
14
OsmAnd/res/drawable/btn_flat.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true"><shape android:shape="rectangle">
|
||||
<solid android:color="@color/map_widget_light_pressed" />
|
||||
<stroke android:width="@dimen/map_button_stroke" android:color="@color/map_widget_stroke" />
|
||||
<corners android:radius="@dimen/map_button_rect_rad" />
|
||||
</shape></item>
|
||||
<item><shape android:shape="rectangle">
|
||||
<solid android:color="@color/map_widget_light" />
|
||||
<stroke android:width="@dimen/map_button_stroke" android:color="@color/map_widget_stroke" />
|
||||
</shape></item>
|
||||
|
||||
</selector>
|
16
OsmAnd/res/drawable/btn_inset_circle.xml
Normal file
16
OsmAnd/res/drawable/btn_inset_circle.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true"><inset android:insetBottom="@dimen/map_button_inset" android:insetLeft="@dimen/map_button_inset" android:insetRight="@dimen/map_button_inset" android:insetTop="@dimen/map_button_inset">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/map_widget_light_pressed" />
|
||||
<stroke android:color="@color/map_widget_stroke" android:width="@dimen/map_button_stroke"/>
|
||||
</shape>
|
||||
</inset></item>
|
||||
<item><inset android:insetBottom="@dimen/map_button_inset" android:insetLeft="@dimen/map_button_inset" android:insetRight="@dimen/map_button_inset" android:insetTop="@dimen/map_button_inset">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/map_widget_light" />
|
||||
<stroke android:color="@color/map_widget_stroke" android:width="@dimen/map_button_stroke"/>
|
||||
</shape>
|
||||
</inset></item>
|
||||
</selector>
|
15
OsmAnd/res/drawable/btn_left_round.xml
Normal file
15
OsmAnd/res/drawable/btn_left_round.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true"><shape android:shape="rectangle">
|
||||
<solid android:color="@color/map_widget_light_pressed" />
|
||||
<corners android:radius="@dimen/map_button_rect_rad" />
|
||||
<stroke android:color="@color/map_widget_stroke" android:width="@dimen/map_button_stroke"/>
|
||||
</shape></item>
|
||||
<item><shape android:shape="rectangle">
|
||||
<solid android:color="@color/map_widget_light" />
|
||||
<corners android:topLeftRadius="@dimen/map_button_rect_rad" android:bottomLeftRadius="@dimen/map_button_rect_rad" />
|
||||
<stroke android:color="@color/map_widget_stroke" android:width="@dimen/map_button_stroke"/>
|
||||
</shape></item>
|
||||
|
||||
</selector>
|
18
OsmAnd/res/drawable/btn_right_round.xml
Normal file
18
OsmAnd/res/drawable/btn_right_round.xml
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true"><shape android:shape="rectangle">
|
||||
<solid android:color="@color/map_widget_light_pressed" />
|
||||
<corners android:radius="@dimen/map_button_rect_rad" />
|
||||
<stroke android:color="@color/map_widget_stroke" android:width="@dimen/map_button_stroke"/>
|
||||
</shape></item>
|
||||
<item><shape android:shape="rectangle">
|
||||
<solid android:color="@color/map_widget_light" />
|
||||
<corners
|
||||
android:topRightRadius="@dimen/map_button_rect_rad"
|
||||
android:bottomRightRadius="@dimen/map_button_rect_rad"
|
||||
/>
|
||||
<stroke android:color="@color/map_widget_stroke" android:width="@dimen/map_button_stroke"/>
|
||||
</shape></item>
|
||||
|
||||
</selector>
|
15
OsmAnd/res/drawable/btn_round.xml
Normal file
15
OsmAnd/res/drawable/btn_round.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true"><shape android:shape="rectangle">
|
||||
<solid android:color="@color/map_widget_light_pressed" />
|
||||
<corners android:radius="@dimen/map_button_rect_rad" />
|
||||
<stroke android:width="@dimen/map_button_stroke" android:color="@color/map_widget_stroke" />
|
||||
</shape></item>
|
||||
<item><shape android:shape="rectangle">
|
||||
<solid android:color="@color/map_widget_light" />
|
||||
<corners android:radius="@dimen/map_button_rect_rad" />
|
||||
<stroke android:width="@dimen/map_button_stroke" android:color="@color/map_widget_stroke" />
|
||||
</shape></item>
|
||||
|
||||
</selector>
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true"><shape android:shape="oval">
|
||||
<solid android:color="#eeaaaaaa" />
|
||||
</shape></item>
|
||||
<item><shape android:shape="oval">
|
||||
<solid android:color="#eeffffff" />
|
||||
</shape></item>
|
||||
|
||||
</selector>
|
|
@ -48,7 +48,7 @@
|
|||
<include
|
||||
android:id="@+id/map_part_dashboard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dashboard_map_top_padding"
|
||||
android:layout_height="match_parent"
|
||||
layout="@layout/map_view_on_dashboard" />
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -1,55 +1,72 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v4.widget.DrawerLayout
|
||||
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/drawer_layout"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:id="@+id/ParentLayout"
|
||||
android:id="@+id/MapViewWithLayers"
|
||||
android:clipChildren="false"
|
||||
android:keepScreenOn="true"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical" >
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/atlasMapRendererViewStub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inflatedId="@+id/atlasMapRendererView"
|
||||
android:layout="@layout/atlas_map_renderer_view"/>
|
||||
android:layout="@layout/atlas_map_renderer_view" />
|
||||
|
||||
<net.osmand.plus.views.OsmAndMapSurfaceView
|
||||
android:id="@+id/MapView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:contentDescription="@string/shared_string_map"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<net.osmand.plus.views.OsmAndMapLayersView
|
||||
android:id="@+id/MapLayersView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:contentDescription="@string/shared_string_map"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<FrameLayout android:id="@+id/MapInfoControls"
|
||||
<!-- deprecated -->
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/MapInfoControls"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dialog_layout"
|
||||
android:id="@+id/WaypointVisit"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:orientation="horizontal"/>
|
||||
android:orientation="horizontal" />
|
||||
|
||||
|
||||
<FrameLayout android:id="@+id/MapButtons"
|
||||
<FrameLayout
|
||||
android:id="@+id/MapButtons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
||||
<FrameLayout
|
||||
android:id="@+id/MapHudButtonsOverlay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
<include layout="@layout/map_hud_top" />
|
||||
<include layout="@layout/map_hud_bottom" />
|
||||
</FrameLayout>
|
||||
|
||||
<include
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
layout="@layout/dashboard_over_map" />
|
||||
|
||||
|
||||
<ListView
|
||||
android:id="@+id/left_drawer"
|
||||
|
@ -59,6 +76,6 @@
|
|||
android:background="?attr/expandable_list_background"
|
||||
android:choiceMode="singleChoice"
|
||||
android:divider="@drawable/divider"
|
||||
android:dividerHeight="1dp"/>
|
||||
android:dividerHeight="1dp" />
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
127
OsmAnd/res/layout/map_hud_bottom.xml
Normal file
127
OsmAnd/res/layout/map_hud_bottom.xml
Normal file
|
@ -0,0 +1,127 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|left"
|
||||
android:layout_marginBottom="@dimen/map_button_margin"
|
||||
android:layout_marginLeft="@dimen/map_button_margin" >
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="@dimen/map_button_size"
|
||||
android:layout_height="@dimen/map_button_size"
|
||||
android:background="@drawable/btn_round"
|
||||
android:src="@drawable/ic_action_remove_light" />
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="@dimen/map_button_size"
|
||||
android:layout_height="@dimen/map_button_size"
|
||||
android:layout_marginLeft="@dimen/map_button_spacing"
|
||||
android:background="@drawable/btn_round"
|
||||
android:src="@drawable/ic_action_remove_light" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|right"
|
||||
android:layout_marginBottom="@dimen/map_button_margin"
|
||||
android:layout_marginRight="@dimen/map_button_margin" >
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="@dimen/map_button_size"
|
||||
android:layout_height="@dimen/map_button_size"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/btn_circle"
|
||||
android:src="@drawable/ic_action_remove_light" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginLeft="@dimen/map_button_spacing"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/"
|
||||
android:layout_width="@dimen/map_button_size"
|
||||
android:layout_height="@dimen/map_button_size"
|
||||
android:background="@drawable/btn_circle"
|
||||
|
||||
android:src="@drawable/ic_action_remove_light" />
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="@dimen/map_button_size"
|
||||
android:layout_height="@dimen/map_button_size"
|
||||
android:layout_marginTop="@dimen/map_button_spacing"
|
||||
android:background="@drawable/btn_circle"
|
||||
android:src="@drawable/ic_action_remove_light" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/btn_flat"
|
||||
android:layout_gravity="bottom" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:text="Route preparation" >
|
||||
</TextView>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@drawable/btn_flat"
|
||||
android:layout_gravity="bottom">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_black"
|
||||
android:textSize="24sp"
|
||||
android:maxLines="1"
|
||||
android:text="Context menu" >
|
||||
</TextView>
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="@dimen/map_address_height"
|
||||
android:layout_height="@dimen/map_address_height"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/btn_circle_transparent"
|
||||
android:src="@drawable/ic_action_remove_light" />
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="@dimen/map_address_height"
|
||||
android:layout_height="@dimen/map_address_height"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/btn_circle_transparent"
|
||||
android:src="@drawable/ic_action_remove_light" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
162
OsmAnd/res/layout/map_hud_top.xml
Normal file
162
OsmAnd/res/layout/map_hud_top.xml
Normal file
|
@ -0,0 +1,162 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<!-- TOP ROW -->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/WaypointVisit2"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="@dimen/map_address_height"
|
||||
android:background="@drawable/btn_flat"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/map_address_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:text="TEST Street name"
|
||||
android:textColor="@color/color_black"
|
||||
android:textSize="24sp" >
|
||||
</TextView>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/waypoint_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_action_remove_light" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/waypoint_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_remove_light" />
|
||||
</LinearLayout>
|
||||
<!-- Widgets -->
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<!-- LEFT widgets colon -->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|left"
|
||||
android:layout_weight="0.4"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|left"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/map_hud_widget" />
|
||||
<include layout="@layout/map_hud_widget" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|left"
|
||||
android:layout_marginLeft="@dimen/map_button_margin"
|
||||
android:layout_marginTop="@dimen/map_button_margin"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/map_layers_button"
|
||||
android:layout_width="@dimen/map_button_size"
|
||||
android:layout_height="@dimen/map_button_size"
|
||||
android:background="@drawable/btn_inset_circle"
|
||||
android:src="@drawable/ic_action_remove_light" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/map_compass_button"
|
||||
android:layout_width="@dimen/map_button_size"
|
||||
android:layout_height="@dimen/map_button_size"
|
||||
android:background="@drawable/btn_inset_circle"
|
||||
android:src="@drawable/ic_action_remove_light" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- empty block to not let widgets grow more than 40% -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="0.6" >
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- CENTER TODO -->
|
||||
<!-- RIGHT widgets colon -->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1" >
|
||||
|
||||
<!-- empty block to not let widgets grow more than 40% -->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="0.6" >
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|right"
|
||||
android:layout_weight="0.4"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|right"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<include layout="@layout/map_hud_widget" />
|
||||
|
||||
|
||||
<include layout="@layout/map_hud_widget" />
|
||||
|
||||
<include layout="@layout/map_hud_widget" />
|
||||
|
||||
<include layout="@layout/map_hud_widget" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|right"
|
||||
android:layout_marginRight="@dimen/map_button_margin"
|
||||
android:layout_marginTop="@dimen/map_button_margin"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="@dimen/map_button_size"
|
||||
android:layout_height="@dimen/map_button_size"
|
||||
android:background="@drawable/btn_inset_circle"
|
||||
android:src="@drawable/ic_action_remove_light" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
38
OsmAnd/res/layout/map_hud_widget.xml
Normal file
38
OsmAnd/res/layout/map_hud_widget.xml
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:minWidth="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/btn_left_round"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/map_widget_image"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_action_close_light"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/map_widget_height"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/map_widget_icon"
|
||||
android:layout_height="@dimen/map_widget_icon"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/ic_action_remove_light" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/color_black"
|
||||
android:text="202 km" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -10,7 +10,7 @@
|
|||
android:layout_gravity="top|left"
|
||||
android:layout_marginLeft="@dimen/map_button_margin"
|
||||
android:layout_marginTop="@dimen/map_button_margin"
|
||||
android:background="@drawable/roundedbutton"
|
||||
android:background="@drawable/btn_inset_circle"
|
||||
android:src="@drawable/ic_action_layers_light" />
|
||||
|
||||
<Button
|
||||
|
@ -18,6 +18,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
android:text="@string/shared_string_download" />
|
||||
|
||||
</FrameLayout>
|
|
@ -10,6 +10,10 @@
|
|||
<color name="list_item_background_dark">#333b40</color>
|
||||
<color name="list_item_background_dark_pressed">#be39464d</color>
|
||||
|
||||
<color name="map_widget_stroke">#333333</color>
|
||||
<color name="map_widget_light">#eeffffff</color>
|
||||
<color name="map_widget_light_pressed">#ddcccccc</color>
|
||||
|
||||
|
||||
<color name="actionbar_dark_color">#39464d</color>
|
||||
<color name="tool_bar_color_dark">#CC080B0D</color>
|
||||
|
|
|
@ -47,8 +47,18 @@
|
|||
<dimen name="dashboard_map_bottom_padding">90dp</dimen>
|
||||
<dimen name="dashboard_parking_left_margin">16dp</dimen>
|
||||
<dimen name="dashboard_parking_icon_size">48dp</dimen>
|
||||
<dimen name="map_button_size">40dp</dimen>
|
||||
<dimen name="map_button_margin">8dp</dimen>
|
||||
<!-- map buttons -->
|
||||
<dimen name="map_address_height">40dp</dimen>
|
||||
<dimen name="map_button_size">48dp</dimen>
|
||||
<dimen name="map_widget_icon">24dp</dimen>
|
||||
<dimen name="map_widget_height">32dp</dimen>
|
||||
<dimen name="map_widget_image">80dp</dimen>
|
||||
<dimen name="map_button_spacing">20dp</dimen>
|
||||
<dimen name="map_button_margin">4dp</dimen>
|
||||
<dimen name="map_button_inset">4dp</dimen>
|
||||
<dimen name="map_button_rect_rad">3dp</dimen>
|
||||
<dimen name="map_button_stroke">1px</dimen>
|
||||
|
||||
|
||||
|
||||
<!-- TextSizes -->
|
||||
|
|
|
@ -176,7 +176,7 @@ public class MapActivity extends AccessibleActivity {
|
|||
}
|
||||
mapView.refreshMap(true);
|
||||
findViewById(R.id.init_progress).setVisibility(View.GONE);
|
||||
findViewById(R.id.ParentLayout).invalidate();
|
||||
findViewById(R.id.drawer_layout).invalidate();
|
||||
}
|
||||
};
|
||||
getMyApplication().checkApplicationIsBeingInitialized(this, initListener);
|
||||
|
|
|
@ -75,9 +75,11 @@ public class DashboardOnMap {
|
|||
|
||||
public void createDashboardView() {
|
||||
landscape = !ScreenOrientationHelper.isOrientationPortrait(mapActivity);
|
||||
dashboardView = (FrameLayout) mapActivity.getLayoutInflater().inflate(R.layout.dashboard_over_map, null, false);
|
||||
dashboardView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
// dashboardView = (FrameLayout) mapActivity.getLayoutInflater().inflate(R.layout.dashboard_over_map, null, false);
|
||||
// dashboardView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
// ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
// ((FrameLayout) mapActivity.findViewById(R.id.MapHudButtonsOverlay)).addView(dashboardView);
|
||||
dashboardView = (FrameLayout) mapActivity.findViewById(R.id.dashboard);
|
||||
View.OnClickListener listener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -86,7 +88,7 @@ public class DashboardOnMap {
|
|||
};
|
||||
dashboardView.findViewById(R.id.animateContent).setOnClickListener(listener);
|
||||
dashboardView.setOnClickListener(listener);
|
||||
((FrameLayout) mapActivity.findViewById(R.id.ParentLayout)).addView(dashboardView);
|
||||
|
||||
|
||||
dashboardView.findViewById(R.id.map_layers_button).setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
|
@ -103,7 +105,7 @@ public class DashboardOnMap {
|
|||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
|
||||
fabButton = new FloatingActionButton.Builder(mapActivity)
|
||||
.withDrawable(mapActivity.getResources().getDrawable(R.drawable.ic_action_map))
|
||||
.withDrawable(mapActivity.getResources().getDrawable(R.drawable.ic_action_get_my_location))
|
||||
.withButtonColor(mapActivity.getResources().getColor(R.color.color_myloc_distance))
|
||||
.withGravity(landscape ? Gravity.BOTTOM | Gravity.RIGHT : Gravity.TOP | Gravity.RIGHT)
|
||||
.withMargins(0, landscape ? 0 : 160, 16, landscape ? 16 : 0).create();
|
||||
|
@ -294,7 +296,7 @@ public class DashboardOnMap {
|
|||
|
||||
// To animate view slide out from right to left
|
||||
private void open(View view){
|
||||
TranslateAnimation animate = new TranslateAnimation(-mapActivity.findViewById(R.id.ParentLayout).getWidth(),0,0,0);
|
||||
TranslateAnimation animate = new TranslateAnimation(-mapActivity.findViewById(R.id.MapHudButtonsOverlay).getWidth(),0,0,0);
|
||||
animate.setDuration(500);
|
||||
animate.setFillAfter(true);
|
||||
view.startAnimation(animate);
|
||||
|
@ -302,7 +304,7 @@ public class DashboardOnMap {
|
|||
}
|
||||
|
||||
private void hide(View view) {
|
||||
TranslateAnimation animate = new TranslateAnimation(0, -mapActivity.findViewById(R.id.ParentLayout).getWidth(), 0, 0);
|
||||
TranslateAnimation animate = new TranslateAnimation(0, -mapActivity.findViewById(R.id.MapHudButtonsOverlay).getWidth(), 0, 0);
|
||||
animate.setDuration(500);
|
||||
animate.setFillAfter(true);
|
||||
animate.setAnimationListener(new AnimationListener() {
|
||||
|
|
|
@ -71,7 +71,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
|||
this.app = mapActivity.getMyApplication();
|
||||
waypointHelper = this.app.getWaypointHelper();
|
||||
this.mapActivity = mapActivity;
|
||||
this.mainLayout = (LinearLayout) mapActivity.findViewById(R.id.dialog_layout);
|
||||
this.mainLayout = (LinearLayout) mapActivity.findViewById(R.id.WaypointVisit);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.osmand.plus.views;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import android.content.pm.ActivityInfo;
|
||||
|
@ -88,6 +89,8 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
int rightCenterGravity = Gravity.RIGHT | Gravity.CENTER;
|
||||
int leftCenterGravity = Gravity.LEFT | Gravity.CENTER;
|
||||
|
||||
|
||||
initNewControls();
|
||||
// default buttons
|
||||
zoomControls = init(new MapZoomControls(mapActivity, showUIHandler, scaleCoefficient), parent,
|
||||
rightGravity);
|
||||
|
@ -117,14 +120,50 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
|
||||
rulerControl = init(new RulerControl(zoomControls, mapActivity, showUIHandler, scaleCoefficient), parent,
|
||||
rightGravity);
|
||||
initTransparencyBar(view, parent);
|
||||
|
||||
mapRoutePlanControl.setMargin(mapMenuControls.getWidth());
|
||||
mapCancelNavigationControl.setMargin(mapSmallMenuControls.getWidth());
|
||||
mapInfoNavigationControl.setMargin(mapSmallMenuControls.getWidth() + mapCancelNavigationControl.getWidth());
|
||||
mapAppModeControl.setMargin(mapNavigationControl.getWidth());
|
||||
|
||||
initTransparencyBar(view, parent);
|
||||
;
|
||||
}
|
||||
|
||||
private void initNewControls() {
|
||||
initZooms();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void initZooms() {
|
||||
final OsmandMapTileView view = mapActivity.getMapView();
|
||||
mapActivity.findViewById(id)
|
||||
zoomInButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
notifyClicked();
|
||||
if (view.isZooming()) {
|
||||
mapActivity.changeZoom(2, System.currentTimeMillis());
|
||||
} else {
|
||||
mapActivity.changeZoom(1, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
final View.OnLongClickListener listener = MapZoomControls.getOnClickMagnifierListener(view);
|
||||
zoomInButton.setOnLongClickListener(listener);
|
||||
zoomOutButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
notifyClicked();
|
||||
mapActivity.changeZoom(-1, System.currentTimeMillis());
|
||||
}
|
||||
});
|
||||
zoomOutButton.setOnLongClickListener(listener);
|
||||
}
|
||||
|
||||
|
||||
public void startNavigation() {
|
||||
if (mapNavigationControl == null) {
|
||||
return;
|
||||
|
@ -148,6 +187,10 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
}
|
||||
|
||||
protected void notifyClicked(MapControls m) {
|
||||
notifyClicked();
|
||||
}
|
||||
|
||||
protected void notifyClicked() {
|
||||
if(mapNavigationControl != null) {
|
||||
mapNavigationControl.stopCounter();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue