This commit is contained in:
Daniele Verducci (Slimpenguin)
2023-02-15 09:04:33 +01:00
parent a13e601eea
commit cf7d38d872
4 changed files with 24 additions and 5 deletions

View File

@ -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);
}

View File

@ -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) {

View File

@ -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);
}