Fix small issue with Favorites
This commit is contained in:
parent
fb56e39c98
commit
76485ca60b
3 changed files with 13 additions and 4 deletions
|
@ -228,6 +228,7 @@ public class MapMarkersHelper {
|
|||
return markersDbHelper.createGroupIfNeeded(name);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getGroupName(long id) {
|
||||
return markersDbHelper.getGroupName(id);
|
||||
}
|
||||
|
|
|
@ -221,8 +221,9 @@ public class MapMarkersDbHelper {
|
|||
marker.history ? HISTORY_NEXT_VALUE : TAIL_NEXT_VALUE});
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getGroupName(long id) {
|
||||
String res = "";
|
||||
String res = null;
|
||||
SQLiteConnection db = openConnection(true);
|
||||
if (db != null) {
|
||||
try {
|
||||
|
|
|
@ -89,9 +89,16 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
|
|||
|
||||
holder.title.setText(marker.getName(mapActivity));
|
||||
|
||||
holder.description.setText(marker.groupKey == -1
|
||||
? marker.creationDate + ""
|
||||
: mapActivity.getMyApplication().getMapMarkersHelper().getGroupName(marker.groupKey));
|
||||
String descr;
|
||||
if (marker.groupKey != -1
|
||||
&& (descr = mapActivity.getMyApplication().getMapMarkersHelper().getGroupName(marker.groupKey)) != null) {
|
||||
if (descr.equals("")) {
|
||||
descr = mapActivity.getString(R.string.shared_string_favorites);
|
||||
}
|
||||
} else {
|
||||
descr = marker.creationDate + "";
|
||||
}
|
||||
holder.description.setText(descr);
|
||||
|
||||
holder.optionsBtn.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_marker_passed));
|
||||
holder.optionsBtn.setOnClickListener(new View.OnClickListener() {
|
||||
|
|
Loading…
Reference in a new issue