[android] - move camera logic to dedicated transform class (#6919)

* [android] - move camera logic to dedicated transform class

post camera updates to the message queue, this makes calling an new camera update in the on finish of another update possible. Simplify transform.java implementation.

* fail the step if instrumentation tests fail, fixup typo
This commit is contained in:
Tobrun
2016-11-23 10:53:39 +01:00
committed by GitHub
parent 4577c56745
commit edb487b74d
13 changed files with 409 additions and 636 deletions

View File

@@ -61,6 +61,13 @@ public class CameraAnimationTypeActivity extends AppCompatActivity implements On
}
});
mapboxMap.setOnCameraChangeListener(new MapboxMap.OnCameraChangeListener() {
@Override
public void onCameraChange(CameraPosition position) {
Log.e(MapboxConstants.TAG, "OnCameraChange: " + position);
}
});
// handle move button clicks
View moveButton = findViewById(R.id.cameraMoveButton);
if (moveButton != null) {

View File

@@ -54,6 +54,14 @@ public class CameraPositionActivity extends AppCompatActivity implements OnMapRe
@Override
public void onMapReady(@NonNull final MapboxMap mapboxMap) {
this.mapboxMap = mapboxMap;
mapboxMap.setOnCameraChangeListener(new MapboxMap.OnCameraChangeListener() {
@Override
public void onCameraChange(CameraPosition position) {
Log.e(MapboxConstants.TAG, "OnCameraChange: " + position);
}
});
// add a listener to FAB
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setColorFilter(ContextCompat.getColor(CameraPositionActivity.this, R.color.primary));