Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] - update components with camera values when animating (#9174)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun authored Jun 9, 2017
1 parent 9f88e37 commit fa972fa
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ CameraPosition invalidateCameraPosition() {
cameraChangeDispatcher.onCameraMove();
}

if (isComponentUpdateRequired(cameraPosition)) {
updateCameraPosition(cameraPosition);
}

this.cameraPosition = cameraPosition;
if (onCameraChangeListener != null) {
onCameraChangeListener.onCameraChange(this.cameraPosition);
Expand All @@ -158,6 +162,11 @@ CameraPosition invalidateCameraPosition() {
return cameraPosition;
}

private boolean isComponentUpdateRequired(@NonNull CameraPosition cameraPosition) {
return this.cameraPosition != null && (this.cameraPosition.tilt != cameraPosition.tilt
|| this.cameraPosition.bearing != cameraPosition.bearing);
}

void cancelTransitions() {
// notify user about cancel
cameraChangeDispatcher.onCameraMoveCanceled();
Expand Down

0 comments on commit fa972fa

Please sign in to comment.