@Test public void locationChange_zoomsToCurrentLocation_ifTheViewportWasNotPreviouslyUpdated() { map.resetState(); ActivityController controller = RobolectricHelpers.buildThemedActivity(FormMapActivity.class); FormMapActivity activity = (FormMapActivity) controller.get(); InMemInstancesRepository inMemInstancesRepository = new InMemInstancesRepository(new ArrayList<>()); FormMapViewModel viewModel = new FormMapViewModel(FormMapViewModelTest.TEST_FORM_1, inMemInstancesRepository); activity.viewModelFactory = new TestFactory(viewModel); controller.setup(); assertThat(map.getZoomCount(), is(0)); map.onLocationChanged(currentLocation); assertThat(map.getZoomCount(), is(1)); assertThat(map.getLatestZoomPoint(), is(currentLocation)); assertThat(map.wasLatestZoomCallAnimated(), is(true)); }
public void onLocationChanged(MapPoint point) { if (!viewportInitialized) { map.zoomToPoint(point, true); viewportInitialized = true; } }
FormMapActivity extends BaseGeoMapActivity { public void onLocationChanged(MapPoint point) { if (!viewportInitialized) { map.zoomToPoint(point, true); viewportInitialized = true; } } }
FormMapActivity extends BaseGeoMapActivity { public void onLocationChanged(MapPoint point) { if (!viewportInitialized) { map.zoomToPoint(point, true); viewportInitialized = true; } }  }
FormMapActivity extends BaseGeoMapActivity { public void onLocationChanged(MapPoint point) { if (!viewportInitialized) { map.zoomToPoint(point, true); viewportInitialized = true; } }  @Override void onCreate(Bundle savedInstanceState); @Override void onResume(); @Override void onBackPressed(); @SuppressLint("MissingPermission") // Permission handled in Constructor void initMap(MapFragment newMapFragment); void onLocationChanged(MapPoint point); void onFeatureClicked(int featureId); }
FormMapActivity extends BaseGeoMapActivity { public void onLocationChanged(MapPoint point) { if (!viewportInitialized) { map.zoomToPoint(point, true); viewportInitialized = true; } }  @Override void onCreate(Bundle savedInstanceState); @Override void onResume(); @Override void onBackPressed(); @SuppressLint("MissingPermission") // Permission handled in Constructor void initMap(MapFragment newMapFragment); void onLocationChanged(MapPoint point); void onFeatureClicked(int featureId); static final String MAP_CENTER_KEY; static final String MAP_ZOOM_KEY; public BottomSheetBehavior summarySheet; @VisibleForTesting public ViewModelProvider.Factory viewModelFactory; }