diff options
| author | Keith Packard <keithp@keithp.com> | 2015-06-25 12:22:04 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2015-06-25 12:22:04 -0700 | 
| commit | 06908e377b7b932bfe3f6dfc840a0a13340f32ce (patch) | |
| tree | 56087991eaf9e6393304f06bdfd524d44a727db6 | |
| parent | 71d924288d45b09ae655d06df9780ba286e3f3be (diff) | |
altosdroid: Class of offline map view widget changed
Switch around AltosViewPager to match.
Signed-off-by: Keith Packard <keithp@keithp.com>
4 files changed, 21 insertions, 13 deletions
| diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java index 339b7894..5240d61c 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java @@ -424,7 +424,7 @@ public class AltosMapOffline extends View implements ScaleGestureDetector.OnScal  	double	mapAccuracy;  	public void center(double lat, double lon, double accuracy) { -		if (mapAccuracy < 0 || accuracy < mapAccuracy/10) { +		if (mapAccuracy <= 0 || accuracy < mapAccuracy/10 || (map != null && !map.has_centre())) {  			if (map != null)  				map.maybe_centre(lat, lon);  			mapAccuracy = accuracy; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java index b81cd394..7691a13e 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java @@ -275,7 +275,7 @@ public class AltosMapOnline implements AltosDroidMapInterface, GoogleMap.OnMarke  			center (my_position.lat, my_position.lon, accuracy);  		} -		if (my_position != null && target_position != null) { +		if (my_position != null && target_position != null && mPolyline != null) {  			mPolyline.setPoints(Arrays.asList(new LatLng(my_position.lat, my_position.lon), new LatLng(target_position.lat, target_position.lon)));  			mPolyline.setVisible(true);  		} diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosViewPager.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosViewPager.java index e8299b09..f22298d7 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosViewPager.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosViewPager.java @@ -34,17 +34,19 @@ public class AltosViewPager extends ViewPager {      @Override      protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) { -	if (v.getClass().getName().endsWith("MapView")) -	    return true; - -	if(v.getClass() != null && -	   v.getClass().getPackage() != null && -	   v.getClass().getPackage().getName() != null && -	   v.getClass().getPackage().getName().startsWith("maps.")) -	{ -            return true; -        } -        return super.canScroll(v, checkV, dx, x, y); + +	    if (v.getClass() != null && +		v.getClass().getName() != null && +		v.getClass().getName().endsWith("MapOffline")) +		    return true; + +	    if(v.getClass() != null && +	       v.getClass().getPackage() != null && +	       v.getClass().getPackage().getName() != null && +	       v.getClass().getPackage().getName().startsWith("maps.")) +		    return true; + +	    return super.canScroll(v, checkV, dx, x, y);      }  } diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java index 2d0ae65d..58bf8804 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java @@ -441,6 +441,12 @@ public class TelemetryService extends Service implements LocationListener {  	@Override  	public void onCreate() { + +		AltosDebug.init(this); + +		// Initialise preferences +		AltosDroidPreferences.init(this); +  		// Get local Bluetooth adapter  		bluetooth_adapter = BluetoothAdapter.getDefaultAdapter(); | 
