[android] - enforce usage bitmap for icon, cleanup test app resources (#7906)
@@ -1,10 +1,10 @@
|
||||
package com.mapbox.mapboxsdk.testapp.activity.annotation;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import com.mapbox.mapboxsdk.annotations.Icon;
|
||||
import com.mapbox.mapboxsdk.annotations.IconFactory;
|
||||
import com.mapbox.mapboxsdk.annotations.Marker;
|
||||
import com.mapbox.mapboxsdk.annotations.MarkerOptions;
|
||||
import com.mapbox.mapboxsdk.camera.CameraPosition;
|
||||
@@ -14,6 +14,7 @@ import com.mapbox.mapboxsdk.maps.MapView;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.IconUtils;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
@@ -36,15 +37,20 @@ public class AddRemoveMarkerActivity extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_add_remove_marker);
|
||||
|
||||
final Icon icon1 = IconFactory.getInstance(this).fromResource(R.drawable.ic_arsenal);
|
||||
final Icon icon2 = IconFactory.getInstance(this).fromResource(R.drawable.ic_chelsea);
|
||||
// ShapeDrawable to Icon
|
||||
final Icon shapeDrawableIcon = IconUtils.drawableToIcon(this, R.drawable.ic_circle,
|
||||
ContextCompat.getColor(this, R.color.redAccent));
|
||||
|
||||
// VectorDrawable to Icon
|
||||
final Icon vectorDrawableIcon = IconUtils.drawableToIcon(this, R.drawable.ic_layers,
|
||||
ContextCompat.getColor(this, R.color.blueAccent));
|
||||
|
||||
lowThresholdMarker = new MarkerOptions()
|
||||
.icon(icon1)
|
||||
.icon(shapeDrawableIcon)
|
||||
.position(new LatLng(-0.1, 0));
|
||||
|
||||
highThresholdMarker = new MarkerOptions()
|
||||
.icon(icon2)
|
||||
.icon(vectorDrawableIcon)
|
||||
.position(new LatLng(0.1, 0));
|
||||
|
||||
mapView = (MapView) findViewById(R.id.mapView);
|
||||
|
||||
@@ -8,7 +8,9 @@ import android.animation.ValueAnimator;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.res.ResourcesCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
import android.view.animation.AccelerateDecelerateInterpolator;
|
||||
|
||||
import com.mapbox.mapboxsdk.annotations.Icon;
|
||||
@@ -24,9 +26,12 @@ import com.mapbox.mapboxsdk.maps.MapView;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.IconUtils;
|
||||
import com.mapbox.services.commons.models.Position;
|
||||
import com.mapbox.services.api.utils.turf.TurfMeasurement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class AnimatedMarkerActivity extends AppCompatActivity {
|
||||
@@ -41,6 +46,9 @@ public class AnimatedMarkerActivity extends AppCompatActivity {
|
||||
|
||||
private Runnable animationRunnable;
|
||||
|
||||
private List<MarkerView> markerViews = new ArrayList<>();
|
||||
private boolean stopped;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -79,11 +87,15 @@ public class AnimatedMarkerActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void addPassenger() {
|
||||
if (isActivityStopped()) {
|
||||
return;
|
||||
}
|
||||
|
||||
LatLng randomLatLng = getLatLngInBounds();
|
||||
|
||||
if (passengerMarker == null) {
|
||||
Icon icon = IconFactory.getInstance(AnimatedMarkerActivity.this)
|
||||
.fromResource(R.drawable.ic_directions_run_black_24dp);
|
||||
Icon icon = IconUtils.drawableToIcon(this, R.drawable.ic_directions_run_black,
|
||||
ResourcesCompat.getColor(getResources(), R.color.blueAccent, getTheme()));
|
||||
passengerMarker = mapboxMap.addMarker(new MarkerViewOptions()
|
||||
.position(randomLatLng)
|
||||
.icon(icon));
|
||||
@@ -93,6 +105,10 @@ public class AnimatedMarkerActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void addMainCar() {
|
||||
if (isActivityStopped()) {
|
||||
return;
|
||||
}
|
||||
|
||||
LatLng randomLatLng = getLatLngInBounds();
|
||||
|
||||
if (carMarker == null) {
|
||||
@@ -105,13 +121,17 @@ public class AnimatedMarkerActivity extends AppCompatActivity {
|
||||
animateMoveToPassenger(carMarker);
|
||||
}
|
||||
});
|
||||
|
||||
markerViews.add(carMarker);
|
||||
} else {
|
||||
carMarker.setPosition(randomLatLng);
|
||||
}
|
||||
}
|
||||
|
||||
private void animateMoveToPassenger(final MarkerView car) {
|
||||
if (isActivityStopped()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ValueAnimator animator = animateMoveMarker(car, passengerMarker.getPosition());
|
||||
animator.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
@@ -123,15 +143,20 @@ public class AnimatedMarkerActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
protected void addRandomCar() {
|
||||
createCarMarker(getLatLngInBounds(), R.drawable.ic_car_top, new MarkerViewManager.OnMarkerViewAddedListener() {
|
||||
@Override
|
||||
public void onViewAdded(@NonNull MarkerView markerView) {
|
||||
randomlyMoveMarker(markerView);
|
||||
}
|
||||
});
|
||||
markerViews.add(createCarMarker(getLatLngInBounds(), R.drawable.ic_car_top,
|
||||
new MarkerViewManager.OnMarkerViewAddedListener() {
|
||||
@Override
|
||||
public void onViewAdded(@NonNull MarkerView markerView) {
|
||||
randomlyMoveMarker(markerView);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
private void randomlyMoveMarker(final MarkerView marker) {
|
||||
if (isActivityStopped()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ValueAnimator animator = animateMoveMarker(marker, getLatLngInBounds());
|
||||
|
||||
// Add listener to restart animation on end
|
||||
@@ -205,6 +230,19 @@ public class AnimatedMarkerActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
|
||||
stopped = true;
|
||||
|
||||
// Stop ongoing animations, prevent memory lekas
|
||||
MarkerViewManager markerViewManager = mapboxMap.getMarkerViewManager();
|
||||
for (MarkerView markerView : markerViews) {
|
||||
View view = markerViewManager.getView(markerView);
|
||||
if (view != null) {
|
||||
view.animate().cancel();
|
||||
}
|
||||
}
|
||||
|
||||
// onStop
|
||||
mapView.onStop();
|
||||
mapView.removeCallbacks(animationRunnable);
|
||||
}
|
||||
@@ -250,4 +288,8 @@ public class AnimatedMarkerActivity extends AppCompatActivity {
|
||||
Position.fromCoordinates(to.getLongitude(), to.getLatitude())
|
||||
);
|
||||
}
|
||||
|
||||
private boolean isActivityStopped() {
|
||||
return stopped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,9 @@ package com.mapbox.mapboxsdk.testapp.activity.annotation;
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.app.ProgressDialog;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.content.res.ResourcesCompat;
|
||||
import android.support.v4.view.MenuItemCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
@@ -22,7 +19,6 @@ import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.mapbox.mapboxsdk.annotations.Icon;
|
||||
import com.mapbox.mapboxsdk.annotations.IconFactory;
|
||||
import com.mapbox.mapboxsdk.annotations.Marker;
|
||||
import com.mapbox.mapboxsdk.annotations.MarkerOptions;
|
||||
import com.mapbox.mapboxsdk.annotations.MarkerViewOptions;
|
||||
@@ -32,6 +28,7 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.GeoParseUtil;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.IconUtils;
|
||||
|
||||
import org.json.JSONException;
|
||||
|
||||
@@ -39,6 +36,7 @@ import java.io.IOException;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
import timber.log.Timber;
|
||||
@@ -117,11 +115,8 @@ public class BulkMarkerActivity extends AppCompatActivity implements AdapterView
|
||||
Random random = new Random();
|
||||
int randomIndex;
|
||||
|
||||
Drawable drawable = ContextCompat.getDrawable(BulkMarkerActivity.this, R.drawable.ic_droppin_24dp);
|
||||
|
||||
int redColor = ResourcesCompat.getColor(getResources(), android.R.color.holo_red_dark, getTheme());
|
||||
drawable.setColorFilter(redColor, PorterDuff.Mode.SRC_IN);
|
||||
Icon icon = IconFactory.getInstance(this).fromDrawable(drawable);
|
||||
int color = ResourcesCompat.getColor(getResources(), R.color.redAccent, getTheme());
|
||||
Icon icon = IconUtils.drawableToIcon(this, R.drawable.ic_droppin, color);
|
||||
|
||||
List<MarkerViewOptions> markerOptionsList = new ArrayList<>();
|
||||
for (int i = 0; i < amount; i++) {
|
||||
@@ -203,6 +198,9 @@ public class BulkMarkerActivity extends AppCompatActivity implements AdapterView
|
||||
}
|
||||
|
||||
private class FabClickListener implements View.OnClickListener {
|
||||
|
||||
private TextView viewCountView;
|
||||
|
||||
@Override
|
||||
public void onClick(final View view) {
|
||||
if (mapboxMap != null) {
|
||||
@@ -225,13 +223,15 @@ public class BulkMarkerActivity extends AppCompatActivity implements AdapterView
|
||||
showMarkers(amount);
|
||||
}
|
||||
|
||||
viewCountView = (TextView) findViewById(R.id.countView);
|
||||
|
||||
mapView.addOnMapChangedListener(new MapView.OnMapChangedListener() {
|
||||
@Override
|
||||
public void onMapChanged(@MapView.MapChange int change) {
|
||||
if (change == MapView.REGION_IS_CHANGING || change == MapView.REGION_DID_CHANGE) {
|
||||
if (!mapboxMap.getMarkerViewManager().getMarkerViewAdapters().isEmpty()) {
|
||||
TextView viewCountView = (TextView) findViewById(R.id.countView);
|
||||
viewCountView.setText("ViewCache size " + (mapView.getChildCount() - 5));
|
||||
viewCountView.setText(String.format(Locale.getDefault(), "ViewCache size %d",
|
||||
mapboxMap.getMarkerViewManager().getMarkerViewContainer().getChildCount()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.content.res.ResourcesCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
|
||||
import com.mapbox.mapboxsdk.annotations.IconFactory;
|
||||
import com.mapbox.mapboxsdk.annotations.Marker;
|
||||
import com.mapbox.mapboxsdk.annotations.MarkerOptions;
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
@@ -15,6 +15,7 @@ import com.mapbox.mapboxsdk.maps.MapView;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.IconUtils;
|
||||
|
||||
public class DynamicMarkerChangeActivity extends AppCompatActivity {
|
||||
|
||||
@@ -23,7 +24,6 @@ public class DynamicMarkerChangeActivity extends AppCompatActivity {
|
||||
|
||||
private MapView mapView;
|
||||
private MapboxMap mapboxMap;
|
||||
private IconFactory iconFactory;
|
||||
private Marker marker;
|
||||
|
||||
@Override
|
||||
@@ -31,8 +31,6 @@ public class DynamicMarkerChangeActivity extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_dynamic_marker);
|
||||
|
||||
iconFactory = IconFactory.getInstance(this);
|
||||
|
||||
mapView = (MapView) findViewById(R.id.mapView);
|
||||
mapView.setTag(false);
|
||||
mapView.onCreate(savedInstanceState);
|
||||
@@ -43,7 +41,8 @@ public class DynamicMarkerChangeActivity extends AppCompatActivity {
|
||||
// Create marker
|
||||
MarkerOptions markerOptions = new MarkerOptions()
|
||||
.position(LAT_LNG_CHELSEA)
|
||||
.icon(iconFactory.fromResource(R.drawable.ic_chelsea))
|
||||
.icon(IconUtils.drawableToIcon(DynamicMarkerChangeActivity.this, R.drawable.ic_stars,
|
||||
ResourcesCompat.getColor(getResources(), R.color.blueAccent, getTheme())))
|
||||
.title(getString(R.string.dynamic_marker_chelsea_title))
|
||||
.snippet(getString(R.string.dynamic_marker_chelsea_snippet));
|
||||
marker = mapboxMap.addMarker(markerOptions);
|
||||
@@ -69,7 +68,11 @@ public class DynamicMarkerChangeActivity extends AppCompatActivity {
|
||||
|
||||
// update marker
|
||||
marker.setPosition(first ? LAT_LNG_CHELSEA : LAT_LNG_ARSENAL);
|
||||
marker.setIcon(iconFactory.fromResource(first ? R.drawable.ic_chelsea : R.drawable.ic_arsenal));
|
||||
marker.setIcon(IconUtils.drawableToIcon(this, R.drawable.ic_stars, first
|
||||
? ResourcesCompat.getColor(getResources(), R.color.blueAccent, getTheme()) :
|
||||
ResourcesCompat.getColor(getResources(), R.color.redAccent, getTheme())
|
||||
));
|
||||
|
||||
marker.setTitle(first
|
||||
? getString(R.string.dynamic_marker_chelsea_title) : getString(R.string.dynamic_marker_arsenal_title));
|
||||
marker.setSnippet(first
|
||||
|
||||
@@ -156,13 +156,13 @@ public class MarkerViewActivity extends AppCompatActivity {
|
||||
movingMarkerOne = MarkerViewActivity.this.mapboxMap.addMarker(new MarkerViewOptions()
|
||||
.position(CarLocation.CAR_0_LNGS[0])
|
||||
.icon(IconFactory.getInstance(mapView.getContext())
|
||||
.fromResource(R.drawable.ic_chelsea))
|
||||
.fromResource(R.drawable.ic_android))
|
||||
);
|
||||
|
||||
movingMarkerTwo = mapboxMap.addMarker(new MarkerViewOptions()
|
||||
.position(CarLocation.CAR_1_LNGS[0])
|
||||
.icon(IconFactory.getInstance(mapView.getContext())
|
||||
.fromResource(R.drawable.ic_arsenal))
|
||||
.fromResource(R.drawable.ic_android_2))
|
||||
);
|
||||
|
||||
// allow more open infowindows at the same time
|
||||
|
||||
@@ -64,7 +64,7 @@ public class CustomLayerActivity extends AppCompatActivity {
|
||||
} catch (NoSuchLayerException noSuchLayerException) {
|
||||
Timber.e("No custom layer to remove");
|
||||
}
|
||||
fab.setImageResource(R.drawable.ic_layers_24dp);
|
||||
fab.setImageResource(R.drawable.ic_layers);
|
||||
} else {
|
||||
customLayer = new CustomLayer("custom",
|
||||
ExampleCustomLayer.createContext(),
|
||||
@@ -72,7 +72,7 @@ public class CustomLayerActivity extends AppCompatActivity {
|
||||
ExampleCustomLayer.RenderFunction,
|
||||
ExampleCustomLayer.DeinitializeFunction);
|
||||
mapboxMap.addLayer(customLayer, "building");
|
||||
fab.setImageResource(R.drawable.ic_layers_clear_24dp);
|
||||
fab.setImageResource(R.drawable.ic_layers_clear);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
package com.mapbox.mapboxsdk.testapp.activity.infowindow;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.content.res.ResourcesCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mapbox.mapboxsdk.annotations.IconFactory;
|
||||
import com.mapbox.mapboxsdk.annotations.InfoWindow;
|
||||
import com.mapbox.mapboxsdk.annotations.Marker;
|
||||
import com.mapbox.mapboxsdk.annotations.MarkerView;
|
||||
@@ -22,6 +19,7 @@ import com.mapbox.mapboxsdk.maps.MapView;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.IconUtils;
|
||||
|
||||
/**
|
||||
* Shows how to dynamically update InfoWindow when Using an MapboxMap.InfoWindowAdapter
|
||||
@@ -84,18 +82,12 @@ public class DynamicInfoWindowAdapterActivity extends AppCompatActivity implemen
|
||||
}
|
||||
|
||||
private MarkerView addMarker(MapboxMap mapboxMap) {
|
||||
IconFactory iconFactory = IconFactory.getInstance(this);
|
||||
Drawable iconDrawable = ContextCompat.getDrawable(this, R.drawable.ic_location_city_24dp);
|
||||
iconDrawable.setColorFilter(
|
||||
ContextCompat.getColor(DynamicInfoWindowAdapterActivity.this, R.color.mapbox_blue),
|
||||
PorterDuff.Mode.SRC_IN
|
||||
);
|
||||
|
||||
return mapboxMap.addMarker(
|
||||
new MarkerViewOptions()
|
||||
.position(paris)
|
||||
.icon(iconFactory.fromDrawable(iconDrawable))
|
||||
);
|
||||
.icon(IconUtils.drawableToIcon(this, R.drawable.ic_location_city,
|
||||
ResourcesCompat.getColor(getResources(),R.color.mapbox_blue, getTheme()))
|
||||
));
|
||||
}
|
||||
|
||||
private void addCustomInfoWindowAdapter(final MapboxMap mapboxMap) {
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
package com.mapbox.mapboxsdk.testapp.activity.infowindow;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mapbox.mapboxsdk.annotations.Icon;
|
||||
import com.mapbox.mapboxsdk.annotations.IconFactory;
|
||||
import com.mapbox.mapboxsdk.annotations.Marker;
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
import com.mapbox.mapboxsdk.maps.MapView;
|
||||
@@ -20,22 +16,18 @@ import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.model.annotations.CityStateMarker;
|
||||
import com.mapbox.mapboxsdk.testapp.model.annotations.CityStateMarkerOptions;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.IconUtils;
|
||||
|
||||
public class InfoWindowAdapterActivity extends AppCompatActivity {
|
||||
|
||||
private MapView mapView;
|
||||
private MapboxMap mapboxMap;
|
||||
private IconFactory iconFactory;
|
||||
private Drawable iconDrawable;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_infowindow_adapter);
|
||||
|
||||
iconFactory = IconFactory.getInstance(this);
|
||||
iconDrawable = ContextCompat.getDrawable(this, R.drawable.ic_location_city_24dp);
|
||||
|
||||
mapView = (MapView) findViewById(R.id.mapView);
|
||||
mapView.onCreate(savedInstanceState);
|
||||
mapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@@ -63,8 +55,7 @@ public class InfoWindowAdapterActivity extends AppCompatActivity {
|
||||
marker.position(new LatLng(lat, lng));
|
||||
marker.infoWindowBackground(color);
|
||||
|
||||
iconDrawable.setColorFilter(Color.parseColor(color), PorterDuff.Mode.SRC_IN);
|
||||
Icon icon = iconFactory.fromDrawable(iconDrawable);
|
||||
Icon icon = IconUtils.drawableToIcon(this, R.drawable.ic_location_city, Color.parseColor(color));
|
||||
marker.icon(icon);
|
||||
return marker;
|
||||
}
|
||||
|
||||
@@ -148,8 +148,8 @@ public class NavigationDrawerActivity extends AppCompatActivity {
|
||||
android.R.layout.simple_list_item_activated_1,
|
||||
android.R.id.text1,
|
||||
new String[] {
|
||||
getString(R.string.title_section1),
|
||||
getString(R.string.title_section2)
|
||||
"Different style",
|
||||
"Show snackbar"
|
||||
}));
|
||||
drawerListView.setItemChecked(currentSelectedPosition, true);
|
||||
return drawerListView;
|
||||
|
||||
@@ -79,7 +79,7 @@ public class CustomSpriteActivity extends AppCompatActivity {
|
||||
// lets add a circle below labels!
|
||||
mapboxMap.addLayer(layer, "waterway-label");
|
||||
|
||||
fab.setImageResource(R.drawable.ic_directions_car_black_24dp);
|
||||
fab.setImageResource(R.drawable.ic_directions_car_black);
|
||||
} else {
|
||||
// Update point
|
||||
point = Point.fromCoordinates(
|
||||
|
||||
@@ -42,8 +42,8 @@ public class MyLocationDrawableActivity extends AppCompatActivity implements Loc
|
||||
mapboxMapOptions.styleUrl(Style.MAPBOX_STREETS);
|
||||
|
||||
// configure MyLocationView drawables
|
||||
mapboxMapOptions.myLocationForegroundDrawable(ContextCompat.getDrawable(this, R.drawable.ic_chelsea));
|
||||
mapboxMapOptions.myLocationBackgroundDrawable(ContextCompat.getDrawable(this, R.drawable.ic_arsenal));
|
||||
mapboxMapOptions.myLocationForegroundDrawable(ContextCompat.getDrawable(this, R.drawable.ic_android));
|
||||
mapboxMapOptions.myLocationBackgroundDrawable(ContextCompat.getDrawable(this, R.drawable.ic_android));
|
||||
mapboxMapOptions.myLocationForegroundTintColor(Color.GREEN);
|
||||
mapboxMapOptions.myLocationBackgroundTintColor(Color.YELLOW);
|
||||
mapboxMapOptions.myLocationBackgroundPadding(new int[] {0, 0,
|
||||
|
||||
@@ -150,9 +150,9 @@ public class MyLocationToggleActivity extends AppCompatActivity {
|
||||
};
|
||||
locationServices.addLocationEngineListener(locationListener);
|
||||
}
|
||||
locationToggleFab.setImageResource(R.drawable.ic_location_disabled_24dp);
|
||||
locationToggleFab.setImageResource(R.drawable.ic_location_disabled);
|
||||
} else {
|
||||
locationToggleFab.setImageResource(R.drawable.ic_my_location_24dp);
|
||||
locationToggleFab.setImageResource(R.drawable.ic_my_location);
|
||||
}
|
||||
mapboxMap.setMyLocationEnabled(enabled);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class OfflineDownloadRegionDialog extends DialogFragment {
|
||||
final EditText regionNameEdit = new EditText(getActivity());
|
||||
|
||||
builder.setTitle("Choose a name for the region")
|
||||
.setIcon(R.drawable.ic_airplanemode_active_black_24dp)
|
||||
.setIcon(R.drawable.ic_airplanemode_active_black)
|
||||
.setView(regionNameEdit)
|
||||
.setPositiveButton("Start", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
|
||||
@@ -28,7 +28,7 @@ public class OfflineListRegionsDialog extends DialogFragment {
|
||||
CharSequence[] items = offlineRegionsNames.toArray(new CharSequence[offlineRegionsNames.size()]);
|
||||
|
||||
builder.setTitle("List of offline regions")
|
||||
.setIcon(R.drawable.ic_airplanemode_active_black_24dp)
|
||||
.setIcon(R.drawable.ic_airplanemode_active_black)
|
||||
.setItems(items, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.mapbox.mapboxsdk.testapp.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.res.ResourcesCompat;
|
||||
import android.support.v4.graphics.drawable.DrawableCompat;
|
||||
|
||||
import com.mapbox.mapboxsdk.annotations.Icon;
|
||||
import com.mapbox.mapboxsdk.annotations.IconFactory;
|
||||
|
||||
public class IconUtils {
|
||||
|
||||
/**
|
||||
* Demonstrates converting any Drawable to an Icon, for use as a marker icon.
|
||||
*/
|
||||
public static Icon drawableToIcon(@NonNull Context context, @DrawableRes int id, @ColorInt int colorRes) {
|
||||
Drawable vectorDrawable = ResourcesCompat.getDrawable(context.getResources(), id, context.getTheme());
|
||||
Bitmap bitmap = Bitmap.createBitmap(vectorDrawable.getIntrinsicWidth(),
|
||||
vectorDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
vectorDrawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||
DrawableCompat.setTint(vectorDrawable, colorRes);
|
||||
vectorDrawable.draw(canvas);
|
||||
return IconFactory.getInstance(context).fromBitmap(bitmap);
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:interpolator="@android:anim/decelerate_interpolator">
|
||||
|
||||
<scale
|
||||
android:duration="1000"
|
||||
android:fromXScale="1"
|
||||
android:fromYScale="1"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
android:repeatCount="infinite"
|
||||
android:repeatMode="restart"
|
||||
android:toXScale="1.8"
|
||||
android:toYScale="1.8"/>
|
||||
|
||||
<set android:startOffset="200">
|
||||
<alpha
|
||||
android:duration="800"
|
||||
android:fromAlpha="1.0"
|
||||
android:repeatCount="infinite"
|
||||
android:repeatMode="restart"
|
||||
android:toAlpha="0.0"/>
|
||||
</set>
|
||||
</set>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<objectAnimator
|
||||
android:propertyName="rotation"
|
||||
android:valueFrom="0"
|
||||
android:valueTo="360"
|
||||
android:valueType="floatType"/>
|
||||
</set>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 202 B |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |
@@ -1,9 +0,0 @@
|
||||
<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="#FFFFFF"
|
||||
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
|
||||
</vector>
|
||||
@@ -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="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM16.23,18L12,15.45 7.77,18l1.12,-4.81 -3.73,-3.23 4.92,-0.42L12,5l1.92,4.53 4.92,0.42 -3.73,3.23L16.23,18z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,4 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<size android:width="10px" android:height="10px"/>
|
||||
<solid android:color="@color/redAccent"/>
|
||||
</shape>
|
||||
@@ -23,7 +23,7 @@
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_add_24dp"
|
||||
android:src="@drawable/ic_add"
|
||||
app:backgroundTint="@android:color/white"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_input_24dp"
|
||||
android:src="@drawable/ic_input"
|
||||
app:backgroundTint="@android:color/white"/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_directions_bus_black_24dp"
|
||||
android:src="@drawable/ic_directions_bus_black"
|
||||
app:backgroundTint="@android:color/white" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
<?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">
|
||||
|
||||
<com.mapbox.mapboxsdk.maps.MapView
|
||||
android:id="@id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar"
|
||||
app:mapbox_cameraTargetLat="52.519003"
|
||||
app:mapbox_cameraTargetLng="13.400972"
|
||||
app:mapbox_cameraZoom="16"
|
||||
app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets"/>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_add_24dp"
|
||||
app:backgroundTint="@android:color/white"/>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -18,7 +18,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_layers_24dp"
|
||||
android:src="@drawable/ic_layers"
|
||||
app:backgroundTint="@android:color/white"/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_marginBottom="82dp"
|
||||
android:layout_marginRight="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_refresh_24dp"
|
||||
android:src="@drawable/ic_refresh"
|
||||
app:backgroundTint="@color/accent"
|
||||
app:layout_anchorGravity="top"/>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_layers_24dp"
|
||||
android:src="@drawable/ic_layers"
|
||||
app:backgroundTint="@color/primary"/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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: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.maps.MapView
|
||||
android:id="@+id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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: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.maps.MapView
|
||||
android:id="@id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="5"
|
||||
app:mapbox_cameraTargetLat="38.90962"
|
||||
app:mapbox_cameraTargetLng="-77.04341"
|
||||
app:mapbox_cameraZoom="15" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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: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.maps.MapView
|
||||
android:id="@id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:mapbox_cameraTargetLat="47.798202"
|
||||
app:mapbox_cameraTargetLng="7.573781"
|
||||
app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets"
|
||||
app:mapbox_cameraZoom="4" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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: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" />
|
||||
|
||||
<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"
|
||||
app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets" />
|
||||
|
||||
<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="@android:color/white" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
</LinearLayout>
|
||||
@@ -17,7 +17,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_my_location_24dp"
|
||||
android:src="@drawable/ic_my_location"
|
||||
tools:backgroundTint="@color/primary"/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_add_24dp"
|
||||
android:src="@drawable/ic_add"
|
||||
app:backgroundTint="@android:color/white" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_print_24dp"
|
||||
android:src="@drawable/ic_print"
|
||||
app:backgroundTint="@color/accent"/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_input_24dp"
|
||||
android:src="@drawable/ic_input"
|
||||
app:backgroundTint="@color/white" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_add_a_photo_black_24dp"
|
||||
android:src="@drawable/ic_add_a_photo_black"
|
||||
app:backgroundTint="@android:color/white"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_add_24dp"
|
||||
android:src="@drawable/ic_add"
|
||||
app:backgroundTint="@android:color/white"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<?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: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.maps.MapView
|
||||
android:id="@id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/toolbar"
|
||||
app:mapbox_styleUrl="@string/mapbox_style_light" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="128dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:paddingBottom="48dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.maplayout.VideoViewActivity">
|
||||
|
||||
<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" />
|
||||
|
||||
<VideoView
|
||||
android:id="@+id/video_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_margin="16dp" />
|
||||
|
||||
<com.mapbox.mapboxsdk.maps.MapView
|
||||
android:id="@id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar"
|
||||
mapbox:mapbox_uiAttributionGravity="top"
|
||||
mapbox:mapbox_cameraTargetLat="34.4021"
|
||||
mapbox:mapbox_cameraTargetLng="-119.7081"
|
||||
mapbox:mapbox_uiLogoGravity="top"
|
||||
mapbox:mapbox_styleUrl="mapbox://styles/mapbox/streets-v9"
|
||||
mapbox:mapbox_cameraZoom="13" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/foreground_imageView"
|
||||
android:layout_width="@dimen/circle_size"
|
||||
android:layout_height="@dimen/circle_size"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_circle"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/background_imageview"
|
||||
android:layout_width="@dimen/circle_size"
|
||||
android:layout_height="@dimen/circle_size"
|
||||
android:layout_gravity="center"
|
||||
android:alpha="0.5"
|
||||
android:src="@drawable/ic_circle"/>
|
||||
|
||||
</FrameLayout>
|
||||
@@ -1,3 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"></menu>
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:mapbox="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/action_id_remove"
|
||||
android:icon="@drawable/ic_delete_24dp"
|
||||
android:icon="@drawable/ic_delete"
|
||||
android:title="@string/action_remove_polylines"
|
||||
mapbox:showAsAction="ifRoom" />
|
||||
<item
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="toolbar_padding_top">25dp</dimen>
|
||||
</resources>
|
||||
@@ -1,6 +0,0 @@
|
||||
<resources>
|
||||
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
|
||||
(such as screen margins) for screens with more than 820dp of available width. This
|
||||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
|
||||
<dimen name="activity_horizontal_margin">64dp</dimen>
|
||||
</resources>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string-array name="bulk_marker_list">
|
||||
<item>10</item>
|
||||
<item>100</item>
|
||||
<item>500</item>
|
||||
<item>1000</item>
|
||||
<item>10000</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="user_tracking_mode">
|
||||
<item>Disabled</item>
|
||||
<item>Follow tracking</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="user_bearing_mode">
|
||||
<item>Disabled</item>
|
||||
<item>GPS bearing</item>
|
||||
<item>Compass bearing</item>
|
||||
<!--<item>Combined mode</item>-->
|
||||
</string-array>
|
||||
</resources>
|
||||
@@ -5,10 +5,6 @@
|
||||
<color name="accent">#E55E5E</color>
|
||||
<color name="white">#F9F9F9</color>
|
||||
<color name="mapboxGreen">#56B881</color>
|
||||
<color name="mapboxPurple">#8a8acb</color>
|
||||
|
||||
<color name="materialGrey">#F5F5F5</color>
|
||||
<color name="materialDarkGrey">#DFDFDF</color>
|
||||
|
||||
<color name="redAccent">#D50000</color>
|
||||
<color name="blueAccent">#2962FF</color>
|
||||
|
||||
@@ -2,19 +2,12 @@
|
||||
<resources>
|
||||
<dimen name="circle_size">24dp</dimen>
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
<dimen name="full_button_margin">8dp</dimen>
|
||||
<dimen name="attr_margin">10dp</dimen>
|
||||
<dimen name="coordinatebounds_margin">32dp</dimen>
|
||||
<dimen name="map_padding_left">96dp</dimen>
|
||||
<dimen name="map_padding_bottom">256dp</dimen>
|
||||
<dimen name="map_padding_right">32dp</dimen>
|
||||
<dimen name="map_padding_top">0dp</dimen>
|
||||
<dimen name="toolbar_shadow">4dp</dimen>
|
||||
<dimen name="locationview_background_drawable_padding">2dp</dimen>
|
||||
<dimen name="locationview_padding_top">350dp</dimen>
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
<dimen name="navigation_drawer_width">240dp</dimen>
|
||||
<dimen name="toolbar_padding_top">0dp</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">Mapbox Android SDK TestApp</string>
|
||||
|
||||
<!-- Test Activities -->
|
||||
<string name="activity_mapboxmap">MapboxMap Activity</string>
|
||||
|
||||
<!-- Fragment -->
|
||||
<!--Activity-->
|
||||
<string name="activity_map_fragment_suport">Support Map Fragment</string>
|
||||
<string name="activity_map_fragment">Map Fragment</string>
|
||||
<string name="activity_multimap">Multiple Maps on Screen</string>
|
||||
|
||||
<!-- Annotations -->
|
||||
<string name="activity_add_bulk_markers">Add Markers In Bulk</string>
|
||||
<string name="activity_animated_marker">Animated Markers</string>
|
||||
<string name="activity_dynamic_marker">Dynamic Marker</string>
|
||||
@@ -20,22 +14,15 @@
|
||||
<string name="activity_press_for_marker">Press Map For Marker</string>
|
||||
<string name="activity_view_marker">View Marker API</string>
|
||||
<string name="activity_add_remove_markers">Add/Remove marker</string>
|
||||
|
||||
<!-- InfoWindow-->
|
||||
<string name="activity_info_window">Standard InfoWindow</string>
|
||||
<string name="activity_infowindow_adapter">Custom InfoWindow</string>
|
||||
<string name="activity_dynamic_infowindow_adapter">Custom Dynamic InfoWindow</string>
|
||||
|
||||
<!-- Camera -->
|
||||
<string name="activity_camera_animation_types">Animation Types</string>
|
||||
<string name="activity_camera_zoom">Zoom Methods</string>
|
||||
<string name="activity_visible_coordinate_bounds">LatLngBounds Method</string>
|
||||
<string name="activity_camera_position">CameraPosition Method</string>
|
||||
<string name="activity_scroll_by">Scroll By Method</string>
|
||||
|
||||
<!-- Other -->
|
||||
<string name="activity_double_map">Double Map Activity</string>
|
||||
<string name="activity_back_to_map">Back to map activity</string>
|
||||
<string name="activity_snapshot">Snapshot Activity</string>
|
||||
<string name="activity_user_tracking_mode">User tracking mode</string>
|
||||
<string name="activity_user_tracking_customization">User location drawable</string>
|
||||
@@ -66,7 +53,7 @@
|
||||
<string name="activity_map_in_dialog">Dialog with map</string>
|
||||
<string name="activity_marker_view_rectangle">Marker views in rectangle</string>
|
||||
|
||||
<!-- Description -->
|
||||
<!--Description-->
|
||||
<string name="description_user_location_tracking">Tracks the location of the user</string>
|
||||
<string name="description_user_location_customization">Customize the location of the user</string>
|
||||
<string name="description_user_location_dot_color">Customize the user location color</string>
|
||||
@@ -81,7 +68,6 @@
|
||||
<string name="description_camera_zoom">Different types of zoom methods</string>
|
||||
<string name="description_minmax_zoom">Configure a max and min zoomlevel</string>
|
||||
<string name="description_info_window">Learn how to handle the InfoWindow</string>
|
||||
<string name="description_info_window_concurrent">InfoWindow example with multiple open</string>
|
||||
<string name="description_add_bulk_markers">Add Markers In Bulk to a Map</string>
|
||||
<string name="description_camera_animation_types">Showcase the different animation types</string>
|
||||
<string name="description_visible_bounds">Center the camera around a bounds</string>
|
||||
@@ -96,7 +82,6 @@
|
||||
<string name="description_scroll_by">Scroll with pixels in x,y direction</string>
|
||||
<string name="description_snapshot">Example to make a snapshot of the map</string>
|
||||
<string name="description_doublemap">2 maps in a view hierarchy</string>
|
||||
<string name="description_back_to_map">Restart map view after temporarily leaving to another activity</string>
|
||||
<string name="description_view_marker">Use an Android SDK View as marker</string>
|
||||
<string name="description_dynamic_info_window_adapter">Learn how to create a dynamic custom InfoWindow</string>
|
||||
<string name="description_viewpager">Use SupportMapFragments in a ViewPager</string>
|
||||
@@ -119,12 +104,7 @@
|
||||
<string name="description_marker_view_rectangle">Marker Views within a rectangle</string>
|
||||
<string name="description_circle_layer">Show bus stops and route in Singapore</string>
|
||||
|
||||
<string name="menuitem_title_concurrent_infowindow">Concurrent Open InfoWindows</string>
|
||||
<string name="menuitem_title_deselect_markers_on_tap">Deselect Markers On Tap</string>
|
||||
<string name="menuitem_title_tracking_mode_dismiss_on_gesture">Dismiss location tracking on gesture</string>
|
||||
<string name="menuitem_title_bearing_mode_dismiss_on_gesture">Dismiss bearing tracking on gesture</string>
|
||||
<string name="menuitem_title_reset">Reset</string>
|
||||
|
||||
<!--Categories-->
|
||||
<string name="category">category</string>
|
||||
<string name="category_basic">_Basic</string>
|
||||
<string name="category_annotation">Annotation</string>
|
||||
@@ -139,87 +119,43 @@
|
||||
<string name="category_style">Styling</string>
|
||||
<string name="category_features">Features</string>
|
||||
|
||||
<string name="action_visible_bounds_explanation">Center map around 2 markers</string>
|
||||
<!--Actions-->
|
||||
<string name="action_remove_polylines">Remove polylines</string>
|
||||
|
||||
<string name="action_visibility_polygon">Change visibility</string>
|
||||
<string name="action_alpha_polygon">Change alpha</string>
|
||||
<string name="action_points_polygon">Change points</string>
|
||||
<string name="action_color_polygon">Change color</string>
|
||||
<string name="action_width_polyline">Change width</string>
|
||||
|
||||
<!--Menu-->
|
||||
<string name="menuitem_title_concurrent_infowindow">Concurrent Open InfoWindows</string>
|
||||
<string name="menuitem_title_deselect_markers_on_tap">Deselect Markers On Tap</string>
|
||||
<string name="menuitem_title_tracking_mode_dismiss_on_gesture">Dismiss location tracking on gesture</string>
|
||||
<string name="menuitem_title_bearing_mode_dismiss_on_gesture">Dismiss bearing tracking on gesture</string>
|
||||
<string name="menuitem_title_reset">Reset</string>
|
||||
<string name="menuitem_title_rotate_gesture_enabled">Enable rotate gestures</string>
|
||||
<string name="menuitem_title_scroll_gesture_enabled">Enable scroll gestures</string>
|
||||
|
||||
<!--Button-->
|
||||
<string name="button_camera_move">Move</string>
|
||||
<string name="button_camera_ease">Ease</string>
|
||||
<string name="button_camera_animate">Animate</string>
|
||||
<string name="button_make_snapshot">Snapshot</string>
|
||||
<string name="button_user_dot_default">Default</string>
|
||||
<string name="button_user_dot_tint">Tint dot</string>
|
||||
<string name="button_user_accuracy_ring_tint">Tint ring</string>
|
||||
<string name="button_user_transparent_tint">tran</string>
|
||||
<string name="button_open_dialog">Open dialog</string>
|
||||
|
||||
<string name="label_fps">FPS:</string>
|
||||
|
||||
<string name="styleMapboxStreets">Mapbox Streets</string>
|
||||
<string name="styleEmerald">Emerald</string>
|
||||
<string name="styleLight">Light</string>
|
||||
<string name="styleDark">Dark</string>
|
||||
<string name="styleSatellite">Satellite</string>
|
||||
<string name="styleSatelliteStreets">Satellite Streets</string>
|
||||
|
||||
<string-array name="outdoors_class_list">
|
||||
<item>Day</item>
|
||||
<item>Night</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="bulk_marker_list">
|
||||
<item>10</item>
|
||||
<item>100</item>
|
||||
<item>500</item>
|
||||
<item>1000</item>
|
||||
<item>10000</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="user_tracking_mode">
|
||||
<item>Disabled</item>
|
||||
<item>Follow tracking</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="user_bearing_mode">
|
||||
<item>Disabled</item>
|
||||
<item>GPS bearing</item>
|
||||
<item>Compass bearing</item>
|
||||
<!--<item>Combined mode</item>-->
|
||||
</string-array>
|
||||
|
||||
<string name="zoom_botton">Zoom</string>
|
||||
|
||||
<string name="scrollby_x_value">X: %1$d</string>
|
||||
<string name="scrollby_y_value">Y: %1$d</string>
|
||||
<string name="button_download_region">Download region</string>
|
||||
<string name="button_list_regions">List regions</string>
|
||||
|
||||
<!--Other-->
|
||||
<string name="navigation_drawer_open">Open navigation drawer</string>
|
||||
<string name="navigation_drawer_close">Close navigation drawer</string>
|
||||
<string name="scrollby_x_value">X: %1$d</string>
|
||||
<string name="scrollby_y_value">Y: %1$d</string>
|
||||
<string name="dialog_camera_position">Animate to new position</string>
|
||||
|
||||
<string name="geocoder_instructions">Tap Map To Geocode Where Black Marker Is Currently Located</string>
|
||||
|
||||
<string name="dynamic_marker_chelsea_title">Chelsea</string>
|
||||
<string name="dynamic_marker_chelsea_snippet">Stamford Bridge</string>
|
||||
<string name="dynamic_marker_arsenal_title">Arsenal</string>
|
||||
<string name="dynamic_marker_arsenal_snippet">Emirates Stadium</string>
|
||||
|
||||
<string name="navigation_select_location_button_text">Select Location!</string>
|
||||
|
||||
<string name="title_section1">Different style</string>
|
||||
<string name="title_section2">Show Snackbar</string>
|
||||
|
||||
<string name="navigation_drawer_open">Open navigation drawer</string>
|
||||
<string name="navigation_drawer_close">Close navigation drawer</string>
|
||||
|
||||
<string name="action_example">Example action</string>
|
||||
|
||||
<string name="action_settings">Settings</string>
|
||||
<string name="menuitem_title_rotate_gesture_enabled">Enable rotate gestures</string>
|
||||
<string name="menuitem_title_scroll_gesture_enabled">Enable scroll gestures</string>
|
||||
|
||||
</resources>
|
||||
|
||||