Merge pull request #2991 from mapbox/2931-adams-playground
Manual Zoom Test Activity - will turn into an automated test at some point in the future
This commit is contained in:
@@ -49,6 +49,9 @@
|
||||
android:name=".PressForMarkerActivity"
|
||||
android:label="@string/activity_press_for_marker" />
|
||||
|
||||
<activity android:name=".ManualZoomActivity"
|
||||
android:label="@string/action_manual_zoom"/>
|
||||
|
||||
<activity
|
||||
android:name=".MyLocationTrackingModeActivity"
|
||||
android:label="@string/activity_user_tracking_mode" />
|
||||
|
||||
@@ -349,6 +349,10 @@ public class MainActivity extends AppCompatActivity {
|
||||
startActivity(new Intent(getApplicationContext(), PressForMarkerActivity.class));
|
||||
return true;
|
||||
|
||||
case R.id.action_manual_zoom:
|
||||
startActivity(new Intent(getApplicationContext(), ManualZoomActivity.class));
|
||||
return true;
|
||||
|
||||
case R.id.action_bulk_markers:
|
||||
startActivity(new Intent(getApplicationContext(), BulkMarkerActivity.class));
|
||||
return true;
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.mapbox.mapboxsdk.testapp;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.MenuItem;
|
||||
import com.mapbox.mapboxsdk.constants.Style;
|
||||
import com.mapbox.mapboxsdk.utils.ApiAccess;
|
||||
import com.mapbox.mapboxsdk.views.MapView;
|
||||
|
||||
public class ManualZoomActivity extends AppCompatActivity {
|
||||
|
||||
private MapView mMapView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_manual_zoom);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
actionBar.setDisplayShowHomeEnabled(true);
|
||||
}
|
||||
|
||||
mMapView = (MapView) findViewById(R.id.manualZoomMapView);
|
||||
mMapView.setAccessToken(ApiAccess.getToken(this));
|
||||
mMapView.setStyle(Style.MAPBOX_STREETS);
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
mMapView.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mMapView.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
mMapView.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
mMapView.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
mMapView.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mMapView.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
mMapView.onLowMemory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
onBackPressed();
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 251 B |
Binary file not shown.
|
After Width: | Height: | Size: 174 B |
Binary file not shown.
|
After Width: | Height: | Size: 270 B |
Binary file not shown.
|
After Width: | Height: | Size: 384 B |
Binary file not shown.
|
After Width: | Height: | Size: 497 B |
@@ -0,0 +1,26 @@
|
||||
<?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">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/primary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
||||
<com.mapbox.mapboxsdk.views.MapView
|
||||
android:id="@+id/manualZoomMapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/zoomInButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/zoom_botton"
|
||||
android:layout_gravity="right"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -90,6 +90,12 @@
|
||||
android:icon="@drawable/ic_pin_drop_white_24dp"
|
||||
android:title="@string/action_press_for_marker" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_manual_zoom"
|
||||
android:checkable="false"
|
||||
android:icon="@drawable/ic_filter_center_focus_white_24dp"
|
||||
android:title="@string/action_manual_zoom"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_visible_bounds"
|
||||
android:checkable="false"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<string name="activity_map_fragment">Map Fragment Activity</string>
|
||||
<string name="activity_press_for_marker">Press For Marker Activity</string>
|
||||
<string name="activity_marker_in_bulk">Add Bulk Markers Activity</string>
|
||||
<string name="activity_manual_zoom">Manual Zoom Activity</string>
|
||||
<string name="activity_info_window">InfoWindow Activity</string>
|
||||
<string name="activity_visible_coordinate_bounds">Visible Coordinate Bounds</string>
|
||||
<string name="activity_user_tracking_mode">User tracking mode</string>
|
||||
@@ -24,6 +25,7 @@
|
||||
<string name="action_info_window_adapter">InfoWindow Adapter</string>
|
||||
<string name="action_map_fragment">MapFragment</string>
|
||||
<string name="action_press_for_marker">Press For Marker</string>
|
||||
<string name="action_manual_zoom">Manual Zoom</string>
|
||||
<string name="action_info_window">InfoWindow</string>
|
||||
<string name="action_add_bulk_markers">Add Markers in bulk</string>
|
||||
<string name="action_visible_bounds">Set Visible Bounds</string>
|
||||
@@ -63,4 +65,6 @@
|
||||
<!--<item>Combined mode</item>-->
|
||||
</string-array>
|
||||
|
||||
<string name="zoom_botton">Zoom</string>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user