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

Commit

Permalink
some line movement
Browse files Browse the repository at this point in the history
  • Loading branch information
langsmith committed Aug 1, 2018
1 parent 3cceaea commit d25e016
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class AnimatedDashLineActivity extends AppCompatActivity implements OnMap
private MapboxMap mapboxMap;
private Handler handler;
private String tag = "AnimatedDashLine";
private RefreshDashAndGapRunnable refreshDashAndGapRunnable;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -49,6 +50,7 @@ protected void onCreate(Bundle savedInstanceState) {
// This contains the MapView in XML and needs to be called after the access token is configured.
setContentView(R.layout.activity_animated_dash_line);

handler = new Handler();
mapView = findViewById(R.id.mapView);
mapView.onCreate(savedInstanceState);
mapView.getMapAsync(this);
Expand Down Expand Up @@ -76,7 +78,7 @@ private void initBikePathLayer() {
);
mapboxMap.addLayer(animatedDashBikeLineLayer);
Log.d(tag, "initBikePathLayer: here");
Runnable runnable = new RefreshDashAndGapRunnable(this.mapboxMap, new Handler());
Runnable runnable = new RefreshDashAndGapRunnable(this.mapboxMap, handler);
Log.d(tag, "initBikePathLayer: runnable made");
handler.postDelayed(runnable, 25);
Log.d(tag, "initBikePathLayer: postDelayed");
Expand Down Expand Up @@ -113,7 +115,6 @@ private static class RefreshDashAndGapRunnable implements Runnable {
this.handler = handler;
Log.d(TAG, "RefreshDashAndGapRunnable: finished");

mapboxMap.getProjection().getProjectedMetersForLatLng()
}

@Override
Expand Down Expand Up @@ -180,6 +181,9 @@ public void onLowMemory() {
protected void onDestroy() {
super.onDestroy();
mapView.onDestroy();
handler.removeCallbacks(refreshDashAndGapRunnable);
refreshDashAndGapRunnable = null;
handler = null;
}

@Override
Expand Down

0 comments on commit d25e016

Please sign in to comment.