Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
d
Browse files Browse the repository at this point in the history
  • Loading branch information
langsmith committed Jun 4, 2019
1 parent 54b25ee commit 59c9ea7
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class AnimatedDashLineActivity extends AppCompatActivity implements OnMap
private String TAG = "AnimatedDashLine";
private Layer animatedLineLayer;
private RefreshDashAndGapRunnable refreshDashAndGapRunnable;
private int animationSpeedMillseconds = 100;
private int animationSpeedMillseconds = 50;
private ValueAnimator animator;

@Override
Expand Down Expand Up @@ -159,10 +159,10 @@ public void onStyleLoaded(@NonNull Style style) {
style.addLayerBelow(antsTrafficLayer, "bridge-oneway-arrows-blue-major");


/* animatedLineLayer = mapboxMap.getStyle().getLayer(ANIMATE_LINE_LAYER_ID);
animatedLineLayer = mapboxMap.getStyle().getLayer(ANIMATE_LINE_LAYER_ID);

Runnable runnable = new RefreshDashAndGapRunnable();
handler.postDelayed(runnable, animationSpeedMillseconds);*/
handler.postDelayed(runnable, animationSpeedMillseconds);
}
});

Expand All @@ -178,8 +178,7 @@ private class RefreshDashAndGapRunnable implements Runnable {

// We divide the animation up into 40 totalNumberOfSteps to make careful use of the finite space in
// LineAtlas
private float totalNumberOfSteps
= 40;
private float totalNumberOfSteps = 40;

// A # of totalNumberOfSteps proportional to the dashLength are devoted to manipulating the dash
private float dashSteps = totalNumberOfSteps * dashLength / (gapLength + dashLength);
Expand All @@ -196,10 +195,12 @@ private class RefreshDashAndGapRunnable implements Runnable {
@Override
public void run() {

/*
if (gap >= totalNumberOfSteps) {
Log.d(TAG, "run: currentStep >= totalNumberOfSteps");
gap = 0;
}
*/

Float[] newFloatArray = new Float[] {
0f, Float.valueOf(gap++ / 10 % 4), 2f, 2f, 2f, 2f, 2f, 2f, 2f, 2f
Expand Down

0 comments on commit 59c9ea7

Please sign in to comment.