Merge branch 'master' of github.com:osmandapp/Osmand
This commit is contained in:
commit
c771e1c4fd
3 changed files with 6 additions and 8 deletions
|
@ -13,7 +13,7 @@ import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.util.Log;
|
|
||||||
import net.osmand.IProgress;
|
import net.osmand.IProgress;
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
import net.osmand.PlatformUtil;
|
import net.osmand.PlatformUtil;
|
||||||
|
@ -66,6 +66,7 @@ import java.util.Locale;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import btools.routingapp.BRouterServiceConnection;
|
import btools.routingapp.BRouterServiceConnection;
|
||||||
|
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.getPendingIntent;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.getPendingIntent;
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLastCheck;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLastCheck;
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLiveUpdatesOn;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLiveUpdatesOn;
|
||||||
|
@ -446,6 +447,9 @@ public class AppInitializer implements IProgress {
|
||||||
app.mapMarkersHelper = startupInit(new MapMarkersHelper(app), MapMarkersHelper.class);
|
app.mapMarkersHelper = startupInit(new MapMarkersHelper(app), MapMarkersHelper.class);
|
||||||
app.searchUICore = startupInit(new QuickSearchHelper(app), QuickSearchHelper.class);
|
app.searchUICore = startupInit(new QuickSearchHelper(app), QuickSearchHelper.class);
|
||||||
app.travelDbHelper = startupInit(new TravelDbHelper(app), TravelDbHelper.class);
|
app.travelDbHelper = startupInit(new TravelDbHelper(app), TravelDbHelper.class);
|
||||||
|
if (app.getSettings().SELECTED_TRAVEL_BOOK.get() != null) {
|
||||||
|
app.travelDbHelper.initTravelBooks();
|
||||||
|
}
|
||||||
|
|
||||||
initOpeningHoursParser();
|
initOpeningHoursParser();
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,6 @@ import net.osmand.plus.views.MapControlsLayer;
|
||||||
import net.osmand.plus.views.MapTileLayer;
|
import net.osmand.plus.views.MapTileLayer;
|
||||||
import net.osmand.plus.views.OsmandMapTileView;
|
import net.osmand.plus.views.OsmandMapTileView;
|
||||||
import net.osmand.plus.wikivoyage.explore.WikivoyageExploreDialogFragment;
|
import net.osmand.plus.wikivoyage.explore.WikivoyageExploreDialogFragment;
|
||||||
import net.osmand.plus.wikivoyage.data.TravelDbHelper;
|
|
||||||
import net.osmand.router.GeneralRouter;
|
import net.osmand.router.GeneralRouter;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
@ -771,7 +770,6 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setListener(new ItemClickListener() {
|
.setListener(new ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
getMyApplication().getTravelDbHelper().initTravelBooks();
|
|
||||||
MapActivity.clearPrevActivityIntent();
|
MapActivity.clearPrevActivityIntent();
|
||||||
WikivoyageExploreDialogFragment.showInstance(mapActivity.getSupportFragmentManager());
|
WikivoyageExploreDialogFragment.showInstance(mapActivity.getSupportFragmentManager());
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -82,13 +82,10 @@ public class TravelDbHelper {
|
||||||
public TravelDbHelper(OsmandApplication application) {
|
public TravelDbHelper(OsmandApplication application) {
|
||||||
this.application = application;
|
this.application = application;
|
||||||
collator = OsmAndCollator.primaryCollator();
|
collator = OsmAndCollator.primaryCollator();
|
||||||
if (application.getSettings().SELECTED_TRAVEL_BOOK.get() != null) {
|
localDataHelper = new TravelLocalDataHelper(application);
|
||||||
initTravelBooks();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TravelLocalDataHelper getLocalDataHelper() {
|
public TravelLocalDataHelper getLocalDataHelper() {
|
||||||
initTravelBooks();
|
|
||||||
return localDataHelper;
|
return localDataHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +97,6 @@ public class TravelDbHelper {
|
||||||
File[] possibleFiles = application.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR).listFiles();
|
File[] possibleFiles = application.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR).listFiles();
|
||||||
String travelBook = application.getSettings().SELECTED_TRAVEL_BOOK.get();
|
String travelBook = application.getSettings().SELECTED_TRAVEL_BOOK.get();
|
||||||
existingTravelBooks.clear();
|
existingTravelBooks.clear();
|
||||||
localDataHelper = new TravelLocalDataHelper(application);
|
|
||||||
if (possibleFiles != null) {
|
if (possibleFiles != null) {
|
||||||
for (File f : possibleFiles) {
|
for (File f : possibleFiles) {
|
||||||
if (f.getName().endsWith(IndexConstants.BINARY_WIKIVOYAGE_MAP_INDEX_EXT)) {
|
if (f.getName().endsWith(IndexConstants.BINARY_WIKIVOYAGE_MAP_INDEX_EXT)) {
|
||||||
|
|
Loading…
Reference in a new issue