[android] #5004 - Introducing MapboxAccountManager
This commit is contained in:
@@ -3,6 +3,7 @@ package com.mapbox.mapboxsdk.testapp;
|
||||
import android.app.Application;
|
||||
import android.os.StrictMode;
|
||||
|
||||
import com.mapbox.mapboxsdk.MapboxAccountManager;
|
||||
import com.squareup.leakcanary.LeakCanary;
|
||||
|
||||
public class MapboxApplication extends Application {
|
||||
@@ -10,6 +11,7 @@ public class MapboxApplication extends Application {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
MapboxAccountManager.start(getApplicationContext(), getString(R.string.mapbox_access_token));
|
||||
LeakCanary.install(this);
|
||||
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
||||
.detectDiskReads()
|
||||
|
||||
@@ -51,7 +51,6 @@ public class BulkMarkerActivity extends AppCompatActivity implements AdapterView
|
||||
}
|
||||
|
||||
mMapView = (MapView) findViewById(R.id.mapView);
|
||||
mMapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
mMapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@Override
|
||||
|
||||
@@ -48,7 +48,6 @@ public class DynamicMarkerChangeActivity extends AppCompatActivity {
|
||||
|
||||
mMapView = (MapView) findViewById(R.id.mapView);
|
||||
mMapView.setTag(false);
|
||||
mMapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
mMapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@Override
|
||||
|
||||
@@ -58,7 +58,6 @@ public class PolylineActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
mMapView = (MapView) findViewById(R.id.mapView);
|
||||
mMapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
mMapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@Override
|
||||
|
||||
@@ -44,7 +44,6 @@ public class CameraAnimationTypeActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
mapView = (MapView) findViewById(R.id.mapView);
|
||||
mapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mapView.onCreate(savedInstanceState);
|
||||
mapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@Override
|
||||
|
||||
@@ -46,7 +46,6 @@ public class CameraPositionActivity extends AppCompatActivity implements OnMapRe
|
||||
}
|
||||
|
||||
mapView = (MapView) findViewById(R.id.mapView);
|
||||
mapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mapView.onCreate(savedInstanceState);
|
||||
mapView.getMapAsync(this);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ public class LatLngBoundsActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
mMapView = (MapView) findViewById(R.id.mapView);
|
||||
mMapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mMapView.setStyleUrl(Style.getDarkStyleUrl(AppConstant.STYLE_VERSION));
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
mMapView.getMapAsync(new OnMapReadyCallback() {
|
||||
|
||||
@@ -39,7 +39,6 @@ public class ManualZoomActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
mMapView = (MapView) findViewById(R.id.manualZoomMapView);
|
||||
mMapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mMapView.setStyleUrl(Style.getSatelliteStyleUrl(AppConstant.STYLE_VERSION));
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
mMapView.getMapAsync(new OnMapReadyCallback() {
|
||||
|
||||
@@ -40,7 +40,6 @@ public class CustomLayerActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
mapView = (MapView) findViewById(R.id.mapView);
|
||||
mapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mapView.onCreate(savedInstanceState);
|
||||
mapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@Override
|
||||
|
||||
@@ -52,7 +52,6 @@ public class DirectionsActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
mMapView = (MapView) findViewById(R.id.mapView);
|
||||
mMapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
mMapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@Override
|
||||
|
||||
@@ -60,7 +60,6 @@ public class GeocoderActivity extends AppCompatActivity {
|
||||
setMessage(getString(R.string.geocoder_instructions));
|
||||
|
||||
mapView = (MapView) findViewById(R.id.mapView);
|
||||
mapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mapView.setStyleUrl(Style.getMapboxStreetsUrl(AppConstant.STYLE_VERSION));
|
||||
mapView.onCreate(savedInstanceState);
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ public class InfoWindowActivity extends AppCompatActivity implements OnMapReadyC
|
||||
}
|
||||
|
||||
mapView = (MapView) findViewById(R.id.mapView);
|
||||
mapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mapView.onCreate(savedInstanceState);
|
||||
mapView.getMapAsync(this);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ public class InfoWindowAdapterActivity extends AppCompatActivity {
|
||||
iconDrawable = ContextCompat.getDrawable(this, R.drawable.ic_location_city_24dp);
|
||||
|
||||
mapView = (MapView) findViewById(R.id.mapView);
|
||||
mapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mapView.onCreate(savedInstanceState);
|
||||
mapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@Override
|
||||
|
||||
@@ -51,7 +51,6 @@ public class DebugModeActivity extends AppCompatActivity {
|
||||
|
||||
mapView = (MapView) findViewById(R.id.mapView);
|
||||
mapView.setTag(true);
|
||||
mapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mapView.setStyleUrl(STYLES[currentStyleIndex]);
|
||||
mapView.onCreate(savedInstanceState);
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ public class MapPaddingActivity extends AppCompatActivity {
|
||||
|
||||
mMapView = (MapView) findViewById(R.id.mapView);
|
||||
mMapView.setTag(true);
|
||||
mMapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
|
||||
mMapView.getMapAsync(new OnMapReadyCallback() {
|
||||
|
||||
@@ -77,7 +77,6 @@ public class OfflineActivity extends AppCompatActivity
|
||||
|
||||
// Set up map
|
||||
mMapView = (MapView) findViewById(R.id.mapView);
|
||||
mMapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mMapView.setStyleUrl(Style.getMapboxStreetsUrl(AppConstant.STYLE_VERSION));
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
mMapView.getMapAsync(new OnMapReadyCallback() {
|
||||
|
||||
@@ -50,7 +50,6 @@ public class MyLocationTintActivity extends AppCompatActivity implements Locatio
|
||||
}
|
||||
|
||||
mapView = (MapView) findViewById(R.id.mapView);
|
||||
mapView.setAccessToken(getString(R.string.mapbox_access_token));
|
||||
mapView.onCreate(savedInstanceState);
|
||||
mapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@Override
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:style_url="@string/style_light"
|
||||
app:access_token="@string/mapbox_access_token"
|
||||
android:layout_below="@id/toolbar" />
|
||||
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/toolbar"
|
||||
app:access_token="@string/mapbox_access_token"
|
||||
app:center_latitude="-1.063510"
|
||||
app:center_longitude=" 32.895425"
|
||||
app:style_url="@string/style_satellite_streets"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
android:id="@id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
mapbox:access_token="@string/mapbox_access_token" />
|
||||
/>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fabLocationToggle"
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
android:layout_height="match_parent"
|
||||
app:my_location_foreground_tint="@color/primary"
|
||||
app:my_location_accuracy_tint="@color/primary"
|
||||
app:access_token="@string/mapbox_access_token"
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="15" />
|
||||
|
||||
|
||||
@@ -81,7 +81,6 @@
|
||||
android:layout_width="match_parent"
|
||||
app:center_latitude="37.176546"
|
||||
app:center_longitude="-3.599007"
|
||||
app:access_token="@string/mapbox_access_token"
|
||||
app:style_url="@string/style_emerald"
|
||||
app:zoom="15"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
app:access_token="@string/mapbox_access_token"
|
||||
app:style_url="@string/style_emerald" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
<com.mapbox.mapboxsdk.maps.MapView
|
||||
android:id="@+id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
mapbox:access_token="@string/mapbox_access_token" />
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/map_card"
|
||||
@@ -22,6 +21,6 @@
|
||||
android:id="@+id/mini_map"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
mapbox:access_token="@string/mapbox_access_token" />
|
||||
/>
|
||||
</FrameLayout>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
Reference in New Issue
Block a user