From 8c49de0d6f61c4ed29072733b8e5878dd6056eac Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 18 Nov 2015 11:46:42 +0100 Subject: [PATCH] Fix categories --- OsmAnd/src/net/osmand/plus/AppInitializer.java | 9 +++++---- .../dialogs/PoiSubTypeDialogFragment.java | 17 ++++++++--------- .../osmedit/dialogs/PoiTypeDialogFragment.java | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index 43de027966..b51db8c71a 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -55,7 +55,8 @@ import btools.routingapp.BRouterServiceConnection; */ public class AppInitializer implements IProgress { // 22 - 2.2 - private static final int CURRENT_VERSION_FOR_UGPRADE = 22; + private static final int VERSION_2_2 = 22; + private static final int CURRENT_VERSION_FOR_UGPRADE = VERSION_2_2; public static final boolean TIPS_AND_TRICKS = false; @@ -132,13 +133,13 @@ public class AppInitializer implements IProgress { firstTime = true; startPrefs.edit().putBoolean(FIRST_TIME_APP_RUN, true).commit(); startPrefs.edit().putString(VERSION_INSTALLED, Version.getFullVersion(app)).commit(); - startPrefs.edit().putInt(VERSION_INSTALLED_NUMBER, CURRENT_VERSION_FOR_UGPRADE).commit(); + startPrefs.edit().putInt(VERSION_INSTALLED_NUMBER, VERSION_2_2).commit(); } else if (!Version.getFullVersion(app).equals(startPrefs.getString(VERSION_INSTALLED, ""))) { - if(startPrefs.getInt(VERSION_INSTALLED_NUMBER, 0) < 22) { + if(startPrefs.getInt(VERSION_INSTALLED_NUMBER, 0) < VERSION_2_2) { app.getSettings().SHOW_DASHBOARD_ON_START.set(true); app.getSettings().SHOW_DASHBOARD_ON_MAP_SCREEN.set(true); app.getSettings().SHOW_CARD_TO_CHOOSE_DRAWER.set(true); - startPrefs.edit().putInt(VERSION_INSTALLED_NUMBER, CURRENT_VERSION_FOR_UGPRADE).commit(); + startPrefs.edit().putInt(VERSION_INSTALLED_NUMBER, VERSION_2_2).commit(); } startPrefs.edit().putString(VERSION_INSTALLED, Version.getFullVersion(app)).commit(); appVersionChanged = true; diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java index f2e9d8216a..1b4cd7495d 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java @@ -1,20 +1,19 @@ package net.osmand.plus.osmedit.dialogs; +import java.util.Map; +import java.util.Set; + +import net.osmand.osm.MapPoiTypes; +import net.osmand.osm.PoiCategory; +import net.osmand.osm.PoiType; +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.osmedit.EditPoiDialogFragment; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.DialogFragment; import android.support.v7.app.AlertDialog; -import net.osmand.data.Amenity; -import net.osmand.osm.MapPoiTypes; -import net.osmand.osm.PoiCategory; -import net.osmand.osm.PoiType; -import net.osmand.plus.OsmandApplication; -import net.osmand.plus.osmedit.EditPoiDialogFragment; - -import java.util.Map; -import java.util.Set; public class PoiSubTypeDialogFragment extends DialogFragment { private static final String KEY_POI_CATEGORY = "amenity"; diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java index 5fc7c685a8..e830efcd3e 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java @@ -27,7 +27,7 @@ public class PoiTypeDialogFragment extends DialogFragment { ArrayList vals = new ArrayList<>(categories.size()); ArrayList toDelete = new ArrayList<>(); for (PoiCategory category : categories) { - if (!category.isNotEditableOsm()) { + if (category.isNotEditableOsm()) { toDelete.add(category); } else { vals.add(category.getTranslation());