[android] - add binding support for Light (#9013)
This commit is contained in:
@@ -0,0 +1,162 @@
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.espresso.UiController;
|
||||
import android.support.test.espresso.ViewAction;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.view.View;
|
||||
|
||||
import com.mapbox.mapboxsdk.style.light.Light;
|
||||
import com.mapbox.mapboxsdk.style.functions.Function;
|
||||
import com.mapbox.mapboxsdk.style.functions.stops.IdentityStops;
|
||||
import com.mapbox.mapboxsdk.style.layers.FillExtrusionLayer;
|
||||
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
|
||||
import com.mapbox.mapboxsdk.style.light.Position;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.FillExtrusionStyleTestActivity;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
import org.hamcrest.Matcher;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Filter.eq;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.ANCHOR_MAP;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.fillExtrusionBase;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.fillExtrusionColor;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.fillExtrusionHeight;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.fillExtrusionOpacity;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertNotNull;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class LightTest extends BaseActivityTest {
|
||||
|
||||
private Light light;
|
||||
|
||||
@Test
|
||||
public void testAnchor() {
|
||||
validateTestSetup();
|
||||
setupLayer();
|
||||
Timber.i("anchor");
|
||||
assertNotNull(light);
|
||||
// Set and Get
|
||||
light.setAnchor(ANCHOR_MAP);
|
||||
assertEquals("Anchor should match", ANCHOR_MAP, light.getAnchor());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPositionTransition() {
|
||||
validateTestSetup();
|
||||
setupLayer();
|
||||
Timber.i("positionTransitionOptions");
|
||||
assertNotNull(light);
|
||||
|
||||
// Set and Get
|
||||
TransitionOptions options = new TransitionOptions(300, 100);
|
||||
light.setPositionTransition(options);
|
||||
assertEquals("Transition options should match", options, light.getPositionTransition());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPosition() {
|
||||
validateTestSetup();
|
||||
setupLayer();
|
||||
Timber.i("position");
|
||||
assertNotNull(light);
|
||||
|
||||
// Set and Get
|
||||
Position position = new Position(1,2,3);
|
||||
light.setPosition(position);
|
||||
assertEquals("Position should match", position, light.getPosition());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testColorTransition() {
|
||||
validateTestSetup();
|
||||
setupLayer();
|
||||
Timber.i("colorTransitionOptions");
|
||||
assertNotNull(light);
|
||||
|
||||
// Set and Get
|
||||
TransitionOptions options = new TransitionOptions(300, 100);
|
||||
light.setColorTransition(options);
|
||||
assertEquals("Transition options should match", options, light.getColorTransition());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testColor() {
|
||||
validateTestSetup();
|
||||
setupLayer();
|
||||
Timber.i("color");
|
||||
assertNotNull(light);
|
||||
// Set and Get
|
||||
light.setColor("rgba(0, 0, 0, 1)");
|
||||
assertEquals("Color should match", "rgba(0, 0, 0, 1)".replaceAll("\\s+",""), light.getColor());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIntensityTransition() {
|
||||
validateTestSetup();
|
||||
setupLayer();
|
||||
Timber.i("intensityTransitionOptions");
|
||||
assertNotNull(light);
|
||||
|
||||
// Set and Get
|
||||
TransitionOptions options = new TransitionOptions(300, 100);
|
||||
light.setIntensityTransition(options);
|
||||
assertEquals("Transition options should match", options, light.getIntensityTransition());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIntensity() {
|
||||
validateTestSetup();
|
||||
setupLayer();
|
||||
Timber.i("intensity");
|
||||
assertNotNull(light);
|
||||
// Set and Get
|
||||
light.setIntensity(0.3f);
|
||||
assertEquals("Intensity should match", 0.3f, light.getIntensity());
|
||||
}
|
||||
|
||||
private void setupLayer() {
|
||||
onView(withId(R.id.mapView)).perform(new ViewAction() {
|
||||
@Override
|
||||
public Matcher<View> getConstraints() {
|
||||
return isDisplayed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(UiController uiController, View view) {
|
||||
light = mapboxMap.getLight();
|
||||
FillExtrusionLayer fillExtrusionLayer = new FillExtrusionLayer("3d-buildings", "composite");
|
||||
fillExtrusionLayer.setSourceLayer("building");
|
||||
fillExtrusionLayer.setFilter(eq("extrude", "true"));
|
||||
fillExtrusionLayer.setMinZoom(15);
|
||||
fillExtrusionLayer.setProperties(
|
||||
fillExtrusionColor(Color.LTGRAY),
|
||||
fillExtrusionHeight(Function.property("height", new IdentityStops<Float>())),
|
||||
fillExtrusionBase(Function.property("min_height", new IdentityStops<Float>())),
|
||||
fillExtrusionOpacity(0.6f)
|
||||
);
|
||||
mapboxMap.addLayer(fillExtrusionLayer);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return FillExtrusionStyleTestActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
<%
|
||||
const properties = locals.properties;
|
||||
-%>
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.espresso.UiController;
|
||||
import android.support.test.espresso.ViewAction;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.view.View;
|
||||
|
||||
import com.mapbox.mapboxsdk.style.light.Light;
|
||||
import com.mapbox.mapboxsdk.style.functions.Function;
|
||||
import com.mapbox.mapboxsdk.style.functions.stops.IdentityStops;
|
||||
import com.mapbox.mapboxsdk.style.layers.FillExtrusionLayer;
|
||||
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
|
||||
import com.mapbox.mapboxsdk.style.light.Position;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.FillExtrusionStyleTestActivity;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
import org.hamcrest.Matcher;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Filter.eq;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.ANCHOR_MAP;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.fillExtrusionBase;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.fillExtrusionColor;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.fillExtrusionHeight;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.fillExtrusionOpacity;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertNotNull;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class LightTest extends BaseActivityTest {
|
||||
|
||||
private Light light;
|
||||
<% for (const property of properties) { -%>
|
||||
<% if (property.transition) { -%>
|
||||
|
||||
@Test
|
||||
public void test<%- camelize(property.name) %>Transition() {
|
||||
validateTestSetup();
|
||||
setupLayer();
|
||||
Timber.i("<%- property.name %>TransitionOptions");
|
||||
assertNotNull(light);
|
||||
|
||||
// Set and Get
|
||||
TransitionOptions options = new TransitionOptions(300, 100);
|
||||
light.set<%- camelize(property.name) %>Transition(options);
|
||||
assertEquals("Transition options should match", options, light.get<%- camelize(property.name) %>Transition());
|
||||
}
|
||||
<% } -%>
|
||||
<% if (property.name == "position") { -%>
|
||||
|
||||
@Test
|
||||
public void test<%- camelize(property.name) %>() {
|
||||
validateTestSetup();
|
||||
setupLayer();
|
||||
Timber.i("<%- property.name %>");
|
||||
assertNotNull(light);
|
||||
|
||||
// Set and Get
|
||||
Position position = new Position(1,2,3);
|
||||
light.set<%- camelize(property.name) %>(position);
|
||||
assertEquals("Position should match", position, light.get<%- camelize(property.name) %>());
|
||||
}
|
||||
<% } else { -%>
|
||||
|
||||
@Test
|
||||
public void test<%- camelize(property.name) %>() {
|
||||
validateTestSetup();
|
||||
setupLayer();
|
||||
Timber.i("<%- property.name %>");
|
||||
assertNotNull(light);
|
||||
// Set and Get
|
||||
light.set<%- camelize(property.name) %>(<%- defaultValueJava(property) %>);
|
||||
<% if (property.name == 'color') { -%>
|
||||
assertEquals("<%- camelize(property.name) %> should match", <%- defaultValueJava(property) %>.replaceAll("\\s+",""), light.get<%- camelize(property.name) %>());
|
||||
<% } else { -%>
|
||||
assertEquals("<%- camelize(property.name) %> should match", <%- defaultValueJava(property) %>, light.get<%- camelize(property.name) %>());
|
||||
<% } -%>
|
||||
}
|
||||
<% } -%>
|
||||
<% } -%>
|
||||
|
||||
private void setupLayer() {
|
||||
onView(withId(R.id.mapView)).perform(new ViewAction() {
|
||||
@Override
|
||||
public Matcher<View> getConstraints() {
|
||||
return isDisplayed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(UiController uiController, View view) {
|
||||
light = mapboxMap.getLight();
|
||||
FillExtrusionLayer fillExtrusionLayer = new FillExtrusionLayer("3d-buildings", "composite");
|
||||
fillExtrusionLayer.setSourceLayer("building");
|
||||
fillExtrusionLayer.setFilter(eq("extrude", "true"));
|
||||
fillExtrusionLayer.setMinZoom(15);
|
||||
fillExtrusionLayer.setProperties(
|
||||
fillExtrusionColor(Color.LTGRAY),
|
||||
fillExtrusionHeight(Function.property("height", new IdentityStops<Float>())),
|
||||
fillExtrusionBase(Function.property("min_height", new IdentityStops<Float>())),
|
||||
fillExtrusionOpacity(0.6f)
|
||||
);
|
||||
mapboxMap.addLayer(fillExtrusionLayer);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return FillExtrusionStyleTestActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -661,7 +661,9 @@
|
||||
<activity
|
||||
android:name=".activity.espresso.EspressoTestActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
|
||||
<activity
|
||||
android:name=".activity.style.FillExtrusionStyleTestActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
<!-- Configuration Settings -->
|
||||
<meta-data
|
||||
android:name="com.mapbox.TestEventsServer"
|
||||
|
||||
@@ -4,6 +4,9 @@ import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
||||
import com.mapbox.mapboxsdk.maps.MapView;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
@@ -11,6 +14,10 @@ import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
|
||||
import com.mapbox.mapboxsdk.style.functions.Function;
|
||||
import com.mapbox.mapboxsdk.style.functions.stops.IdentityStops;
|
||||
import com.mapbox.mapboxsdk.style.layers.FillExtrusionLayer;
|
||||
import com.mapbox.mapboxsdk.style.layers.Property;
|
||||
import com.mapbox.mapboxsdk.style.layers.PropertyFactory;
|
||||
import com.mapbox.mapboxsdk.style.light.Light;
|
||||
import com.mapbox.mapboxsdk.style.light.Position;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
|
||||
import static com.mapbox.mapboxsdk.style.layers.Filter.eq;
|
||||
@@ -25,6 +32,13 @@ import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.fillExtrusionOpa
|
||||
public class BuildingFillExtrusionActivity extends AppCompatActivity {
|
||||
|
||||
private MapView mapView;
|
||||
private MapboxMap mapboxMap;
|
||||
private Light light;
|
||||
|
||||
private boolean isMapAnchorLight;
|
||||
private boolean isLowIntensityLight;
|
||||
private boolean isRedColor;
|
||||
private boolean isInitPosition;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -35,21 +49,72 @@ public class BuildingFillExtrusionActivity extends AppCompatActivity {
|
||||
mapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@Override
|
||||
public void onMapReady(@NonNull final MapboxMap map) {
|
||||
FillExtrusionLayer fillExtrusionLayer = new FillExtrusionLayer("3d-buildings", "composite");
|
||||
fillExtrusionLayer.setSourceLayer("building");
|
||||
fillExtrusionLayer.setFilter(eq("extrude", "true"));
|
||||
fillExtrusionLayer.setMinZoom(15);
|
||||
fillExtrusionLayer.setProperties(
|
||||
fillExtrusionColor(Color.LTGRAY),
|
||||
fillExtrusionHeight(Function.property("height", new IdentityStops<Float>())),
|
||||
fillExtrusionBase(Function.property("min_height", new IdentityStops<Float>())),
|
||||
fillExtrusionOpacity(0.6f)
|
||||
);
|
||||
map.addLayer(fillExtrusionLayer);
|
||||
mapboxMap = map;
|
||||
setupBuildings();
|
||||
setupLight();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setupBuildings() {
|
||||
FillExtrusionLayer fillExtrusionLayer = new FillExtrusionLayer("3d-buildings", "composite");
|
||||
fillExtrusionLayer.setSourceLayer("building");
|
||||
fillExtrusionLayer.setFilter(eq("extrude", "true"));
|
||||
fillExtrusionLayer.setMinZoom(15);
|
||||
fillExtrusionLayer.setProperties(
|
||||
fillExtrusionColor(Color.LTGRAY),
|
||||
fillExtrusionHeight(Function.property("height", new IdentityStops<Float>())),
|
||||
fillExtrusionBase(Function.property("min_height", new IdentityStops<Float>())),
|
||||
fillExtrusionOpacity(0.9f)
|
||||
);
|
||||
mapboxMap.addLayer(fillExtrusionLayer);
|
||||
}
|
||||
|
||||
private void setupLight() {
|
||||
light = mapboxMap.getLight();
|
||||
|
||||
findViewById(R.id.fabLightPosition).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
isInitPosition = !isInitPosition;
|
||||
if (isInitPosition) {
|
||||
light.setPosition(new Position(1.5f, 90, 80));
|
||||
} else {
|
||||
light.setPosition(new Position(1.15f, 210, 30));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
findViewById(R.id.fabLightColor).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
isRedColor = !isRedColor;
|
||||
light.setColor(PropertyFactory.colorToRgbaString(isRedColor ? Color.RED : Color.BLUE));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.menu_building, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (light != null) {
|
||||
int id = item.getItemId();
|
||||
if (id == R.id.menu_action_anchor) {
|
||||
isMapAnchorLight = !isMapAnchorLight;
|
||||
light.setAnchor(isMapAnchorLight ? Property.ANCHOR_MAP : Property.ANCHOR_VIEWPORT);
|
||||
} else if (id == R.id.menu_action_intensity) {
|
||||
isLowIntensityLight = !isLowIntensityLight;
|
||||
light.setIntensity(isLowIntensityLight ? 0.35f : 1.0f);
|
||||
}
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
@@ -91,5 +156,4 @@ public class BuildingFillExtrusionActivity extends AppCompatActivity {
|
||||
super.onDestroy();
|
||||
mapView.onDestroy();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.mapbox.mapboxsdk.testapp.activity.style;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import com.mapbox.mapboxsdk.maps.MapView;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
|
||||
public class FillExtrusionStyleTestActivity extends AppCompatActivity {
|
||||
|
||||
public MapView mapView;
|
||||
private MapboxMap mapboxMap;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_extrusion_test);
|
||||
|
||||
// Initialize map as normal
|
||||
mapView = (MapView) findViewById(R.id.mapView);
|
||||
mapView.onCreate(savedInstanceState);
|
||||
mapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@Override
|
||||
public void onMapReady(MapboxMap mapboxMap) {
|
||||
FillExtrusionStyleTestActivity.this.mapboxMap = mapboxMap;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public MapboxMap getMapboxMap() {
|
||||
return mapboxMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
mapView.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mapView.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
mapView.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
mapView.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
mapView.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mapView.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
mapView.onLowMemory();
|
||||
}
|
||||
}
|
||||
@@ -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="#FFFFFFFF"
|
||||
android:pathData="M18,4V3c0,-0.55 -0.45,-1 -1,-1H5c-0.55,0 -1,0.45 -1,1v4c0,0.55 0.45,1 1,1h12c0.55,0 1,-0.45 1,-1V6h1v4H9v11c0,0.55 0.45,1 1,1h2c0.55,0 1,-0.45 1,-1v-9h8V4h-3z"/>
|
||||
</vector>
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<FrameLayout 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:layout_height="match_parent">
|
||||
|
||||
<com.mapbox.mapboxsdk.maps.MapView
|
||||
android:id="@id/mapView"
|
||||
@@ -13,6 +12,27 @@
|
||||
app:mapbox_cameraTargetLng="-74.0066"
|
||||
app:mapbox_cameraTilt="45"
|
||||
app:mapbox_cameraZoom="15"
|
||||
app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets"/>
|
||||
app:mapbox_styleUrl="@string/mapbox_style_dark"/>
|
||||
|
||||
</RelativeLayout>
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fabLightPosition"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_marginBottom="82dp"
|
||||
android:layout_marginRight="@dimen/fab_margin"
|
||||
android:layout_marginEnd="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_my_location"
|
||||
app:backgroundTint="@color/accent"
|
||||
app:layout_anchorGravity="top"/>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fabLightColor"
|
||||
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_paint"
|
||||
app:backgroundTint="@color/primary"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?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">
|
||||
|
||||
<com.mapbox.mapboxsdk.maps.MapView
|
||||
android:id="@id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:mapbox_cameraTargetLat="40.7135"
|
||||
app:mapbox_cameraTargetLng="-74.0066"
|
||||
app:mapbox_cameraTilt="45"
|
||||
app:mapbox_cameraZoom="15"
|
||||
app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets"/>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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">
|
||||
<item
|
||||
android:id="@+id/menu_action_intensity"
|
||||
android:title="Change intensity"
|
||||
app:showAsAction="never"/>
|
||||
<item
|
||||
android:id="@+id/menu_action_anchor"
|
||||
android:title="Change Anchor"
|
||||
app:showAsAction="never"/>
|
||||
</menu>
|
||||
Reference in New Issue
Block a user