[android] #3752 - added scroll by x,y feature, introduced new CameraUpdateType, introduced caching system for invalidating CameraPosition, general cleanup, readded getLatLng in MapView, ..

[android] #3752 - correctly invalidating cameraposition
This commit is contained in:
Tobrun
2016-02-03 14:51:22 +01:00
parent 37c27f3a8f
commit 9beb6629b6
11 changed files with 422 additions and 42 deletions

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M21,3.01H3c-1.1,0 -2,0.9 -2,2V9h2V4.99h18v14.03H3V15H1v4.01c0,1.1 0.9,1.98 2,1.98h18c1.1,0 2,-0.88 2,-1.98v-14c0,-1.11 -0.9,-2 -2,-2zM11,16l4,-4 -4,-4v3H1v2h10v3z"/>
</vector>

View File

@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/primary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:paddingBottom="8dp"
android:textSize="20sp"
android:textColor="#FFFFFF"
android:text="Move the map by x/y pixels" />
<TextView
android:id="@+id/textview_x"
android:layout_alignBottom="@+id/seekbar_move_x"
android:layout_below="@id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="X: 0000" />
<SeekBar
android:id="@id/seekbar_move_x"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_marginLeft="56dp"
android:max="50"
android:progress="0" />
<TextView
android:id="@+id/textview_y"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/seekbar_move_y"
android:text="Y: 0000" />
<SeekBar
android:id="@id/seekbar_move_y"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/seekbar_move_x"
android:layout_marginBottom="8dp"
android:layout_marginTop="16dp"
android:layout_marginLeft="56dp"
android:max="50"
android:progress="0" />
</RelativeLayout>
</android.support.v7.widget.Toolbar>
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mapbox.mapboxsdk.maps.MapView
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/ic_input_24dp"
app:backgroundTint="@color/white" />
</android.support.design.widget.CoordinatorLayout>
</FrameLayout>
</RelativeLayout>

View File

@@ -76,7 +76,7 @@
android:id="@+id/action_mapboxmap"
android:checkable="false"
android:icon="@drawable/ic_mapboxmap"
android:title="@string/action_mapboxmap"/>
android:title="@string/action_mapboxmap" />
<item
android:id="@+id/action_tilt"
@@ -84,10 +84,11 @@
android:icon="@drawable/ic_tilt"
android:title="@string/action_tilt" />
<item android:id="@+id/action_camera"
android:checkable="false"
android:icon="@drawable/ic_transform_24dp"
android:title="@string/action_camera"/>
<item
android:id="@+id/action_camera"
android:checkable="false"
android:icon="@drawable/ic_transform_24dp"
android:title="@string/action_camera" />
<item
android:id="@+id/action_map_fragment"
@@ -185,6 +186,12 @@
android:icon="@drawable/ic_directions"
android:title="@string/activity_geocoder" />
<item
android:id="@+id/action_scroll_by"
android:checkable="false"
android:icon="@drawable/ic_input_24dp"
android:title="@string/activity_scroll_by" />
</menu>
</item>

View File

@@ -24,6 +24,7 @@
<string name="activity_directions">Directions Activity</string>
<string name="activity_geocoder">Geocoder Activity</string>
<string name="activity_double_map">Double Map Activity</string>
<string name="activity_scroll_by">Scroll By Activity</string>
<string name="navdrawer_menu_title_mainactivity_controls">Main Activity Controls</string>
<string name="navdrawer_menu_title_mainactivity_styles">Main Activity Styles</string>
@@ -91,4 +92,7 @@
<string name="zoom_botton">Zoom</string>
<string name="scrollby_x_value">X: %1$d</string>
<string name="scrollby_y_value">Y: %1$d</string>
</resources>