Cleanup: renaming Marker.category to typeLocalized.

This commit is contained in:
Dennis Guse
2025-12-03 17:49:14 +01:00
parent 595ad7f7b5
commit 201f2d1b27
18 changed files with 49 additions and 49 deletions
@@ -186,7 +186,7 @@ public class MarkerDetailFragment extends Fragment {
viewBinding.markerDetailMarkerPhoto.setImageDrawable(MarkerUtils.getDefaultPhoto(getContext()));
}
viewBinding.markerDetailMarkerCategory.setText(marker.category());
viewBinding.markerDetailMarkerTypeLocalized.setText(marker.typeLocalized());
viewBinding.markerDetailMarkerDescription.setText(marker.description());
viewBinding.markerDetailMarkerLocation.setText(StringUtils.formatCoordinate(getContext(), marker.position()));
@@ -178,7 +178,7 @@ public class MarkerEditActivity extends AbstractActivity {
private void loadMarkerData(Marker data) {
marker = data;
viewBinding.markerEditName.setText(marker.name());
viewBinding.markerEditMarkerType.setText(marker.category());
viewBinding.markerEditMarkerType.setText(marker.typeLocalized());
viewBinding.markerEditDescription.setText(marker.description());
if (marker.photoUrl() != null) {
setMarkerImageView(marker.photoUrl());
@@ -76,7 +76,7 @@ public class MarkerEditViewModel extends AndroidViewModel {
}
}
public void onPhotoDelete(String name, String category, String description) {
public void onPhotoDelete(String name, String typeLocalized, String description) {
MarkerBuilder marker = new MarkerBuilder(getMarker());
if (marker.hasPhoto()) {
if (!marker.getPhotoUrl().equals(photoOriginalUri)) {
@@ -84,22 +84,22 @@ public class MarkerEditViewModel extends AndroidViewModel {
}
marker.setPhotoUrl(null);
marker.setName(name);
marker.setCategory(category);
marker.setTypeLocalized(typeLocalized);
marker.setDescription(description);
markerData.postValue(marker.getMarker());
}
}
public void onNewCameraPhoto(@NonNull Uri photoUri, String name, String category, String description) {
public void onNewCameraPhoto(@NonNull Uri photoUri, String name, String typeLocalized, String description) {
MarkerBuilder marker = new MarkerBuilder(getMarker());
marker.setPhotoUrl(photoUri);
marker.setName(name);
marker.setCategory(category);
marker.setTypeLocalized(typeLocalized);
marker.setDescription(description);
markerData.postValue(marker.getMarker());
}
public void onNewGalleryPhoto(@NonNull Uri srcUri, String name, String category, String description) {
public void onNewGalleryPhoto(@NonNull Uri srcUri, String name, String typeLocalized, String description) {
MarkerBuilder marker = new MarkerBuilder(getMarker());
try (ParcelFileDescriptor parcelFd = getApplication().getContentResolver().openFileDescriptor(srcUri, "r")) {
@@ -110,7 +110,7 @@ public class MarkerEditViewModel extends AndroidViewModel {
Uri photoUri = FileUtils.getUriForFile(getApplication(), dstFile);
marker.setPhotoUrl(photoUri);
marker.setName(name);
marker.setCategory(category);
marker.setTypeLocalized(typeLocalized);
marker.setDescription(description);
markerData.postValue(marker.getMarker());
@@ -120,11 +120,11 @@ public class MarkerEditViewModel extends AndroidViewModel {
}
}
public void onDone(String name, String category, String description) {
public void onDone(String name, String typeLocalized, String description) {
MarkerBuilder marker = new MarkerBuilder(getMarker());
marker.setName(name);
marker.setCategory(category);
marker.setTypeLocalized(typeLocalized);
marker.setDescription(description);
if (marker.getId() == null) {
new ContentProviderUtils(getApplication()).insertMarker(marker.getMarker());
@@ -196,7 +196,7 @@ public class MarkerListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
}
viewBinding.markerListItemDescription.setText(marker.description());
viewBinding.markerListItemCategory.setText(marker.category());
viewBinding.markerListItemTypeLocalized.setText(marker.typeLocalized());
setSelected(selection.get((int) getId()));
}