mirror of
https://gitlab.com/oeffi/oeffi.git
synced 2025-07-08 15:18:47 +00:00
StationsActivity: Reduce number of map movements/zooms on activity launch.
This commit is contained in:
parent
010c955a36
commit
80aa03811b
1 changed files with 9 additions and 6 deletions
|
@ -575,6 +575,8 @@ public class StationsActivity extends OeffiMainActivity implements StationsAware
|
||||||
|
|
||||||
stationList.clearOnScrollListeners();
|
stationList.clearOnScrollListeners();
|
||||||
|
|
||||||
|
handler.removeCallbacksAndMessages(null);
|
||||||
|
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1027,8 +1029,13 @@ public class StationsActivity extends OeffiMainActivity implements StationsAware
|
||||||
mapView.invalidate();
|
mapView.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (added)
|
if (added) {
|
||||||
|
handler.postDelayed(new Runnable() {
|
||||||
|
public void run() {
|
||||||
mapView.zoomToStations(stations);
|
mapView.zoomToStations(stations);
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
|
||||||
updateGUI();
|
updateGUI();
|
||||||
}
|
}
|
||||||
|
@ -1482,10 +1489,6 @@ public class StationsActivity extends OeffiMainActivity implements StationsAware
|
||||||
|
|
||||||
final double hereLat = here.getLatitude();
|
final double hereLat = here.getLatitude();
|
||||||
final double hereLon = here.getLongitude();
|
final double hereLon = here.getLongitude();
|
||||||
|
|
||||||
if (deviceLocation == null && fixedLocation == null)
|
|
||||||
mapView.animateToLocation(hereLat, hereLon);
|
|
||||||
|
|
||||||
deviceLocation = Point.fromDouble(hereLat, hereLon);
|
deviceLocation = Point.fromDouble(hereLat, hereLon);
|
||||||
|
|
||||||
stationListAdapter.setDeviceLocation(here);
|
stationListAdapter.setDeviceLocation(here);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue