Adding markers from favorites instead of waypoints
This commit is contained in:
parent
0d651ca2d5
commit
0739a11bef
3 changed files with 78 additions and 82 deletions
|
@ -9,6 +9,7 @@
|
||||||
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
|
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
|
||||||
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
||||||
-->
|
-->
|
||||||
|
<string name="select_map_markers">Select Map Markers</string>
|
||||||
<string name="shared_string_reverse_order">Reverse order</string>
|
<string name="shared_string_reverse_order">Reverse order</string>
|
||||||
<string name="show_map_markers">Map Markers</string>
|
<string name="show_map_markers">Map Markers</string>
|
||||||
<string name="show_map_markers_description">Activate Map Markers feature</string>
|
<string name="show_map_markers_description">Activate Map Markers feature</string>
|
||||||
|
|
|
@ -12,7 +12,6 @@ import android.net.Uri;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.support.v4.app.FragmentActivity;
|
|
||||||
import android.support.v4.view.MenuItemCompat;
|
import android.support.v4.view.MenuItemCompat;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.view.ActionMode;
|
import android.support.v7.view.ActionMode;
|
||||||
|
@ -44,6 +43,7 @@ import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
|
||||||
import net.osmand.plus.GPXUtilities;
|
import net.osmand.plus.GPXUtilities;
|
||||||
import net.osmand.plus.GPXUtilities.GPXFile;
|
import net.osmand.plus.GPXUtilities.GPXFile;
|
||||||
import net.osmand.plus.IconsCache;
|
import net.osmand.plus.IconsCache;
|
||||||
|
import net.osmand.plus.MapMarkersHelper;
|
||||||
import net.osmand.plus.OsmAndFormatter;
|
import net.osmand.plus.OsmAndFormatter;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.OsmandSettings;
|
import net.osmand.plus.OsmandSettings;
|
||||||
|
@ -73,15 +73,15 @@ import gnu.trove.list.array.TIntArrayList;
|
||||||
public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
|
|
||||||
public static final int SEARCH_ID = -1;
|
public static final int SEARCH_ID = -1;
|
||||||
// public static final int EXPORT_ID = 0;
|
// public static final int EXPORT_ID = 0;
|
||||||
// public static final int IMPORT_ID = 1;
|
// public static final int IMPORT_ID = 1;
|
||||||
public static final int DELETE_ID = 2;
|
public static final int DELETE_ID = 2;
|
||||||
public static final int DELETE_ACTION_ID = 3;
|
public static final int DELETE_ACTION_ID = 3;
|
||||||
public static final int SHARE_ID = 4;
|
public static final int SHARE_ID = 4;
|
||||||
public static final int SELECT_DESTINATIONS_ID = 5;
|
public static final int SELECT_MAP_MARKERS_ID = 5;
|
||||||
public static final int SELECT_DESTINATIONS_ACTION_MODE_ID = 6;
|
public static final int SELECT_MAP_MARKERS_ACTION_MODE_ID = 6;
|
||||||
|
|
||||||
private FavouritesAdapter favouritesAdapter = new FavouritesAdapter();;
|
private FavouritesAdapter favouritesAdapter = new FavouritesAdapter();
|
||||||
private FavouritesDbHelper helper;
|
private FavouritesDbHelper helper;
|
||||||
|
|
||||||
private boolean selectionMode = false;
|
private boolean selectionMode = false;
|
||||||
|
@ -115,7 +115,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
@Override
|
@Override
|
||||||
protected void onPreExecute() {
|
protected void onPreExecute() {
|
||||||
showProgressBar();
|
showProgressBar();
|
||||||
};
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(String result) {
|
protected void onPostExecute(String result) {
|
||||||
|
@ -138,7 +138,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.favorites_tree, container, false);
|
View view = inflater.inflate(R.layout.favorites_tree, container, false);
|
||||||
ExpandableListView listView = (ExpandableListView)view.findViewById(android.R.id.list);
|
ExpandableListView listView = (ExpandableListView) view.findViewById(android.R.id.list);
|
||||||
favouritesAdapter.synchronizeGroups();
|
favouritesAdapter.synchronizeGroups();
|
||||||
listView.setAdapter(favouritesAdapter);
|
listView.setAdapter(favouritesAdapter);
|
||||||
setListView(listView);
|
setListView(listView);
|
||||||
|
@ -160,9 +160,9 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateSelectionMode(ActionMode m) {
|
private void updateSelectionMode(ActionMode m) {
|
||||||
if(favoritesSelected.size() > 0) {
|
if (favoritesSelected.size() > 0) {
|
||||||
m.setTitle(favoritesSelected.size() + " " + getMyApplication().getString(R.string.shared_string_selected_lowercase));
|
m.setTitle(favoritesSelected.size() + " " + getMyApplication().getString(R.string.shared_string_selected_lowercase));
|
||||||
} else{
|
} else {
|
||||||
m.setTitle("");
|
m.setTitle("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -204,8 +204,8 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
final FavouritesDbHelper helper = app.getFavorites();
|
final FavouritesDbHelper helper = app.getFavorites();
|
||||||
List<FavoriteGroup> gs = helper.getFavoriteGroups();
|
List<FavoriteGroup> gs = helper.getFavoriteGroups();
|
||||||
String[] list = new String[gs.size()];
|
String[] list = new String[gs.size()];
|
||||||
for(int i = 0; i < list.length; i++) {
|
for (int i = 0; i < list.length; i++) {
|
||||||
list[i] =gs.get(i).name;
|
list[i] = gs.get(i).name;
|
||||||
}
|
}
|
||||||
cat.setAdapter(new ArrayAdapter<String>(ctx, R.layout.list_textview, list));
|
cat.setAdapter(new ArrayAdapter<String>(ctx, R.layout.list_textview, list));
|
||||||
builder.setNegativeButton(R.string.shared_string_cancel, null);
|
builder.setNegativeButton(R.string.shared_string_cancel, null);
|
||||||
|
@ -275,8 +275,8 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
// export();
|
// export();
|
||||||
// return true;
|
// return true;
|
||||||
// } else
|
// } else
|
||||||
if (item.getItemId() == SELECT_DESTINATIONS_ID) {
|
if (item.getItemId() == SELECT_MAP_MARKERS_ID) {
|
||||||
selectDestinations();
|
selectMapMarkers();
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == SHARE_ID) {
|
} else if (item.getItemId() == SHARE_ID) {
|
||||||
shareFavourites();
|
shareFavourites();
|
||||||
|
@ -292,28 +292,8 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectDestinations() {
|
private void selectMapMarkers() {
|
||||||
final TargetPointsHelper targetPointsHelper = getMyApplication().getTargetPointsHelper();
|
enterMapMarkersMode();
|
||||||
if (targetPointsHelper.getIntermediatePoints().size() > 0) {
|
|
||||||
final FragmentActivity act = getActivity();
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(act);
|
|
||||||
builder.setTitle(R.string.new_directions_point_dialog);
|
|
||||||
builder.setItems(
|
|
||||||
new String[] { act.getString(R.string.keep_intermediate_points),
|
|
||||||
act.getString(R.string.clear_intermediate_points)},
|
|
||||||
new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
|
||||||
if (which == 1) {
|
|
||||||
targetPointsHelper.clearPointToNavigate(false);
|
|
||||||
}
|
|
||||||
enterIntermediatesMode();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
builder.show();
|
|
||||||
} else {
|
|
||||||
enterIntermediatesMode();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -365,12 +345,16 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!MenuItemCompat.isActionViewExpanded(mi)) {
|
if (!MenuItemCompat.isActionViewExpanded(mi)) {
|
||||||
createMenuItem(menu, SHARE_ID, R.string.shared_string_share, R.drawable.ic_action_gshare_dark,
|
createMenuItem(menu, SHARE_ID, R.string.shared_string_share, R.drawable.ic_action_gshare_dark,
|
||||||
R.drawable.ic_action_gshare_dark, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
|
R.drawable.ic_action_gshare_dark, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
|
||||||
createMenuItem(menu, SELECT_DESTINATIONS_ID, R.string.select_destination_and_intermediate_points, R.drawable.ic_action_intermediate,
|
if (getSettings().USE_MAP_MARKERS.get()) {
|
||||||
|
createMenuItem(menu, SELECT_MAP_MARKERS_ID, R.string.select_map_markers, R.drawable.ic_action_flag_dark,
|
||||||
|
R.drawable.ic_action_flag_dark, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
|
||||||
|
} else {
|
||||||
|
createMenuItem(menu, SELECT_MAP_MARKERS_ID, R.string.select_destination_and_intermediate_points, R.drawable.ic_action_intermediate,
|
||||||
R.drawable.ic_action_intermediate, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
|
R.drawable.ic_action_intermediate, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
|
||||||
|
}
|
||||||
createMenuItem(menu, DELETE_ID, R.string.shared_string_delete, R.drawable.ic_action_delete_dark,
|
createMenuItem(menu, DELETE_ID, R.string.shared_string_delete, R.drawable.ic_action_delete_dark,
|
||||||
R.drawable.ic_action_delete_dark, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
|
R.drawable.ic_action_delete_dark, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
|
||||||
// createMenuItem(menu, EXPORT_ID, R.string.shared_string_export, R.drawable.ic_action_gsave_light,
|
// createMenuItem(menu, EXPORT_ID, R.string.shared_string_export, R.drawable.ic_action_gsave_light,
|
||||||
|
@ -380,7 +364,6 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void showProgressBar() {
|
public void showProgressBar() {
|
||||||
getActionBarActivity().setSupportProgressBarIndeterminateVisibility(true);
|
getActionBarActivity().setSupportProgressBarIndeterminateVisibility(true);
|
||||||
}
|
}
|
||||||
|
@ -389,15 +372,21 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
getActionBarActivity().setSupportProgressBarIndeterminateVisibility(false);
|
getActionBarActivity().setSupportProgressBarIndeterminateVisibility(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enterIntermediatesMode() {
|
private void enterMapMarkersMode() {
|
||||||
actionMode = getActionBarActivity().startSupportActionMode(new ActionMode.Callback() {
|
actionMode = getActionBarActivity().startSupportActionMode(new ActionMode.Callback() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
|
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
|
||||||
enableSelectionMode(true);
|
enableSelectionMode(true);
|
||||||
createMenuItem(menu, SELECT_DESTINATIONS_ACTION_MODE_ID, R.string.select_destination_and_intermediate_points,
|
if (getSettings().USE_MAP_MARKERS.get()) {
|
||||||
|
createMenuItem(menu, SELECT_MAP_MARKERS_ACTION_MODE_ID, R.string.select_map_markers,
|
||||||
|
R.drawable.ic_action_flag_dark, R.drawable.ic_action_flag_dark,
|
||||||
|
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
|
||||||
|
} else {
|
||||||
|
createMenuItem(menu, SELECT_MAP_MARKERS_ACTION_MODE_ID, R.string.select_destination_and_intermediate_points,
|
||||||
R.drawable.ic_action_intermediate, R.drawable.ic_action_intermediate,
|
R.drawable.ic_action_intermediate, R.drawable.ic_action_intermediate,
|
||||||
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
|
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
|
||||||
|
}
|
||||||
favoritesSelected.clear();
|
favoritesSelected.clear();
|
||||||
groupsToDelete.clear();
|
groupsToDelete.clear();
|
||||||
favouritesAdapter.notifyDataSetInvalidated();
|
favouritesAdapter.notifyDataSetInvalidated();
|
||||||
|
@ -418,9 +407,9 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
|
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
|
||||||
if (item.getItemId() == SELECT_DESTINATIONS_ACTION_MODE_ID) {
|
if (item.getItemId() == SELECT_MAP_MARKERS_ACTION_MODE_ID) {
|
||||||
mode.finish();
|
mode.finish();
|
||||||
selectDestinationImpl();
|
selectMapMarkersImpl();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -428,19 +417,27 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectDestinationImpl() {
|
private void selectMapMarkersImpl() {
|
||||||
if(!favoritesSelected.isEmpty()) {
|
if(!favoritesSelected.isEmpty()) {
|
||||||
|
if (getSettings().USE_MAP_MARKERS.get()) {
|
||||||
|
MapMarkersHelper markersHelper = getMyApplication().getMapMarkersHelper();
|
||||||
|
for (FavouritePoint fp : favoritesSelected) {
|
||||||
|
markersHelper.addMapMarker(new LatLon(fp.getLatitude(), fp.getLongitude()),
|
||||||
|
new PointDescription(PointDescription.POINT_TYPE_MAP_MARKER, fp.getName()));
|
||||||
|
}
|
||||||
|
MapActivity.launchMapActivityMoveToTop(getActivity());
|
||||||
|
} else {
|
||||||
final TargetPointsHelper targetPointsHelper = getMyApplication().getTargetPointsHelper();
|
final TargetPointsHelper targetPointsHelper = getMyApplication().getTargetPointsHelper();
|
||||||
for(FavouritePoint fp : favoritesSelected) {
|
for (FavouritePoint fp : favoritesSelected) {
|
||||||
targetPointsHelper.navigateToPoint(new LatLon(fp.getLatitude(), fp.getLongitude()), false,
|
targetPointsHelper.navigateToPoint(new LatLon(fp.getLatitude(), fp.getLongitude()), false,
|
||||||
targetPointsHelper.getIntermediatePoints().size() + 1,
|
targetPointsHelper.getIntermediatePoints().size() + 1,
|
||||||
new PointDescription(PointDescription.POINT_TYPE_FAVORITE, fp.getName()));
|
new PointDescription(PointDescription.POINT_TYPE_FAVORITE, fp.getName()));
|
||||||
}
|
}
|
||||||
if(getMyApplication().getRoutingHelper().isRouteCalculated()) {
|
if (getMyApplication().getRoutingHelper().isRouteCalculated()) {
|
||||||
targetPointsHelper.updateRouteAndRefresh(true);
|
targetPointsHelper.updateRouteAndRefresh(true);
|
||||||
}
|
}
|
||||||
IntermediatePointsDialog.openIntermediatePointsDialog(getActivity(), getMyApplication(), true);
|
IntermediatePointsDialog.openIntermediatePointsDialog(getActivity(), getMyApplication(), true);
|
||||||
//MapActivity.launchMapActivityMoveToTop(getActivity());
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -487,7 +484,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
|
|
||||||
private void enableSelectionMode(boolean selectionMode) {
|
private void enableSelectionMode(boolean selectionMode) {
|
||||||
this.selectionMode = selectionMode;
|
this.selectionMode = selectionMode;
|
||||||
((FavoritesActivity)getActivity()).setToolbarVisibility(!selectionMode &&
|
((FavoritesActivity) getActivity()).setToolbarVisibility(!selectionMode &&
|
||||||
AndroidUiHelper.isOrientationPortrait(getActivity()));
|
AndroidUiHelper.isOrientationPortrait(getActivity()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -503,7 +500,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
|
|
||||||
final Spinner colorSpinner = (Spinner) view.findViewById(R.id.ColorSpinner);
|
final Spinner colorSpinner = (Spinner) view.findViewById(R.id.ColorSpinner);
|
||||||
final TIntArrayList list = new TIntArrayList();
|
final TIntArrayList list = new TIntArrayList();
|
||||||
final int intColor = group.color == 0? getResources().getColor(R.color.color_favorite) : group.color;
|
final int intColor = group.color == 0 ? getResources().getColor(R.color.color_favorite) : group.color;
|
||||||
ColorDialogs.setupColorSpinner(getActivity(), intColor, colorSpinner, list);
|
ColorDialogs.setupColorSpinner(getActivity(), intColor, colorSpinner, list);
|
||||||
|
|
||||||
builder.setTitle(R.string.edit_group);
|
builder.setTitle(R.string.edit_group);
|
||||||
|
@ -519,7 +516,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
if (clr != intColor || group.visible != checkBox.isChecked() || nameChanged) {
|
if (clr != intColor || group.visible != checkBox.isChecked() || nameChanged) {
|
||||||
getMyApplication().getFavorites().editFavouriteGroup(group, name, clr,
|
getMyApplication().getFavorites().editFavouriteGroup(group, name, clr,
|
||||||
checkBox.isChecked());
|
checkBox.isChecked());
|
||||||
if(nameChanged) {
|
if (nameChanged) {
|
||||||
favouritesAdapter.synchronizeGroups();
|
favouritesAdapter.synchronizeGroups();
|
||||||
}
|
}
|
||||||
favouritesAdapter.notifyDataSetInvalidated();
|
favouritesAdapter.notifyDataSetInvalidated();
|
||||||
|
@ -570,7 +567,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
hideProgressBar();
|
hideProgressBar();
|
||||||
final Intent sendIntent = new Intent();
|
final Intent sendIntent = new Intent();
|
||||||
sendIntent.setAction(Intent.ACTION_SEND);
|
sendIntent.setAction(Intent.ACTION_SEND);
|
||||||
sendIntent.putExtra(Intent.EXTRA_TEXT, "Favourites.gpx:\n\n\n"+GPXUtilities.asString(gpxFile, getMyApplication()));
|
sendIntent.putExtra(Intent.EXTRA_TEXT, "Favourites.gpx:\n\n\n" + GPXUtilities.asString(gpxFile, getMyApplication()));
|
||||||
sendIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.share_fav_subject));
|
sendIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.share_fav_subject));
|
||||||
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(helper.getExternalFile()));
|
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(helper.getExternalFile()));
|
||||||
// sendIntent.setType("application/gpx+xml");
|
// sendIntent.setType("application/gpx+xml");
|
||||||
|
@ -612,7 +609,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
} else {
|
} else {
|
||||||
AccessibleToast.makeText(getActivity(), warning, Toast.LENGTH_LONG).show();
|
AccessibleToast.makeText(getActivity(), warning, Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (tosave.exists()) {
|
if (tosave.exists()) {
|
||||||
|
@ -632,7 +629,6 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class FavouritesAdapter extends OsmandBaseExpandableListAdapter implements Filterable {
|
class FavouritesAdapter extends OsmandBaseExpandableListAdapter implements Filterable {
|
||||||
|
|
||||||
private static final boolean showOptionsButton = false;
|
private static final boolean showOptionsButton = false;
|
||||||
|
@ -674,7 +670,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
}
|
}
|
||||||
favoriteGroups.put(key, list);
|
favoriteGroups.put(key, list);
|
||||||
}
|
}
|
||||||
if(!empty) {
|
if (!empty) {
|
||||||
groups.add(key);
|
groups.add(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -734,7 +730,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
adjustIndicator(groupPosition, isExpanded, row, getMyApplication().getSettings().isLightContent());
|
adjustIndicator(groupPosition, isExpanded, row, getMyApplication().getSettings().isLightContent());
|
||||||
TextView label = (TextView) row.findViewById(R.id.category_name);
|
TextView label = (TextView) row.findViewById(R.id.category_name);
|
||||||
final FavoriteGroup model = getGroup(groupPosition);
|
final FavoriteGroup model = getGroup(groupPosition);
|
||||||
label.setText(model.name.length() == 0? getString(R.string.shared_string_favorites) : model.name);
|
label.setText(model.name.length() == 0 ? getString(R.string.shared_string_favorites) : model.name);
|
||||||
|
|
||||||
if (selectionMode) {
|
if (selectionMode) {
|
||||||
final CheckBox ch = (CheckBox) row.findViewById(R.id.check_item);
|
final CheckBox ch = (CheckBox) row.findViewById(R.id.check_item);
|
||||||
|
@ -762,7 +758,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
ch.setVisibility(View.GONE);
|
ch.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
final View ch = row.findViewById(R.id.options);
|
final View ch = row.findViewById(R.id.options);
|
||||||
if(!selectionMode) {
|
if (!selectionMode) {
|
||||||
((ImageView) ch).setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_overflow_menu_white));
|
((ImageView) ch).setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_overflow_menu_white));
|
||||||
ch.setVisibility(View.VISIBLE);
|
ch.setVisibility(View.VISIBLE);
|
||||||
ch.setOnClickListener(new View.OnClickListener() {
|
ch.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@ -861,7 +857,6 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
|
|
||||||
public void setFilterResults(Set<?> values) {
|
public void setFilterResults(Set<?> values) {
|
||||||
this.filter = values;
|
this.filter = values;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -880,12 +875,12 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
} else {
|
} else {
|
||||||
Set<Object> filter = new HashSet<Object>();
|
Set<Object> filter = new HashSet<Object>();
|
||||||
String cs = constraint.toString().toLowerCase();
|
String cs = constraint.toString().toLowerCase();
|
||||||
for(FavoriteGroup g : helper.getFavoriteGroups()) {
|
for (FavoriteGroup g : helper.getFavoriteGroups()) {
|
||||||
if(g.name.toLowerCase().indexOf(cs) != -1) {
|
if (g.name.toLowerCase().indexOf(cs) != -1) {
|
||||||
filter.add(g);
|
filter.add(g);
|
||||||
} else {
|
} else {
|
||||||
for(FavouritePoint fp : g.points) {
|
for (FavouritePoint fp : g.points) {
|
||||||
if(fp.getName().toLowerCase().indexOf(cs) != -1) {
|
if (fp.getName().toLowerCase().indexOf(cs) != -1) {
|
||||||
filter.add(fp);
|
filter.add(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -904,7 +899,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
favouritesAdapter.synchronizeGroups();
|
favouritesAdapter.synchronizeGroups();
|
||||||
}
|
}
|
||||||
favouritesAdapter.notifyDataSetChanged();
|
favouritesAdapter.notifyDataSetChanged();
|
||||||
if(constraint != null && constraint.length() > 1) {
|
if (constraint != null && constraint.length() > 1) {
|
||||||
collapseTrees(5);
|
collapseTrees(5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -650,7 +650,7 @@ public class MapMarkerDialogHelper {
|
||||||
wpt.lat = marker.getLatitude();
|
wpt.lat = marker.getLatitude();
|
||||||
wpt.lon = marker.getLongitude();
|
wpt.lon = marker.getLongitude();
|
||||||
wpt.setColor(mapActivity.getResources().getColor(getMapMarkerColorId(marker.colorIndex)));
|
wpt.setColor(mapActivity.getResources().getColor(getMapMarkerColorId(marker.colorIndex)));
|
||||||
//wpt.name = desc;
|
wpt.name = marker.getOnlyName();
|
||||||
//wpt.link = r.getFileName();
|
//wpt.link = r.getFileName();
|
||||||
//wpt.time = r.getFile().lastModified();
|
//wpt.time = r.getFile().lastModified();
|
||||||
//wpt.category = r.getSearchHistoryType();
|
//wpt.category = r.getSearchHistoryType();
|
||||||
|
|
Loading…
Reference in a new issue