@@ -144,6 +144,7 @@ public class LocationComponentOptions implements Parcelable {
144144 private float pulseAlpha ;
145145 @ Nullable
146146 private Interpolator pulseInterpolator ;
147+ private Boolean concurrentCameraAnimationsEnabled ;
147148
148149 public LocationComponentOptions (
149150 float accuracyAlpha ,
@@ -186,7 +187,8 @@ public LocationComponentOptions(
186187 float pulseSingleDuration ,
187188 float pulseMaxRadius ,
188189 float pulseAlpha ,
189- @ Nullable Interpolator pulseInterpolator ) {
190+ @ Nullable Interpolator pulseInterpolator ,
191+ Boolean concurrentCameraAnimationsEnabled ) {
190192 this .accuracyAlpha = accuracyAlpha ;
191193 this .accuracyColor = accuracyColor ;
192194 this .backgroundDrawableStale = backgroundDrawableStale ;
@@ -231,6 +233,7 @@ public LocationComponentOptions(
231233 this .pulseMaxRadius = pulseMaxRadius ;
232234 this .pulseAlpha = pulseAlpha ;
233235 this .pulseInterpolator = pulseInterpolator ;
236+ this .concurrentCameraAnimationsEnabled = concurrentCameraAnimationsEnabled ;
234237 }
235238
236239 /**
@@ -373,6 +376,10 @@ public static LocationComponentOptions createFromAttributes(@NonNull Context con
373376 builder .pulseAlpha = typedArray .getFloat (
374377 R .styleable .maplibre_LocationComponent_maplibre_pulsingLocationCircleAlpha , CIRCLE_PULSING_ALPHA_DEFAULT );
375378
379+ builder .concurrentCameraAnimationsEnabled = typedArray .getBoolean (
380+ R .styleable .maplibre_LocationComponent_maplibre_concurrentCameraAnimationsEnabled , false
381+ );
382+
376383 typedArray .recycle ();
377384
378385 return builder .build ();
@@ -892,6 +899,15 @@ public Interpolator pulseInterpolator() {
892899 return pulseInterpolator ;
893900 }
894901
902+ /**
903+ * Enable or disable concurrent camera animations during navigation
904+ *
905+ * @return whether concurrent camera animations are enabled or disabled during navigation
906+ */
907+ public Boolean concurrentCameraAnimationsEnabled () {
908+ return concurrentCameraAnimationsEnabled ;
909+ }
910+
895911 @ NonNull
896912 @ Override
897913 public String toString () {
@@ -934,6 +950,7 @@ public String toString() {
934950 + "pulseSingleDuration=" + pulseSingleDuration
935951 + "pulseMaxRadius=" + pulseMaxRadius
936952 + "pulseAlpha=" + pulseAlpha
953+ + "concurrentCameraAnimationsEnabled=" + concurrentCameraAnimationsEnabled
937954 + "}" ;
938955 }
939956
@@ -1081,6 +1098,10 @@ public boolean equals(Object o) {
10811098 return false ;
10821099 }
10831100
1101+ if (concurrentCameraAnimationsEnabled != options .concurrentCameraAnimationsEnabled ) {
1102+ return false ;
1103+ }
1104+
10841105 return layerBelow != null ? layerBelow .equals (options .layerBelow ) : options .layerBelow == null ;
10851106 }
10861107
@@ -1130,6 +1151,7 @@ public int hashCode() {
11301151 result = 31 * result + (pulseSingleDuration != +0.0f ? Float .floatToIntBits (pulseSingleDuration ) : 0 );
11311152 result = 31 * result + (pulseMaxRadius != +0.0f ? Float .floatToIntBits (pulseMaxRadius ) : 0 );
11321153 result = 31 * result + (pulseAlpha != +0.0f ? Float .floatToIntBits (pulseAlpha ) : 0 );
1154+ result = 31 * result + (concurrentCameraAnimationsEnabled ? 1 : 0 );
11331155 return result ;
11341156 }
11351157
@@ -1180,6 +1202,7 @@ public void writeToParcel(Parcel dest, int flags) {
11801202 dest .writeFloat (this .pulseSingleDuration );
11811203 dest .writeFloat (this .pulseMaxRadius );
11821204 dest .writeFloat (this .pulseAlpha );
1205+ dest .writeByte (this .concurrentCameraAnimationsEnabled ? (byte ) 1 : (byte ) 0 );
11831206 }
11841207
11851208 protected LocationComponentOptions (Parcel in ) {
@@ -1223,6 +1246,7 @@ protected LocationComponentOptions(Parcel in) {
12231246 this .pulseSingleDuration = in .readFloat ();
12241247 this .pulseMaxRadius = in .readFloat ();
12251248 this .pulseAlpha = in .readFloat ();
1249+ this .concurrentCameraAnimationsEnabled = in .readByte () != 0 ;
12261250 }
12271251
12281252 public static final Parcelable .Creator <LocationComponentOptions > CREATOR =
@@ -1349,6 +1373,7 @@ public LocationComponentOptions build() {
13491373 private float pulseAlpha ;
13501374 @ Nullable
13511375 private Interpolator pulseInterpolator ;
1376+ private Boolean concurrentCameraAnimationsEnabled ;
13521377
13531378 Builder () {
13541379 }
@@ -1395,6 +1420,7 @@ private Builder(LocationComponentOptions source) {
13951420 this .pulseMaxRadius = source .pulseMaxRadius ;
13961421 this .pulseAlpha = source .pulseAlpha ;
13971422 this .pulseInterpolator = source .pulseInterpolator ;
1423+ this .concurrentCameraAnimationsEnabled = source .concurrentCameraAnimationsEnabled ;
13981424 }
13991425
14001426 /**
@@ -1973,6 +1999,16 @@ public LocationComponentOptions.Builder pulseInterpolator(Interpolator pulseInte
19731999 return this ;
19742000 }
19752001
2002+ /**
2003+ * Enable or disable the concurrent camera animations during navigation feature
2004+ *
2005+ * @return whether concurrent camera animations are enabled or disabled
2006+ */
2007+ public LocationComponentOptions .Builder concurrentCameraAnimationsEnabled (Boolean concurrentCameraAnimationsEnabled ) {
2008+ this .concurrentCameraAnimationsEnabled = concurrentCameraAnimationsEnabled ;
2009+ return this ;
2010+ }
2011+
19762012 @ Nullable
19772013 LocationComponentOptions autoBuild () {
19782014 String missing = "" ;
@@ -2074,7 +2110,8 @@ LocationComponentOptions autoBuild() {
20742110 this .pulseSingleDuration ,
20752111 this .pulseMaxRadius ,
20762112 this .pulseAlpha ,
2077- this .pulseInterpolator );
2113+ this .pulseInterpolator ,
2114+ this .concurrentCameraAnimationsEnabled );
20782115 }
20792116 }
20802117}
0 commit comments