OsmandApplication class is not anyhow related to activities, let's keep code organized

This commit is contained in:
Alexey Pelykh 2012-03-07 21:17:34 +02:00
parent 941df08c9a
commit 09daa404e2
41 changed files with 143 additions and 134 deletions

View file

@ -10,7 +10,7 @@
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="4"/>
<application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/OsmandTheme"
android:debuggable="true" android:name="net.osmand.plus.activities.OsmandApplication" android:description="@string/app_description"
android:debuggable="true" android:name="net.osmand.plus.OsmandApplication"
android:backupAgent="net.osmand.plus.OsmandBackupAgent" android:restoreAnyVersion="true">
<activity android:name="net.osmand.plus.activities.MainMenuActivity"
android:label="@string/app_name">

View file

@ -12,7 +12,6 @@ import net.osmand.ResultMatcher;
import net.osmand.data.Amenity;
import net.osmand.data.AmenityType;
import net.osmand.osm.MapUtils;
import net.osmand.plus.activities.OsmandApplication;
import net.sf.junidecode.Junidecode;
import org.apache.commons.logging.Log;

View file

@ -3,7 +3,6 @@ package net.osmand.plus;
import net.osmand.Version;
import net.osmand.plus.activities.LiveMonitoringHelper;
import net.osmand.plus.activities.OsmandApplication;
import net.osmand.plus.activities.SavingTrackHelper;
import net.osmand.plus.routing.RoutingHelper;
import android.app.AlarmManager;

View file

@ -1,6 +1,5 @@
package net.osmand.plus;
import net.osmand.plus.activities.OsmandApplication;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

View file

@ -1,4 +1,4 @@
package net.osmand.plus.activities;
package net.osmand.plus;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
@ -16,13 +16,10 @@ import net.osmand.GPXUtilities;
import net.osmand.LogUtil;
import net.osmand.GPXUtilities.GPXFile;
import net.osmand.GPXUtilities.WptPt;
import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.NavigationService;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.PoiFiltersHelper;
import net.osmand.plus.ProgressDialogImplementation;
import net.osmand.plus.R;
import net.osmand.plus.ResourceManager;
import net.osmand.plus.activities.DayNightHelper;
import net.osmand.plus.activities.SavingTrackHelper;
import net.osmand.plus.activities.SettingsActivity;
import net.osmand.plus.render.NativeOsmandLibrary;
import net.osmand.plus.render.RendererRegistry;
import net.osmand.plus.routing.RoutingHelper;
@ -30,6 +27,7 @@ import net.osmand.plus.voice.CommandPlayer;
import net.osmand.plus.voice.CommandPlayerException;
import net.osmand.plus.voice.CommandPlayerFactory;
import net.osmand.render.RenderingRulesStorage;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
@ -41,14 +39,13 @@ import android.content.Intent;
import android.content.res.Configuration;
import android.os.Handler;
import android.text.format.DateFormat;
import android.util.Log;
import android.widget.Toast;
public class OsmandApplication extends Application {
public static final String EXCEPTION_PATH = ResourceManager.APP_DIR + "exception.log"; //$NON-NLS-1$
private static final org.apache.commons.logging.Log LOG = LogUtil.getLog(OsmandApplication.class);
ResourceManager manager = null;
ResourceManager manager = null;
PoiFiltersHelper poiFilters = null;
RoutingHelper routingHelper = null;
FavouritesDbHelper favorites = null;
@ -57,63 +54,61 @@ public class OsmandApplication extends Application {
DayNightHelper daynightHelper;
NavigationService navigationService;
RendererRegistry rendererRegistry;
// start variables
private ProgressDialogImplementation startDialog;
private List<String> startingWarnings;
private Handler uiHandler;
private GPXFile gpxFileToDisplay;
private boolean applicationInitializing = false;
private Locale prefferedLocale = null;
@Override
public void onCreate(){
super.onCreate();
long timeToStart = System.currentTimeMillis();
osmandSettings = OsmandSettings.getOsmandSettings(this);
routingHelper = new RoutingHelper(osmandSettings, OsmandApplication.this, player);
manager = new ResourceManager(this);
daynightHelper = new DayNightHelper(this);
uiHandler = new Handler();
rendererRegistry = new RendererRegistry();
checkPrefferedLocale();
startApplication();
if(LOG.isDebugEnabled()){
LOG.debug("Time to start application " + (System.currentTimeMillis() - timeToStart) + " ms. Should be less < 800 ms");
}
@Override
public void onCreate() {
super.onCreate();
long timeToStart = System.currentTimeMillis();
osmandSettings = OsmandSettings.getOsmandSettings(this);
routingHelper = new RoutingHelper(osmandSettings, this, player);
manager = new ResourceManager(this);
daynightHelper = new DayNightHelper(this);
uiHandler = new Handler();
rendererRegistry = new RendererRegistry();
checkPrefferedLocale();
startApplication();
if (LOG.isDebugEnabled()) {
LOG.debug("Time to start application " + (System.currentTimeMillis() - timeToStart) + " ms. Should be less < 800 ms");
}
}
@Override
public void onTerminate() {
super.onTerminate();
if (routingHelper != null) {
routingHelper.getVoiceRouter().onApplicationTerminate(getApplicationContext());
}
}
public RendererRegistry getRendererRegistry() {
@Override
public void onTerminate() {
super.onTerminate();
if (routingHelper != null) {
routingHelper.getVoiceRouter().onApplicationTerminate(getApplicationContext());
}
}
public RendererRegistry getRendererRegistry() {
return rendererRegistry;
}
public OsmandSettings getSettings() {
public OsmandSettings getSettings() {
return osmandSettings;
}
public PoiFiltersHelper getPoiFilters() {
if(poiFilters == null){
poiFilters = new PoiFiltersHelper(this);
}
if (poiFilters == null) {
poiFilters = new PoiFiltersHelper(this);
}
return poiFilters;
}
public void setGpxFileToDisplay(GPXFile gpxFileToDisplay, boolean showCurrentGpxFile) {
this.gpxFileToDisplay = gpxFileToDisplay;
osmandSettings.SHOW_CURRENT_GPX_TRACK.set(showCurrentGpxFile);
if(gpxFileToDisplay == null){
if (gpxFileToDisplay == null) {
getFavorites().setFavoritePointsFromGPXFile(null);
} else {
List<FavouritePoint> pts = new ArrayList<FavouritePoint>();
@ -121,7 +116,7 @@ public class OsmandApplication extends Application {
FavouritePoint pt = new FavouritePoint();
pt.setLatitude(p.lat);
pt.setLongitude(p.lon);
if(p.name == null){
if (p.name == null) {
p.name = "";
}
pt.setName(p.name);
@ -130,32 +125,32 @@ public class OsmandApplication extends Application {
getFavorites().setFavoritePointsFromGPXFile(pts);
}
}
public GPXFile getGpxFileToDisplay() {
return gpxFileToDisplay;
}
public FavouritesDbHelper getFavorites() {
if(favorites == null) {
favorites = new FavouritesDbHelper(this);
}
public FavouritesDbHelper getFavorites() {
if (favorites == null) {
favorites = new FavouritesDbHelper(this);
}
return favorites;
}
public ResourceManager getResourceManager() {
public ResourceManager getResourceManager() {
return manager;
}
public DayNightHelper getDaynightHelper() {
public DayNightHelper getDaynightHelper() {
return daynightHelper;
}
@Override
public void onLowMemory() {
super.onLowMemory();
manager.onLowMemory();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
@ -165,32 +160,34 @@ public class OsmandApplication extends Application {
getBaseContext().getResources().updateConfiguration(newConfig, getBaseContext().getResources().getDisplayMetrics());
}
}
public void checkPrefferedLocale() {
Configuration config = getBaseContext().getResources().getConfiguration();
String lang = osmandSettings.PREFERRED_LOCALE.get();
Configuration config = getBaseContext().getResources().getConfiguration();
String lang = osmandSettings.PREFERRED_LOCALE.get();
if (!"".equals(lang) && !config.locale.getLanguage().equals(lang)) {
prefferedLocale = new Locale(lang);
Locale.setDefault(prefferedLocale);
config.locale = prefferedLocale;
getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());
}
}
public static final int PROGRESS_DIALOG = 5;
public static final int PROGRESS_DIALOG = 5;
/**
* @param activity that supports onCreateDialog({@link #PROGRESS_DIALOG}) and returns @param progressdialog
* @param progressDialog - it should be exactly the same as onCreateDialog
* @param activity
* that supports onCreateDialog({@link #PROGRESS_DIALOG}) and
* returns @param progressdialog
* @param progressDialog
* - it should be exactly the same as onCreateDialog
* @return
*/
public void checkApplicationIsBeingInitialized(Activity activity, ProgressDialog progressDialog){
public void checkApplicationIsBeingInitialized(Activity activity, ProgressDialog progressDialog) {
// start application if it was previously closed
startApplication();
synchronized (OsmandApplication.this) {
if(startDialog != null){
if (startDialog != null) {
progressDialog.setTitle(getString(R.string.loading_data));
progressDialog.setMessage(getString(R.string.reading_indexes));
activity.showDialog(PROGRESS_DIALOG);
@ -200,55 +197,59 @@ public class OsmandApplication extends Application {
}
}
}
public boolean isApplicationInitializing(){
public boolean isApplicationInitializing() {
return startDialog != null;
}
public RoutingHelper getRoutingHelper() {
return routingHelper;
}
public CommandPlayer getPlayer() {
return player;
}
public void showDialogInitializingCommandPlayer(final Activity uiContext){
public void showDialogInitializingCommandPlayer(final Activity uiContext) {
showDialogInitializingCommandPlayer(uiContext, true);
}
public void showDialogInitializingCommandPlayer(final Activity uiContext, boolean warningNoneProvider){
public void showDialogInitializingCommandPlayer(final Activity uiContext, boolean warningNoneProvider) {
showDialogInitializingCommandPlayer(uiContext, warningNoneProvider, null);
}
public void showDialogInitializingCommandPlayer(final Activity uiContext, boolean warningNoneProvider, Runnable run){
public void showDialogInitializingCommandPlayer(final Activity uiContext, boolean warningNoneProvider, Runnable run) {
String voiceProvider = osmandSettings.VOICE_PROVIDER.get();
if (voiceProvider == null || OsmandSettings.VOICE_PROVIDER_NOT_USE.equals(voiceProvider)) {
if (warningNoneProvider && voiceProvider == null) {
Builder builder = new AlertDialog.Builder(uiContext);
builder.setCancelable(true);
builder.setNegativeButton(R.string.default_buttons_cancel, null);
builder.setPositiveButton(R.string.default_buttons_ok, new DialogInterface.OnClickListener() {
builder.setPositiveButton(R.string.default_buttons_ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(uiContext, SettingsActivity.class);
intent.putExtra(SettingsActivity.INTENT_KEY_SETTINGS_SCREEN, SettingsActivity.SCREEN_NAVIGATION_SETTINGS);
uiContext.startActivity(intent);
}
});
@Override
public void onClick(DialogInterface dialog,
int which) {
Intent intent = new Intent(uiContext,
SettingsActivity.class);
intent.putExtra(
SettingsActivity.INTENT_KEY_SETTINGS_SCREEN,
SettingsActivity.SCREEN_NAVIGATION_SETTINGS);
uiContext.startActivity(intent);
}
});
builder.setTitle(R.string.voice_is_not_available_title);
builder.setMessage(R.string.voice_is_not_available_msg);
builder.show();
}
} else {
if(player == null
|| !Algoritms.objectEquals(voiceProvider, player.getCurrentVoice())){
if (player == null || !Algoritms.objectEquals(voiceProvider, player.getCurrentVoice())) {
initVoiceDataInDifferentThread(uiContext, voiceProvider, run);
}
}
}
private void initVoiceDataInDifferentThread(final Activity uiContext, final String voiceProvider, final Runnable run) {
@ -265,7 +266,7 @@ public class OsmandApplication extends Application {
player = CommandPlayerFactory.createCommandPlayer(voiceProvider, OsmandApplication.this, uiContext);
routingHelper.getVoiceRouter().setPlayer(player);
dlg.dismiss();
if(run != null && uiContext != null){
if (run != null && uiContext != null) {
uiContext.runOnUiThread(run);
}
} catch (CommandPlayerException e) {
@ -275,22 +276,21 @@ public class OsmandApplication extends Application {
}
}).start();
}
public NavigationService getNavigationService() {
return navigationService;
}
public void setNavigationService(NavigationService navigationService) {
this.navigationService = navigationService;
}
public synchronized void closeApplication(){
if(applicationInitializing){
public synchronized void closeApplication() {
if (applicationInitializing) {
manager.close();
}
applicationInitializing = false;
applicationInitializing = false;
}
public synchronized void startApplication() {
if (applicationInitializing) {
@ -310,7 +310,7 @@ public class OsmandApplication extends Application {
Thread.setDefaultUncaughtExceptionHandler(new DefaultExceptionHandler());
}
public String exportFavorites(File f) {
GPXFile gpx = new GPXFile();
for (FavouritePoint p : getFavorites().getFavouritePoints()) {
@ -324,7 +324,7 @@ public class OsmandApplication extends Application {
}
return GPXUtilities.writeGpxFile(f, gpx, this);
}
private void startApplicationBackground() {
List<String> warnings = null;
try {
@ -345,9 +345,10 @@ public class OsmandApplication extends Application {
warnings.addAll(helper.saveDataToGpx());
}
helper.close();
// restore backuped favorites to normal file
final File appDir = OsmandSettings.getOsmandSettings(this).extendOsmandPath(ResourceManager.APP_DIR);
final File appDir = OsmandSettings.getOsmandSettings(this)
.extendOsmandPath(ResourceManager.APP_DIR);
File save = new File(appDir, FavouritesDbHelper.FILE_TO_SAVE);
File bak = new File(appDir, FavouritesDbHelper.FILE_TO_BACKUP);
if (bak.exists() && (!save.exists() || bak.lastModified() > save.lastModified())) {
@ -382,13 +383,13 @@ public class OsmandApplication extends Application {
}
}
}
protected void showWarnings(List<String> warnings, final Context uiContext) {
if (warnings != null && !warnings.isEmpty()) {
final StringBuilder b = new StringBuilder();
boolean f = true;
for (String w : warnings) {
if(f){
if (f) {
f = false;
} else {
b.append('\n');
@ -407,7 +408,6 @@ public class OsmandApplication extends Application {
}
});
}
private class DefaultExceptionHandler implements UncaughtExceptionHandler {
@ -425,7 +425,8 @@ public class OsmandApplication extends Application {
PrintStream printStream = new PrintStream(out);
ex.printStackTrace(printStream);
StringBuilder msg = new StringBuilder();
msg.append("Exception occured in thread " + thread.toString() + " : "). //$NON-NLS-1$ //$NON-NLS-2$
msg.append(
"Exception occured in thread " + thread.toString() + " : "). //$NON-NLS-1$ //$NON-NLS-2$
append(DateFormat.format("MMMM dd, yyyy h:mm:ss", System.currentTimeMillis())).append("\n"). //$NON-NLS-1$//$NON-NLS-2$
append(new String(out.toByteArray()));
@ -437,11 +438,10 @@ public class OsmandApplication extends Application {
defaultHandler.uncaughtException(thread, ex);
} catch (Exception e) {
// swallow all exceptions
Log.e(LogUtil.TAG, "Exception while handle other exception", e); //$NON-NLS-1$
android.util.Log.e(LogUtil.TAG, "Exception while handle other exception", e); //$NON-NLS-1$
}
}
}
}

View file

@ -14,7 +14,6 @@ import net.osmand.map.TileSourceManager;
import net.osmand.map.TileSourceManager.TileSourceTemplate;
import net.osmand.osm.LatLon;
import net.osmand.plus.activities.ApplicationMode;
import net.osmand.plus.activities.OsmandApplication;
import net.osmand.plus.activities.search.SearchHistoryHelper;
import net.osmand.plus.render.RendererRegistry;
import net.osmand.plus.routing.RouteProvider.RouteService;

View file

@ -16,7 +16,6 @@ import net.osmand.data.Amenity;
import net.osmand.data.AmenityType;
import net.osmand.data.IndexConstants;
import net.osmand.osm.MapUtils;
import net.osmand.plus.activities.OsmandApplication;
public class PoiFilter {

View file

@ -9,7 +9,6 @@ import java.util.List;
import java.util.Map;
import net.osmand.data.AmenityType;
import net.osmand.plus.activities.OsmandApplication;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

View file

@ -36,7 +36,6 @@ import net.osmand.plus.AsyncLoadingThread.AmenityLoadRequest;
import net.osmand.plus.AsyncLoadingThread.MapLoadRequest;
import net.osmand.plus.AsyncLoadingThread.TileLoadDownloadRequest;
import net.osmand.plus.AsyncLoadingThread.TransportLoadRequest;
import net.osmand.plus.activities.OsmandApplication;
import net.osmand.plus.render.MapRenderRepositories;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
import net.osmand.render.RenderingRulesStorage;

View file

@ -9,7 +9,6 @@ import net.osmand.ResultMatcher;
import net.osmand.data.Amenity;
import net.osmand.data.AmenityType;
import net.osmand.osm.MapUtils;
import net.osmand.plus.activities.OsmandApplication;
public class SearchByNameFilter extends PoiFilter {

View file

@ -7,6 +7,7 @@ import java.util.TimeZone;
import net.osmand.LogUtil;
import net.osmand.SunriseSunset;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings.DayNightMode;
import org.apache.commons.logging.Log;

View file

@ -33,6 +33,7 @@ import net.osmand.plus.DownloadOsmandIndexesHelper.IndexItem;
import net.osmand.plus.IndexFileList;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.OsmandPreference;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.ProgressDialogImplementation;
import net.osmand.plus.R;
import net.osmand.plus.ResourceManager;

View file

@ -10,6 +10,7 @@ import net.osmand.data.MapTileDownloader.DownloadRequest;
import net.osmand.data.MapTileDownloader.IMapDownloaderCallback;
import net.osmand.map.ITileSource;
import net.osmand.osm.MapUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.ResourceManager;
import net.osmand.plus.views.BaseMapLayer;

View file

@ -11,6 +11,7 @@ import net.osmand.OsmAndFormatter;
import net.osmand.data.AmenityType;
import net.osmand.osm.LatLon;
import net.osmand.osm.MapRenderingTypes;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.PoiFilter;
import net.osmand.plus.PoiFiltersHelper;

View file

@ -21,6 +21,7 @@ import net.osmand.osm.OpeningHoursParser;
import net.osmand.osm.OpeningHoursParser.BasicDayOpeningHourRule;
import net.osmand.osm.OpeningHoursParser.OpeningHoursRule;
import net.osmand.plus.AmenityIndexRepositoryOdb;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import android.app.AlertDialog;

View file

@ -22,6 +22,7 @@ import net.osmand.OsmAndFormatter;
import net.osmand.osm.LatLon;
import net.osmand.osm.MapUtils;
import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.ResourceManager;

View file

@ -12,6 +12,7 @@ import net.osmand.FavouritePoint;
import net.osmand.OsmAndFormatter;
import net.osmand.osm.LatLon;
import net.osmand.osm.MapUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.search.SearchActivity;

View file

@ -30,6 +30,7 @@ import net.osmand.data.IndexConstants;
import net.osmand.map.TileSourceManager;
import net.osmand.map.TileSourceManager.TileSourceTemplate;
import net.osmand.osm.MapUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.ResourceManager;

View file

@ -15,6 +15,7 @@ import java.util.Set;
import net.osmand.Algoritms;
import net.osmand.GPXUtilities.WptPt;
import net.osmand.IProgress;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.ResourceManager;

View file

@ -13,6 +13,7 @@ import net.osmand.OpenstreetmapUtil;
import net.osmand.osm.EntityInfo;
import net.osmand.plus.AmenityIndexRepositoryOdb;
import net.osmand.plus.OpenstreetmapsDbHelper;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.ProgressDialogImplementation;
import net.osmand.plus.R;

View file

@ -7,6 +7,7 @@ import java.util.Random;
import com.google.android.apps.analytics.easytracking.TrackedActivity;
import net.osmand.Version;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.ResourceManager;

View file

@ -18,6 +18,7 @@ import net.osmand.map.IMapLocationListener;
import net.osmand.osm.LatLon;
import net.osmand.plus.BusyIndicator;
import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.ResourceManager;

View file

@ -19,6 +19,7 @@ import net.osmand.osm.LatLon;
import net.osmand.osm.MapUtils;
import net.osmand.plus.AmenityIndexRepositoryOdb;
import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.ResourceManager;

View file

@ -23,6 +23,7 @@ import net.osmand.map.ITileSource;
import net.osmand.map.TileSourceManager.TileSourceTemplate;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.CommonPreference;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.PoiFilter;
import net.osmand.plus.PoiFiltersHelper;
import net.osmand.plus.R;

View file

@ -20,6 +20,7 @@ import net.osmand.plus.OsmandSettings.CommonPreference;
import net.osmand.plus.OsmandSettings.DayNightMode;
import net.osmand.plus.OsmandSettings.MetricsConstants;
import net.osmand.plus.OsmandSettings.OsmandPreference;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.ProgressDialogImplementation;
import net.osmand.plus.R;
import net.osmand.plus.ResourceManager;

View file

@ -6,6 +6,7 @@ package net.osmand.plus.activities;
import java.util.List;
import net.osmand.OsmAndFormatter;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.routing.RoutingHelper;

View file

@ -3,6 +3,7 @@
*/
package net.osmand.plus.activities;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.voice.AbstractPrologCommandPlayer;
import net.osmand.plus.voice.CommandBuilder;
import net.osmand.plus.voice.CommandPlayer;

View file

@ -18,12 +18,12 @@ import net.osmand.data.Street;
import net.osmand.osm.LatLon;
import net.osmand.osm.MapUtils;
import net.osmand.osm.Node;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.RegionAddressRepository;
import net.osmand.plus.ResourceManager;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.OsmandApplication;
import net.osmand.plus.activities.OsmandListActivity;
import android.app.Dialog;
import android.app.ProgressDialog;

View file

@ -5,11 +5,11 @@ import java.text.MessageFormat;
import net.osmand.Algoritms;
import net.osmand.osm.LatLon;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.RegionAddressRepository;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.OsmandApplication;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

View file

@ -7,9 +7,9 @@ import net.osmand.data.Building;
import net.osmand.data.City;
import net.osmand.data.PostCode;
import net.osmand.data.Street;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.RegionAddressRepository;
import net.osmand.plus.activities.OsmandApplication;
import android.os.AsyncTask;
import android.view.View;
import android.widget.TextView;

View file

@ -9,9 +9,9 @@ import net.osmand.data.MapObject;
import net.osmand.data.PostCode;
import net.osmand.osm.LatLon;
import net.osmand.osm.MapUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.RegionAddressRepository;
import net.osmand.plus.activities.OsmandApplication;
import android.os.AsyncTask;
import android.os.Message;
import android.view.View;

View file

@ -25,6 +25,7 @@ import net.osmand.osm.LatLon;
import net.osmand.osm.OpeningHoursParser;
import net.osmand.osm.OpeningHoursParser.OpeningHoursRule;
import net.osmand.plus.NameFinderPoiFilter;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.PoiFilter;
import net.osmand.plus.R;
@ -32,7 +33,6 @@ import net.osmand.plus.SearchByNameFilter;
import net.osmand.plus.activities.CustomTitleBar;
import net.osmand.plus.activities.EditPOIFilterActivity;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.OsmandApplication;
import net.osmand.plus.activities.OsmandListActivity;
import android.app.AlertDialog;
import android.content.DialogInterface;

View file

@ -8,6 +8,7 @@ import java.util.List;
import net.osmand.osm.LatLon;
import net.osmand.plus.NameFinderPoiFilter;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.PoiFilter;
import net.osmand.plus.PoiFiltersHelper;
@ -15,7 +16,6 @@ import net.osmand.plus.R;
import net.osmand.plus.ResourceManager;
import net.osmand.plus.SearchByNameFilter;
import net.osmand.plus.activities.EditPOIFilterActivity;
import net.osmand.plus.activities.OsmandApplication;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;

View file

@ -2,10 +2,10 @@ package net.osmand.plus.activities.search;
import java.util.ArrayList;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.RegionAddressRepository;
import net.osmand.plus.activities.OsmandApplication;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

View file

@ -5,9 +5,9 @@ import java.util.List;
import net.osmand.data.City;
import net.osmand.data.PostCode;
import net.osmand.data.Street;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.RegionAddressRepository;
import net.osmand.plus.activities.OsmandApplication;
import android.os.AsyncTask;
import android.view.View;
import android.widget.TextView;

View file

@ -10,9 +10,9 @@ import net.osmand.CollatorStringMatcher.StringMatcherMode;
import net.osmand.data.City;
import net.osmand.data.PostCode;
import net.osmand.data.Street;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.RegionAddressRepository;
import net.osmand.plus.activities.OsmandApplication;
import android.os.AsyncTask;
import android.os.Message;
import android.view.View;

View file

@ -15,11 +15,11 @@ import net.osmand.data.TransportRoute;
import net.osmand.data.TransportStop;
import net.osmand.osm.LatLon;
import net.osmand.osm.MapUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.TransportIndexRepository;
import net.osmand.plus.TransportIndexRepository.RouteInfoLocation;
import net.osmand.plus.activities.OsmandApplication;
import net.osmand.plus.activities.TransportRouteHelper;
import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild;
import android.app.AlertDialog;

View file

@ -34,9 +34,9 @@ import net.osmand.osm.MapUtils;
import net.osmand.osm.MultyPolygon;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.CommonPreference;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.RotatedTileBox;
import net.osmand.plus.activities.OsmandApplication;
import net.osmand.plus.render.NativeOsmandLibrary.NativeSearchResult;
import net.osmand.plus.render.OsmandRenderer.RenderingContext;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;

View file

@ -28,9 +28,9 @@ import net.osmand.OsmAndFormatter;
import net.osmand.binary.BinaryMapIndexReader;
import net.osmand.osm.LatLon;
import net.osmand.osm.MapUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.ApplicationMode;
import net.osmand.plus.activities.OsmandApplication;
import net.osmand.plus.routing.RoutingHelper.RouteDirectionInfo;
import net.osmand.plus.routing.RoutingHelper.TurnType;
import net.osmand.router.BicycleRouter;

View file

@ -12,8 +12,8 @@ import net.osmand.data.MapTileDownloader.IMapDownloaderCallback;
import net.osmand.map.IMapLocationListener;
import net.osmand.osm.LatLon;
import net.osmand.osm.MapUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.activities.OsmandApplication;
import net.osmand.plus.views.MultiTouchSupport.MultiTouchZoomListener;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;

View file

@ -2,10 +2,10 @@ package net.osmand.plus.voice;
import java.io.File;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.ResourceManager;
import net.osmand.plus.activities.OsmandApplication;
import android.app.Activity;
import android.os.Build;