diff --git a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java index 732129ce0c..3b406007f5 100644 --- a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java @@ -43,7 +43,6 @@ public class FavouritesDbHelper { public static final String BACKUP_FOLDER = "backup"; //$NON-NLS-1$ public static final int BACKUP_CNT = 20; //$NON-NLS-1$ public static final String FILE_TO_BACKUP = "favourites_bak.gpx"; //$NON-NLS-1$ - public static final String FAVOURITES = "favourites"; //$NON-NLS-1$ private List cachedFavoritePoints = new ArrayList(); private List favoriteGroups = new ArrayList(); diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java index 35ea32021e..63ea2de8a2 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java @@ -16,7 +16,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; -import android.widget.LinearLayout; import android.widget.TextView; import net.osmand.AndroidUtils; @@ -55,6 +54,8 @@ public class AddPointBottomSheetDialog extends MenuBottomSheetDialogFragment { public static final int ADD_FAVOURITE_TO_ROUTE_REQUEST_CODE = 1; + public static final String FAVOURITES = "favourites"; + private PointType pointType = PointType.START; @Override @@ -350,7 +351,7 @@ public class AddPointBottomSheetDialog extends MenuBottomSheetDialogFragment { } private void addMainScrollItems(List items) { - items.add(FavouritesDbHelper.FAVOURITES); + items.add(FAVOURITES); items.add(PointType.HOME); items.add(PointType.WORK); } @@ -396,7 +397,7 @@ public class AddPointBottomSheetDialog extends MenuBottomSheetDialogFragment { return; } Object item = items.get(position); - if (item.equals(FavouritesDbHelper.FAVOURITES)) { + if (item.equals(FAVOURITES)) { openFavouritesDialog(); } else { TargetPointsHelper helper = mapActivity.getMyApplication().getTargetPointsHelper(); @@ -440,7 +441,7 @@ public class AddPointBottomSheetDialog extends MenuBottomSheetDialogFragment { if (item == PointType.HOME) { point = helper.getHomePoint(); } else if (item == PointType.WORK) { - point = helper.getHomePoint(); + point = helper.getWorkPoint(); } if (point != null) { ll = new LatLon(point.getLatitude(), point.getLongitude()); @@ -522,7 +523,7 @@ public class AddPointBottomSheetDialog extends MenuBottomSheetDialogFragment { if (holder instanceof FavouritesViewHolder) { Object item = getItem(position); FavouritesViewHolder favouritesViewHolder = (FavouritesViewHolder) holder; - if (item.equals(FavouritesDbHelper.FAVOURITES)) { + if (item.equals(FAVOURITES)) { favouritesViewHolder.title.setText(R.string.shared_string_favorites); favouritesViewHolder.icon.setImageDrawable(getContentIcon(R.drawable.ic_action_fav_dark)); favouritesViewHolder.description.setVisibility(View.GONE);