Map update

This commit is contained in:
Victor Shcherb 2015-03-11 20:19:24 +01:00
parent e5b240b728
commit 8f8c4b0874
20 changed files with 571 additions and 78 deletions

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View file

@ -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>

View file

@ -48,7 +48,7 @@
<include <include
android:id="@+id/map_part_dashboard" android:id="@+id/map_part_dashboard"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dashboard_map_top_padding" android:layout_height="match_parent"
layout="@layout/map_view_on_dashboard" /> layout="@layout/map_view_on_dashboard" />
</LinearLayout> </LinearLayout>

View file

@ -1,64 +1,81 @@
<?xml version="1.0" encoding="utf-8"?> <?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" android:id="@+id/drawer_layout"
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
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
android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent" android:layout_width="fill_parent"
android:id="@+id/ParentLayout" android:layout_height="fill_parent"
android:clipChildren="false" android:id="@+id/MapViewWithLayers"
android:keepScreenOn="true" android:clipChildren="false"
android:orientation="vertical"> android:keepScreenOn="true"
android:orientation="vertical" >
<ViewStub <ViewStub
android:id="@+id/atlasMapRendererViewStub" android:id="@+id/atlasMapRendererViewStub"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:inflatedId="@+id/atlasMapRendererView" android:inflatedId="@+id/atlasMapRendererView"
android:layout="@layout/atlas_map_renderer_view"/> android:layout="@layout/atlas_map_renderer_view" />
<net.osmand.plus.views.OsmAndMapSurfaceView <net.osmand.plus.views.OsmAndMapSurfaceView
android:id="@+id/MapView" android:id="@+id/MapView"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:contentDescription="@string/shared_string_map" android:contentDescription="@string/shared_string_map"
android:visibility="gone"/> android:visibility="gone" />
<net.osmand.plus.views.OsmAndMapLayersView <net.osmand.plus.views.OsmAndMapLayersView
android:id="@+id/MapLayersView" android:id="@+id/MapLayersView"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:contentDescription="@string/shared_string_map" android:contentDescription="@string/shared_string_map"
android:visibility="gone"/> android:visibility="gone" />
<!-- deprecated -->
<FrameLayout android:id="@+id/MapInfoControls" <FrameLayout
android:layout_width="match_parent" android:id="@+id/MapInfoControls"
android:layout_height="match_parent"/> android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout <LinearLayout
android:id="@+id/dialog_layout" android:id="@+id/WaypointVisit"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:orientation="horizontal"/> android:orientation="horizontal" />
<FrameLayout
android:id="@+id/MapButtons"
android:layout_width="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" />
<FrameLayout android:id="@+id/MapButtons" <ListView
android:layout_width="match_parent" android:id="@+id/left_drawer"
android:layout_height="match_parent"/> android:layout_width="280dp"
</FrameLayout> android:layout_height="match_parent"
android:layout_gravity="start"
<ListView android:background="?attr/expandable_list_background"
android:id="@+id/left_drawer" android:choiceMode="singleChoice"
android:layout_width="280dp" android:divider="@drawable/divider"
android:layout_height="match_parent" android:dividerHeight="1dp" />
android:layout_gravity="start"
android:background="?attr/expandable_list_background"
android:choiceMode="singleChoice"
android:divider="@drawable/divider"
android:dividerHeight="1dp"/>
</android.support.v4.widget.DrawerLayout> </android.support.v4.widget.DrawerLayout>

View 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>

View 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>

View 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>

View file

@ -10,7 +10,7 @@
android:layout_gravity="top|left" android:layout_gravity="top|left"
android:layout_marginLeft="@dimen/map_button_margin" android:layout_marginLeft="@dimen/map_button_margin"
android:layout_marginTop="@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" /> android:src="@drawable/ic_action_layers_light" />
<Button <Button
@ -18,6 +18,7 @@
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:visibility="gone"
android:text="@string/shared_string_download" /> android:text="@string/shared_string_download" />
</FrameLayout> </FrameLayout>

View file

@ -9,6 +9,10 @@
<color name="list_item_light_pressed">#8cd0d0d0</color> <color name="list_item_light_pressed">#8cd0d0d0</color>
<color name="list_item_background_dark">#333b40</color> <color name="list_item_background_dark">#333b40</color>
<color name="list_item_background_dark_pressed">#be39464d</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="actionbar_dark_color">#39464d</color>

View file

@ -47,8 +47,18 @@
<dimen name="dashboard_map_bottom_padding">90dp</dimen> <dimen name="dashboard_map_bottom_padding">90dp</dimen>
<dimen name="dashboard_parking_left_margin">16dp</dimen> <dimen name="dashboard_parking_left_margin">16dp</dimen>
<dimen name="dashboard_parking_icon_size">48dp</dimen> <dimen name="dashboard_parking_icon_size">48dp</dimen>
<dimen name="map_button_size">40dp</dimen> <!-- map buttons -->
<dimen name="map_button_margin">8dp</dimen> <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 --> <!-- TextSizes -->

View file

@ -176,7 +176,7 @@ public class MapActivity extends AccessibleActivity {
} }
mapView.refreshMap(true); mapView.refreshMap(true);
findViewById(R.id.init_progress).setVisibility(View.GONE); findViewById(R.id.init_progress).setVisibility(View.GONE);
findViewById(R.id.ParentLayout).invalidate(); findViewById(R.id.drawer_layout).invalidate();
} }
}; };
getMyApplication().checkApplicationIsBeingInitialized(this, initListener); getMyApplication().checkApplicationIsBeingInitialized(this, initListener);

View file

@ -75,9 +75,11 @@ public class DashboardOnMap {
public void createDashboardView() { public void createDashboardView() {
landscape = !ScreenOrientationHelper.isOrientationPortrait(mapActivity); landscape = !ScreenOrientationHelper.isOrientationPortrait(mapActivity);
dashboardView = (FrameLayout) mapActivity.getLayoutInflater().inflate(R.layout.dashboard_over_map, null, false); // dashboardView = (FrameLayout) mapActivity.getLayoutInflater().inflate(R.layout.dashboard_over_map, null, false);
dashboardView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, // dashboardView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
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() { View.OnClickListener listener = new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -86,7 +88,7 @@ public class DashboardOnMap {
}; };
dashboardView.findViewById(R.id.animateContent).setOnClickListener(listener); dashboardView.findViewById(R.id.animateContent).setOnClickListener(listener);
dashboardView.setOnClickListener(listener); dashboardView.setOnClickListener(listener);
((FrameLayout) mapActivity.findViewById(R.id.ParentLayout)).addView(dashboardView);
dashboardView.findViewById(R.id.map_layers_button).setOnClickListener(new View.OnClickListener() { 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) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
fabButton = new FloatingActionButton.Builder(mapActivity) 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)) .withButtonColor(mapActivity.getResources().getColor(R.color.color_myloc_distance))
.withGravity(landscape ? Gravity.BOTTOM | Gravity.RIGHT : Gravity.TOP | Gravity.RIGHT) .withGravity(landscape ? Gravity.BOTTOM | Gravity.RIGHT : Gravity.TOP | Gravity.RIGHT)
.withMargins(0, landscape ? 0 : 160, 16, landscape ? 16 : 0).create(); .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 // To animate view slide out from right to left
private void open(View view){ 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.setDuration(500);
animate.setFillAfter(true); animate.setFillAfter(true);
view.startAnimation(animate); view.startAnimation(animate);
@ -302,7 +304,7 @@ public class DashboardOnMap {
} }
private void hide(View view) { 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.setDuration(500);
animate.setFillAfter(true); animate.setFillAfter(true);
animate.setAnimationListener(new AnimationListener() { animate.setAnimationListener(new AnimationListener() {

View file

@ -71,7 +71,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
this.app = mapActivity.getMyApplication(); this.app = mapActivity.getMyApplication();
waypointHelper = this.app.getWaypointHelper(); waypointHelper = this.app.getWaypointHelper();
this.mapActivity = mapActivity; this.mapActivity = mapActivity;
this.mainLayout = (LinearLayout) mapActivity.findViewById(R.id.dialog_layout); this.mainLayout = (LinearLayout) mapActivity.findViewById(R.id.WaypointVisit);
} }

View file

@ -1,6 +1,7 @@
package net.osmand.plus.views; package net.osmand.plus.views;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.List; import java.util.List;
import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo;
@ -88,6 +89,8 @@ public class MapControlsLayer extends OsmandMapLayer {
int rightCenterGravity = Gravity.RIGHT | Gravity.CENTER; int rightCenterGravity = Gravity.RIGHT | Gravity.CENTER;
int leftCenterGravity = Gravity.LEFT | Gravity.CENTER; int leftCenterGravity = Gravity.LEFT | Gravity.CENTER;
initNewControls();
// default buttons // default buttons
zoomControls = init(new MapZoomControls(mapActivity, showUIHandler, scaleCoefficient), parent, zoomControls = init(new MapZoomControls(mapActivity, showUIHandler, scaleCoefficient), parent,
rightGravity); rightGravity);
@ -117,14 +120,50 @@ public class MapControlsLayer extends OsmandMapLayer {
rulerControl = init(new RulerControl(zoomControls, mapActivity, showUIHandler, scaleCoefficient), parent, rulerControl = init(new RulerControl(zoomControls, mapActivity, showUIHandler, scaleCoefficient), parent,
rightGravity); rightGravity);
initTransparencyBar(view, parent);
mapRoutePlanControl.setMargin(mapMenuControls.getWidth()); mapRoutePlanControl.setMargin(mapMenuControls.getWidth());
mapCancelNavigationControl.setMargin(mapSmallMenuControls.getWidth()); mapCancelNavigationControl.setMargin(mapSmallMenuControls.getWidth());
mapInfoNavigationControl.setMargin(mapSmallMenuControls.getWidth() + mapCancelNavigationControl.getWidth()); mapInfoNavigationControl.setMargin(mapSmallMenuControls.getWidth() + mapCancelNavigationControl.getWidth());
mapAppModeControl.setMargin(mapNavigationControl.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() { public void startNavigation() {
if (mapNavigationControl == null) { if (mapNavigationControl == null) {
return; return;
@ -148,6 +187,10 @@ public class MapControlsLayer extends OsmandMapLayer {
} }
protected void notifyClicked(MapControls m) { protected void notifyClicked(MapControls m) {
notifyClicked();
}
protected void notifyClicked() {
if(mapNavigationControl != null) { if(mapNavigationControl != null) {
mapNavigationControl.stopCounter(); mapNavigationControl.stopCounter();
} }