Fix categories

This commit is contained in:
Victor Shcherb 2015-11-18 11:46:42 +01:00
parent 73f1b6aca0
commit 8c49de0d6f
3 changed files with 14 additions and 14 deletions

View file

@ -55,7 +55,8 @@ import btools.routingapp.BRouterServiceConnection;
*/ */
public class AppInitializer implements IProgress { public class AppInitializer implements IProgress {
// 22 - 2.2 // 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; public static final boolean TIPS_AND_TRICKS = false;
@ -132,13 +133,13 @@ public class AppInitializer implements IProgress {
firstTime = true; firstTime = true;
startPrefs.edit().putBoolean(FIRST_TIME_APP_RUN, true).commit(); startPrefs.edit().putBoolean(FIRST_TIME_APP_RUN, true).commit();
startPrefs.edit().putString(VERSION_INSTALLED, Version.getFullVersion(app)).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, ""))) { } 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_START.set(true);
app.getSettings().SHOW_DASHBOARD_ON_MAP_SCREEN.set(true); app.getSettings().SHOW_DASHBOARD_ON_MAP_SCREEN.set(true);
app.getSettings().SHOW_CARD_TO_CHOOSE_DRAWER.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(); startPrefs.edit().putString(VERSION_INSTALLED, Version.getFullVersion(app)).commit();
appVersionChanged = true; appVersionChanged = true;

View file

@ -1,20 +1,19 @@
package net.osmand.plus.osmedit.dialogs; 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.app.Dialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment; import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog; 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 { public class PoiSubTypeDialogFragment extends DialogFragment {
private static final String KEY_POI_CATEGORY = "amenity"; private static final String KEY_POI_CATEGORY = "amenity";

View file

@ -27,7 +27,7 @@ public class PoiTypeDialogFragment extends DialogFragment {
ArrayList<String> vals = new ArrayList<>(categories.size()); ArrayList<String> vals = new ArrayList<>(categories.size());
ArrayList<PoiCategory> toDelete = new ArrayList<>(); ArrayList<PoiCategory> toDelete = new ArrayList<>();
for (PoiCategory category : categories) { for (PoiCategory category : categories) {
if (!category.isNotEditableOsm()) { if (category.isNotEditableOsm()) {
toDelete.add(category); toDelete.add(category);
} else { } else {
vals.add(category.getTranslation()); vals.add(category.getTranslation());