private void changeCamera(CameraUpdate update,CancelableCallback callback){
  if (mAnimateToggle.isChecked()) {
    if (mCustomDurationToggle.isChecked()) {
      int duration=mCustomDurationBar.getProgress();
      mMap.animateCamera(update,Math.max(duration,1),callback);
    }
 else {
      mMap.animateCamera(update,callback);
    }
  }
 else {
    mMap.moveCamera(update);
  }
}

private void changeCamera ( CameraUpdate update , CancelableCallback callback ) { if ( mAnimateToggle . isChecked ( ) ) { if ( mCustomDurationToggle . isChecked ( ) ) { int duration = mCustomDurationBar . getProgress ( ) ; mMap . animateCamera ( update , Math . max ( duration , 1 ) , callback ) ; } else { mMap . animateCamera ( update , callback ) ; } } else { mMap . moveCamera ( update ) ; } }
change the camera position by moving or animating the camera depending on the state of the animate toggle button .
