mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-30 09:34:06 +00:00
Compare commits
1 Commits
jb_cln_boo
...
jb_dlt_lis
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59b2f813c7 |
@@ -197,10 +197,8 @@ public class BookmarkCategoriesFragment extends BaseMwmRecyclerFragment<Bookmark
|
||||
() -> onShareActionSelected(mSelectedCategory, KmlFileType.Text)));
|
||||
items.add(new MenuBottomSheetItem(R.string.export_file_gpx, R.drawable.ic_file_gpx,
|
||||
() -> onShareActionSelected(mSelectedCategory, KmlFileType.Gpx)));
|
||||
// Disallow deleting the last category
|
||||
if (getAdapter().getBookmarkCategories().size() > 1)
|
||||
items.add(new MenuBottomSheetItem(R.string.delete, R.drawable.ic_delete,
|
||||
() -> onDeleteActionSelected(mSelectedCategory)));
|
||||
items.add(new MenuBottomSheetItem(R.string.delete, R.drawable.ic_delete,
|
||||
() -> onDeleteActionSelected(mSelectedCategory)));
|
||||
}
|
||||
return items;
|
||||
}
|
||||
@@ -297,8 +295,19 @@ public class BookmarkCategoriesFragment extends BaseMwmRecyclerFragment<Bookmark
|
||||
|
||||
private void onDeleteActionSelected(@NonNull BookmarkCategory category)
|
||||
{
|
||||
BookmarkManager.INSTANCE.deleteCategory(category.getId());
|
||||
getAdapter().notifyDataSetChanged();
|
||||
// Disallow deleting the last category
|
||||
if ((getAdapter().getBookmarkCategories().size() > 1))
|
||||
{
|
||||
BookmarkManager.INSTANCE.deleteCategory(category.getId());
|
||||
getAdapter().notifyDataSetChanged();
|
||||
}
|
||||
else
|
||||
{
|
||||
new MaterialAlertDialogBuilder(requireActivity())
|
||||
.setMessage(R.string.unable_to_delete_list)
|
||||
.setPositiveButton(android.R.string.ok, (dialog, which) -> dialog.dismiss())
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
private void onSettingsActionSelected(@NonNull BookmarkCategory category)
|
||||
|
||||
@@ -66,4 +66,13 @@
|
||||
</declare-styleable>
|
||||
|
||||
<attr name="accentColorSelector" format="color"/>
|
||||
<attr name="bookingFilterTitleColor" format="color"/>
|
||||
<attr name="adsRemovalOptionsBg" format="reference"/>
|
||||
<attr name="adsRemovalOptionsDivider" format="color"/>
|
||||
<attr name="icClearRounded" format="reference"/>
|
||||
<attr name="bookmarkSubscriptionScreenBg" format="reference"/>
|
||||
<attr name="bookmarkSubscriptionCardEdge" format="reference"/>
|
||||
<attr name="bookmarkSubscriptionCardBg" format="color"/>
|
||||
<attr name="bookmarkSubscriptionCardTextColor" format="color"/>
|
||||
<attr name="imgPromoBookingTitle" format="reference"/>
|
||||
</resources>
|
||||
|
||||
@@ -974,4 +974,5 @@
|
||||
<string name="download_resources_custom_url_hint">https://cdn-fi-1.comaps.app/</string>
|
||||
<string name="download_resources_custom_url_summary_none">Not set</string>
|
||||
<string name="download_resources_custom_url_error_scheme">Please enter a full URL starting with https:// and ending with /</string>
|
||||
<string name="unable_to_delete_list">The last list cannot be deleted. Create a new list to remove it</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
{
|
||||
"World": {
|
||||
"languages": ["int_name", "en", "default"]
|
||||
},
|
||||
"WorldCoasts": {
|
||||
"languages": ["int_name", "en", "default"]
|
||||
},
|
||||
"Abkhazia": {
|
||||
"languages": ["ab", "ru"]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user