[android] Fix MapSnapshotter regression and add activity sanity tests (#15580)
* [android] Include more generated sanity tests for Android test app. * [android] Add null check for camera position padding. * [android] Skip map load tests if no mapView is found, include more generated sanity tests for Android test app. * [android] Set mapboxMap to null during the mapView destroy process, fix failed sanity tests. * [android] Add file source related activities to the sanity test exclude list. * [android] Fixes according to @tobrun's review. * [android] Add more activities to exclude list, keep MapSnapshotterActivity for regression test.
This commit is contained in:
@@ -81,7 +81,9 @@ public class MapFragmentActivity extends AppCompatActivity implements MapFragmen
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mapView.removeOnDidFinishRenderingFrameListener(this);
|
||||
if (mapView != null) {
|
||||
mapView.removeOnDidFinishRenderingFrameListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -116,7 +116,7 @@ class LocationFragmentActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
override fun onSuccess(result: LocationEngineResult?) {
|
||||
mapboxMap.animateCamera(CameraUpdateFactory.newLatLngZoom(LatLng(result?.lastLocation), 12.0))
|
||||
if (!mapView.isDestroyed) mapboxMap.animateCamera(CameraUpdateFactory.newLatLngZoom(LatLng(result?.lastLocation), 12.0))
|
||||
}
|
||||
|
||||
override fun onFailure(exception: Exception) {
|
||||
|
||||
@@ -362,7 +362,12 @@ public class SymbolGeneratorActivity extends AppCompatActivity implements OnMapR
|
||||
@Override
|
||||
protected void onPostExecute(HashMap<String, Bitmap> bitmapHashMap) {
|
||||
super.onPostExecute(bitmapHashMap);
|
||||
mapboxMap.getStyle().addImagesAsync(bitmapHashMap);
|
||||
mapboxMap.getStyle(new Style.OnStyleLoaded() {
|
||||
@Override
|
||||
public void onStyleLoaded(@NonNull Style style) {
|
||||
style.addImagesAsync(bitmapHashMap);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user