Fix issue #15
This commit is contained in:
@ -336,11 +336,11 @@ public class GeofavoriteDetailActivity extends NextcloudMapsStyledActivity imple
|
||||
|
||||
public void updateView(Geofavorite item) {
|
||||
binding.collapsingToolbar.setTitle(item.getName() != null ? item.getName() : getString(R.string.new_geobookmark));
|
||||
binding.nameEt.setText(item.getName());
|
||||
binding.descriptionEt.setText(item.getComment());
|
||||
binding.nameEt.setText(item.getName() != null ? item.getName() : "");
|
||||
binding.descriptionEt.setText(item.getComment() != null ? item.getComment() : "");
|
||||
binding.createdTv.setText(item.getLocalDateCreated().format(dateFormatter));
|
||||
binding.modifiedTv.setText(item.getLocalDateCreated().format(dateFormatter));
|
||||
binding.categoryAt.setText(item.getCategory());
|
||||
binding.categoryAt.setText(item.getCategory() != null ? item.getCategory() : Geofavorite.DEFAULT_CATEGORY);
|
||||
updateViewCoords(item);
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,7 @@ public class MainActivity extends NextcloudMapsStyledActivity implements OnSorti
|
||||
|
||||
private void showGeofavoriteDeteleDialog(Geofavorite item) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
||||
builder.setMessage(getString(R.string.dialog_delete_message).replace("{name}", item.getName()))
|
||||
builder.setMessage(getString(R.string.dialog_delete_message).replace("{name}", item.getName() != null ? item.getName() : ""))
|
||||
.setTitle(R.string.dialog_delete_title)
|
||||
.setPositiveButton(R.string.dialog_delete_delete, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
@ -162,7 +162,9 @@ public class GeofavoriteRepository {
|
||||
private void updateCategories(List<Geofavorite> geofavs) {
|
||||
HashSet<String> categories = new HashSet<>();
|
||||
for (Geofavorite g : geofavs) {
|
||||
categories.add(g.getCategory());
|
||||
String cat = g.getCategory();
|
||||
if (cat != null)
|
||||
categories.add(cat);
|
||||
}
|
||||
mCategories.postValue(categories);
|
||||
}
|
||||
|
Reference in New Issue
Block a user