altoslib: Fix map preloading callbacks, run in separate thread
authorKeith Packard <keithp@keithp.com>
Thu, 5 May 2016 09:25:52 +0000 (02:25 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 5 May 2016 09:25:52 +0000 (02:25 -0700)
commite0081f7ba6fc9f1e4484d3e291fd30065ad5b620
treefabb5b36eb80705e75b83a8ef148e27e9e7fdd8d
parent13179f614a99cad3016832ac1b365eaa4208c10f
altoslib: Fix map preloading callbacks, run in separate thread

The map storage and tile callbacks were muddled together. Create
clearly separate states for map data and have status updates be
delivered when registering for new status events so that registration
is sufficient to track the state without an explicit call to get the
current state.

Run the map tile creation in a separate thread so that even checking
status of files on disk runs out of the UI thread.

These fixes serve to make the pacifier update more smoothly, and also
not over/under count tile loading so that the loading actually
completes when all of the tiles are loaded.

Signed-off-by: Keith Packard <keithp@keithp.com>
altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java
altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java
altoslib/AltosMap.java
altoslib/AltosMapCache.java
altoslib/AltosMapInterface.java
altoslib/AltosMapLoader.java
altoslib/AltosMapStore.java
altoslib/AltosMapTile.java
altoslib/AltosMapTileListener.java
altosuilib/AltosUIMapNew.java
altosuilib/AltosUIMapPreloadNew.java