mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-11 06:44:18 +00:00
Compare commits
1 Commits
jb_dlt_lis
...
jb_pp_bg
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01a27b99d3 |
@@ -197,8 +197,10 @@ 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)));
|
||||
items.add(new MenuBottomSheetItem(R.string.delete, R.drawable.ic_delete,
|
||||
() -> onDeleteActionSelected(mSelectedCategory)));
|
||||
// Disallow deleting the last category
|
||||
if (getAdapter().getBookmarkCategories().size() > 1)
|
||||
items.add(new MenuBottomSheetItem(R.string.delete, R.drawable.ic_delete,
|
||||
() -> onDeleteActionSelected(mSelectedCategory)));
|
||||
}
|
||||
return items;
|
||||
}
|
||||
@@ -295,24 +297,8 @@ public class BookmarkCategoriesFragment extends BaseMwmRecyclerFragment<Bookmark
|
||||
|
||||
private void onDeleteActionSelected(@NonNull BookmarkCategory category)
|
||||
{
|
||||
// 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.yes, ((dialog, which) -> {
|
||||
onAddButtonClick();
|
||||
BookmarkManager.INSTANCE.deleteCategory(category.getId());
|
||||
getAdapter().notifyDataSetChanged();
|
||||
}))
|
||||
.setNegativeButton(android.R.string.no,(dialog, which) -> dialog.dismiss())
|
||||
.show();
|
||||
}
|
||||
BookmarkManager.INSTANCE.deleteCategory(category.getId());
|
||||
getAdapter().notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private void onSettingsActionSelected(@NonNull BookmarkCategory category)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
style="@style/MwmWidget.M3.Button.Secondary"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
app:backgroundTint="?windowBackgroundForced"
|
||||
android:backgroundTint="?windowBackgroundForced"
|
||||
app:backgroundTint="?colorSurfaceContainerLow"
|
||||
android:backgroundTint="?colorSurfaceContainerLow"
|
||||
android:text="@string/placepage_add_place_button" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center_horizontal|top"
|
||||
android:background="?ppBackground"
|
||||
android:background="?appBackground"
|
||||
android:visibility="gone" />
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/placepage"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?windowBackgroundForced"
|
||||
android:background="?attr/colorSurfaceContainerLow"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?ppBackground"
|
||||
android:background="?appBackground"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
style="@style/MwmWidget.M3.Button.Secondary"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
app:backgroundTint="?windowBackgroundForced"
|
||||
android:backgroundTint="?windowBackgroundForced"
|
||||
app:backgroundTint="?colorSurfaceContainerLow"
|
||||
android:backgroundTint="?colorSurfaceContainerLow"
|
||||
android:text="@string/edit_place"/>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?ppBackground"
|
||||
android:background="?appBackground"
|
||||
android:orientation="horizontal">
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/item_icon"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
android:id="@+id/pp_buttons_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?windowBackgroundForced"
|
||||
android:background="?colorSurfaceContainerLow"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="bottom">
|
||||
<include layout="@layout/item_divider" />
|
||||
|
||||
@@ -975,5 +975,4 @@
|
||||
<string name="download_resources_custom_url_message">Override the default map download server used for map downloads. Leave empty to use CoMaps default server.</string>
|
||||
<string name="download_resources_custom_url_summary_none">Not set</string>
|
||||
<string name="download_resources_custom_url_error_scheme">Please enter a URL starting with http:// or https://</string>
|
||||
<string name="unable_to_delete_list">The app cannot work without at least one list. Do you want to remove it and create a new one?</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user