Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,12 @@ class ImageAdapter(
scope.launch(ioDispatcher) {
val imageSHA1 = imageLoader.getSHA1(image, defaultDispatcher)
withContext(Dispatchers.Main) {
if (holder.isItemUploaded()) {
Toast.makeText(context, R.string.custom_selector_already_uploaded_image_text, Toast.LENGTH_SHORT).show()
if (holder.isItemUploaded()) {
Toast.makeText(context, R.string.custom_selector_already_uploaded_image_text, Toast.LENGTH_SHORT).show()
return@withContext
}

if (imageSHA1.isNotEmpty() && imageLoader.getFromUploaded(imageSHA1) != null) {
if (imageSHA1.isNotEmpty() && imageLoader.getFromUploaded(imageSHA1) != null) {
holder.itemUploaded()
Toast.makeText(context, R.string.custom_selector_already_uploaded_image_text, Toast.LENGTH_SHORT).show()
return@withContext
Expand All @@ -369,7 +369,7 @@ class ImageAdapter(
selectedImages.add(image)
notifyItemChanged(position, ImageSelectedOrUpdated())

imageSelectListener.onSelectedImagesChanged(selectedImages, numberOfSelectedImagesMarkedAsNotForUpload)
imageSelectListener.onSelectedImagesChanged(selectedImages, numberOfSelectedImagesMarkedAsNotForUpload)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,20 @@ private void addMarkerToMap(BaseMarker nearbyBaseMarker) {
authorUser = Html.fromHtml(authorUser, Html.FROM_HTML_MODE_LEGACY).toString();
}

OverlayItem item = new OverlayItem(nearbyBaseMarker.getPlace().name,
authorUser, point);
String title = nearbyBaseMarker.getPlace().name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does getPlace() have something like .caption or .label? That would be better, though that can be split to a different issue.

Copy link
Contributor Author

@khushbuk0711 khushbuk0711 Apr 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getLabel() is causing some issue and there is nothing like .caption

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What issue exactly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The app is getting crashed

// Remove "File:" if present at start
if (title.startsWith("File:")) {
title = title.substring(5);
}
// Remove extensions like .jpg, .jpeg, .png, .svg (case insensitive)
title = title.replaceAll("(?i)\\.(jpg|jpeg|png|svg)$", "");
title = title.replace("_", " ");
//Truncate if too long because it doesn't fit the screen
if (title.length() > 43) {
title = title.substring(0, 40) + "…";
}

OverlayItem item = new OverlayItem(title, authorUser, point);
item.setMarker(d);
items.add(item);
ItemizedOverlayWithFocus overlay = new ItemizedOverlayWithFocus(items,
Expand Down