Compare commits

..

2 Commits

Author SHA1 Message Date
Jean-Baptiste
449730f39a [android] Use M3 top bar in settings
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-29 21:56:31 +01:00
Yannik Bloscheck
33e4894a56 [core] Add language data to world files
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
2025-12-29 16:13:18 +01:00
7 changed files with 29 additions and 18 deletions

View File

@@ -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,19 +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.ok, (dialog, which) -> dialog.dismiss())
.show();
}
BookmarkManager.INSTANCE.deleteCategory(category.getId());
getAdapter().notifyDataSetChanged();
}
private void onSettingsActionSelected(@NonNull BookmarkCategory category)

View File

@@ -6,7 +6,7 @@
android:orientation="vertical">
<include
layout="@layout/toolbar_default"/>
layout="@layout/mtoolbar_default"/>
<FrameLayout
android:id="@+id/fragment_container"

View File

@@ -8,7 +8,7 @@
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar_default" />
layout="@layout/mtoolbar_default" />
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.appbar.MaterialToolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
style="@style/MwmWidget.M3.ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize" />

View File

@@ -974,5 +974,4 @@
<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>

View File

@@ -396,4 +396,11 @@
<item name="cornerSizeTopLeft">50%</item>
<item name="cornerSizeTopRight">50%</item>
</style>
<style name="MwmWidget.M3.ToolbarStyle" parent="Widget.Material3.Toolbar">
<item name="android:background">?android:attr/colorBackground</item>
<item name="android:displayOptions">homeAsUp|showTitle</item>
<item name="contentInsetStart">0dp</item>
<item name="buttonGravity">center_vertical</item>
</style>
</resources>

View File

@@ -1,4 +1,10 @@
{
"World": {
"languages": ["int_name", "en", "default"]
},
"WorldCoasts": {
"languages": ["int_name", "en", "default"]
},
"Abkhazia": {
"languages": ["ab", "ru"]
},