@@ -59,7 +59,7 @@ public class AnimatedDashLineActivity extends AppCompatActivity implements OnMap
59
59
private String TAG = "AnimatedDashLine" ;
60
60
private Layer animatedLineLayer ;
61
61
private RefreshDashAndGapRunnable refreshDashAndGapRunnable ;
62
- private int animationSpeedMillseconds = 100 ;
62
+ private int animationSpeedMillseconds = 50 ;
63
63
private ValueAnimator animator ;
64
64
65
65
@ Override
@@ -159,10 +159,10 @@ public void onStyleLoaded(@NonNull Style style) {
159
159
style .addLayerBelow (antsTrafficLayer , "bridge-oneway-arrows-blue-major" );
160
160
161
161
162
- /* animatedLineLayer = mapboxMap.getStyle().getLayer(ANIMATE_LINE_LAYER_ID);
162
+ animatedLineLayer = mapboxMap .getStyle ().getLayer (ANIMATE_LINE_LAYER_ID );
163
163
164
164
Runnable runnable = new RefreshDashAndGapRunnable ();
165
- handler.postDelayed(runnable, animationSpeedMillseconds);*/
165
+ handler .postDelayed (runnable , animationSpeedMillseconds );
166
166
}
167
167
});
168
168
@@ -178,8 +178,7 @@ private class RefreshDashAndGapRunnable implements Runnable {
178
178
179
179
// We divide the animation up into 40 totalNumberOfSteps to make careful use of the finite space in
180
180
// LineAtlas
181
- private float totalNumberOfSteps
182
- = 40 ;
181
+ private float totalNumberOfSteps = 40 ;
183
182
184
183
// A # of totalNumberOfSteps proportional to the dashLength are devoted to manipulating the dash
185
184
private float dashSteps = totalNumberOfSteps * dashLength / (gapLength + dashLength );
@@ -196,10 +195,12 @@ private class RefreshDashAndGapRunnable implements Runnable {
196
195
@ Override
197
196
public void run () {
198
197
198
+ /*
199
199
if (gap >= totalNumberOfSteps) {
200
200
Log.d(TAG, "run: currentStep >= totalNumberOfSteps");
201
201
gap = 0;
202
202
}
203
+ */
203
204
204
205
Float [] newFloatArray = new Float [] {
205
206
0f , Float .valueOf (gap ++ / 10 % 4 ), 2f , 2f , 2f , 2f , 2f , 2f , 2f , 2f
0 commit comments