Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2991 from mapbox/2931-adams-playground
Browse files Browse the repository at this point in the history
Manual Zoom Test Activity - will turn into an automated test at some point in the future
  • Loading branch information
adam-mapbox committed Nov 14, 2015
2 parents a6e639b + 5747bee commit 1ced39c
Show file tree
Hide file tree
Showing 11 changed files with 131 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ public boolean onNavigationItemSelected(MenuItem menuItem) {
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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -63,4 +65,6 @@
<!--<item>Combined mode</item>-->
</string-array>

<string name="zoom_botton">Zoom</string>

</resources>

0 comments on commit 1ced39c

Please sign in to comment.