always scale to dip
This commit is contained in:
parent
4599e477b4
commit
2992ba647d
|
@ -142,7 +142,7 @@ public abstract class LocationActivity extends ActionBarActivity implements Loca
|
||||||
map.setTileSource(tileSource());
|
map.setTileSource(tileSource());
|
||||||
map.setBuiltInZoomControls(false);
|
map.setBuiltInZoomControls(false);
|
||||||
map.setMultiTouchControls(true);
|
map.setMultiTouchControls(true);
|
||||||
map.setTilesScaledToDpi(getPreferences().getBoolean("scale_tiles_for_high_dpi", false));
|
map.setTilesScaledToDpi(true);
|
||||||
mapController = map.getController();
|
mapController = map.getController();
|
||||||
mapController.setZoom(Config.Map.INITIAL_ZOOM_LEVEL);
|
mapController.setZoom(Config.Map.INITIAL_ZOOM_LEVEL);
|
||||||
mapController.setCenter(pos);
|
mapController.setCenter(pos);
|
||||||
|
@ -241,7 +241,7 @@ public abstract class LocationActivity extends ActionBarActivity implements Loca
|
||||||
updateLocationMarkers();
|
updateLocationMarkers();
|
||||||
updateUi();
|
updateUi();
|
||||||
map.setTileSource(tileSource());
|
map.setTileSource(tileSource());
|
||||||
map.setTilesScaledToDpi(getPreferences().getBoolean("scale_tiles_for_high_dpi", false));
|
map.setTilesScaledToDpi(true);
|
||||||
|
|
||||||
if (mapAtInitialLoc()) {
|
if (mapAtInitialLoc()) {
|
||||||
gotoLoc();
|
gotoLoc();
|
||||||
|
@ -286,8 +286,7 @@ public abstract class LocationActivity extends ActionBarActivity implements Loca
|
||||||
return PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
return PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.KITKAT)
|
protected boolean isLocationEnabled() {
|
||||||
private boolean isLocationEnabledKitkat() {
|
|
||||||
try {
|
try {
|
||||||
final int locationMode = Settings.Secure.getInt(getContentResolver(), Settings.Secure.LOCATION_MODE);
|
final int locationMode = Settings.Secure.getInt(getContentResolver(), Settings.Secure.LOCATION_MODE);
|
||||||
return locationMode != Settings.Secure.LOCATION_MODE_OFF;
|
return locationMode != Settings.Secure.LOCATION_MODE_OFF;
|
||||||
|
@ -295,19 +294,4 @@ public abstract class LocationActivity extends ActionBarActivity implements Loca
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private boolean isLocationEnabledLegacy() {
|
|
||||||
final String locationProviders = Settings.Secure.getString(getContentResolver(),
|
|
||||||
Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
|
|
||||||
return !TextUtils.isEmpty(locationProviders);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean isLocationEnabled() {
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
||||||
return isLocationEnabledKitkat();
|
|
||||||
} else {
|
|
||||||
return isLocationEnabledLegacy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue