@@ -59,7 +59,7 @@ public class AnimatedDashLineActivity extends AppCompatActivity implements OnMap
5959 private String TAG = "AnimatedDashLine" ;
6060 private Layer animatedLineLayer ;
6161 private RefreshDashAndGapRunnable refreshDashAndGapRunnable ;
62- private int animationSpeedMillseconds = 100 ;
62+ private int animationSpeedMillseconds = 50 ;
6363 private ValueAnimator animator ;
6464
6565 @ Override
@@ -159,10 +159,10 @@ public void onStyleLoaded(@NonNull Style style) {
159159 style .addLayerBelow (antsTrafficLayer , "bridge-oneway-arrows-blue-major" );
160160
161161
162- /* animatedLineLayer = mapboxMap.getStyle().getLayer(ANIMATE_LINE_LAYER_ID);
162+ animatedLineLayer = mapboxMap .getStyle ().getLayer (ANIMATE_LINE_LAYER_ID );
163163
164164 Runnable runnable = new RefreshDashAndGapRunnable ();
165- handler.postDelayed(runnable, animationSpeedMillseconds);*/
165+ handler .postDelayed (runnable , animationSpeedMillseconds );
166166 }
167167 });
168168
@@ -178,8 +178,7 @@ private class RefreshDashAndGapRunnable implements Runnable {
178178
179179 // We divide the animation up into 40 totalNumberOfSteps to make careful use of the finite space in
180180 // LineAtlas
181- private float totalNumberOfSteps
182- = 40 ;
181+ private float totalNumberOfSteps = 40 ;
183182
184183 // A # of totalNumberOfSteps proportional to the dashLength are devoted to manipulating the dash
185184 private float dashSteps = totalNumberOfSteps * dashLength / (gapLength + dashLength );
@@ -196,10 +195,12 @@ private class RefreshDashAndGapRunnable implements Runnable {
196195 @ Override
197196 public void run () {
198197
198+ /*
199199 if (gap >= totalNumberOfSteps) {
200200 Log.d(TAG, "run: currentStep >= totalNumberOfSteps");
201201 gap = 0;
202202 }
203+ */
203204
204205 Float [] newFloatArray = new Float [] {
205206 0f , Float .valueOf (gap ++ / 10 % 4 ), 2f , 2f , 2f , 2f , 2f , 2f , 2f , 2f
0 commit comments