Compare commits

..

2 Commits

Author SHA1 Message Date
Jean-Baptiste
ec4428377e [android] Add support of dark mode for how to edit oh html file
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2026-01-10 11:22:49 +01:00
x7z4w
c1137bd38a [android] Fix Serbian locale
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2026-01-09 20:12:57 +00:00
5 changed files with 34 additions and 24 deletions

View File

@@ -304,8 +304,8 @@ android {
"ru",
"sl",
"sk",
"sr-rCyrl",
"sr-rLatn",
"sr",
"b+sr+Latn",
"sv",
"sw",
"ta",

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,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)

View File

@@ -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>

View File

@@ -49,7 +49,7 @@
<locale android:name="ru" />
<locale android:name="sl" />
<locale android:name="sk" />
<locale android:name="sr-Cyrl" />
<locale android:name="sr" />
<locale android:name="sr-Latn" />
<locale android:name="sv" />
<locale android:name="sw" />

View File

@@ -11,6 +11,31 @@
.example {
font-weight: bold;
font-family: monospace;
/* Dark mode support. */
:root {
color-scheme: light dark;
--primary-color: black;
--secondary-color: #555555;
--link-color: #37653F;
--background-color: white;
--separator-color: #0e0e0e;
}
@media screen and (prefers-color-scheme: dark) {
:root {
--primary-color: #b5b5b5;
--secondary-color: #858585;
--link-color: #659464;
--background-color: black;
--separator-color: #0a0a0a;
}
}
html {
color: var(--secondary-color);
background-color: var(--background-color);
}
}
</style>
<script>