[android] - transition options in milliseconds, added test cases, fixup test activity code (#8576)
This commit is contained in:
@@ -75,6 +75,38 @@ public class MapboxMapTest {
|
||||
assertNotNull("mapboxMap should not be null", mapboxMap);
|
||||
}
|
||||
|
||||
//
|
||||
// Style wide transition options
|
||||
//
|
||||
|
||||
@Test
|
||||
public void testTransitionDuration() {
|
||||
ViewUtils.checkViewIsDisplayed(R.id.mapView);
|
||||
final MapboxMap mapboxMap = activity.getMapboxMap();
|
||||
onView(withId(R.id.mapView)).perform(new MapboxMapAction(new InvokeViewAction() {
|
||||
@Override
|
||||
public void onViewAction(UiController uiController, View view) {
|
||||
long transitionDuration = 600;
|
||||
mapboxMap.setTransitionDuration(transitionDuration);
|
||||
assertEquals("TransitionDuration should match", transitionDuration, mapboxMap.getTransitionDuration(), 0);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTransitionDelay() {
|
||||
ViewUtils.checkViewIsDisplayed(R.id.mapView);
|
||||
final MapboxMap mapboxMap = activity.getMapboxMap();
|
||||
onView(withId(R.id.mapView)).perform(new MapboxMapAction(new InvokeViewAction() {
|
||||
@Override
|
||||
public void onViewAction(UiController uiController, View view) {
|
||||
long transitionDelay = 50;
|
||||
mapboxMap.setTransitionDelay(transitionDelay);
|
||||
assertEquals("TransitionDelay should match", transitionDelay, mapboxMap.getTransitionDelay(), 0);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
//
|
||||
// MinZoomLevel
|
||||
//
|
||||
|
||||
@@ -259,8 +259,8 @@ public class RuntimeStyleActivity extends AppCompatActivity {
|
||||
private void setWaterColor() {
|
||||
Layer water = mapboxMap.getLayer("water");
|
||||
if (water != null) {
|
||||
mapboxMap.setTransitionDuration(5);
|
||||
mapboxMap.setTransitionDelay(1);
|
||||
mapboxMap.setTransitionDuration(5000);
|
||||
mapboxMap.setTransitionDelay(1000);
|
||||
water.setProperties(
|
||||
visibility(VISIBLE),
|
||||
fillColor(Color.RED)
|
||||
|
||||
Reference in New Issue
Block a user