mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-30 01:24:07 +00:00
Compare commits
2 Commits
jb_dlt_lis
...
dark_bg
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c54c1335f | ||
|
|
33e4894a56 |
@@ -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)
|
||||
|
||||
@@ -6,12 +6,10 @@ import android.view.View;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.XmlRes;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.util.Utils;
|
||||
import app.organicmaps.util.WindowInsetUtils.ScrollableContentInsetsListener;
|
||||
|
||||
@@ -44,7 +42,6 @@ abstract class BaseXmlSettingsFragment extends PreferenceFragmentCompat
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
view.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.bg_cards));
|
||||
RecyclerView recyclerView = getListView();
|
||||
ViewCompat.setOnApplyWindowInsetsListener(recyclerView, new ScrollableContentInsetsListener(recyclerView));
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?cardBackground"
|
||||
android:background="?appBackground"
|
||||
android:clipToPadding="false"
|
||||
android:fadeScrollbars="false"
|
||||
android:fillViewport="true">
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?cardBackground"
|
||||
android:background="?appBackground"
|
||||
android:fadeScrollbars="false"
|
||||
android:fillViewport="true"
|
||||
android:clipToPadding="false">
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:background="?appBackground">
|
||||
|
||||
<include
|
||||
layout="@layout/toolbar_extended"/>
|
||||
@@ -17,7 +18,8 @@
|
||||
android:id="@+id/fragment_container"
|
||||
style="@style/MwmWidget.FrameLayout.Elevation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent"
|
||||
android:background="?appBackground"/>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?cardBackground"
|
||||
android:background="?appBackground"
|
||||
android:clipToPadding="false"
|
||||
android:fadeScrollbars="false"
|
||||
android:fillViewport="true">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?cardBackground">
|
||||
android:background="?appBackground">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?cardBackground"
|
||||
android:background="?appBackground"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?cardBackground"
|
||||
android:background="?appBackground"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:background="?appBackground">
|
||||
|
||||
<include
|
||||
layout="@layout/toolbar_default"/>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?cardBackground"
|
||||
android:background="?appBackground"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?cardBackground"
|
||||
android:background="?appBackground"
|
||||
android:fadeScrollbars="false"
|
||||
android:fillViewport="true"
|
||||
android:clipToPadding="false">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="?cardBackground">
|
||||
android:background="?appBackground">
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/MwmWidget.ToolbarStyle"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="?cardBackground">
|
||||
android:background="?appBackground">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/header"
|
||||
|
||||
@@ -9,7 +9,7 @@ android:layout_marginHorizontal="@dimen/margin_base"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
app:strokeWidth="1dp"
|
||||
app:strokeColor="@color/base_accent"
|
||||
app:cardBackgroundColor="@color/bg_cards">
|
||||
app:cardBackgroundColor="?cardBackground">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -150,6 +150,8 @@
|
||||
<item name="colorSurfaceContainer">@color/md_theme_surfaceContainer</item>
|
||||
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh</item>
|
||||
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest</item>
|
||||
|
||||
<item name="appBackground">?android:attr/colorBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTheme" parent="MwmTheme.Base"/>
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
<color name="bg_cards">@android:color/white</color>
|
||||
<color name="bg_panel">@color/bg_window</color>
|
||||
<color name="bg_primary_dark">#37653F</color> <!-- secondary dark -->
|
||||
<color name="bg_app">@android:color/white</color>
|
||||
|
||||
<color name="bg_dialog_translucent">#BB000000</color>
|
||||
<color name="bg_text_translucent">#99FFFFFF</color>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<attr name="textDialogTheme" format="reference" />
|
||||
<attr name="windowBackgroundForced" format="reference|color" />
|
||||
<attr name="cardBackground" format="reference" />
|
||||
<attr name="appBackground" format="reference|color" />
|
||||
<attr name="clickableBackground" format="reference" />
|
||||
<attr name="statusBar" format="color" />
|
||||
<attr name="secondary" format="color" />
|
||||
|
||||
@@ -158,6 +158,8 @@
|
||||
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh</item>
|
||||
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest</item>
|
||||
|
||||
<item name="appBackground">@color/bg_app</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="MwmTheme" parent="MwmTheme.Base"/>
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
{
|
||||
"World": {
|
||||
"languages": ["int_name", "en", "default"]
|
||||
},
|
||||
"WorldCoasts": {
|
||||
"languages": ["int_name", "en", "default"]
|
||||
},
|
||||
"Abkhazia": {
|
||||
"languages": ["ab", "ru"]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user