mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-11 14:54:17 +00:00
Compare commits
1 Commits
jb_edit_bg
...
jb_dlt_lis
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e49f53e08 |
@@ -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,24 @@ 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.yes, ((dialog, which) -> {
|
||||
onAddButtonClick();
|
||||
BookmarkManager.INSTANCE.deleteCategory(category.getId());
|
||||
getAdapter().notifyDataSetChanged();
|
||||
}))
|
||||
.setNegativeButton(android.R.string.no,(dialog, which) -> dialog.dismiss())
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
private void onSettingsActionSelected(@NonNull BookmarkCategory category)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
android:layout_margin="4dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:cardBackgroundColor="?appBackground"
|
||||
app:cardBackgroundColor="?cardBackground"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="2dp"
|
||||
tools:showIn="@layout/item_charging_sockets">
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:background="?attr/colorSurfaceContainerHigh"
|
||||
tools:context=".editor.EditorActivity">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -431,6 +430,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="@dimen/margin_quarter"
|
||||
app:backgroundTint="?cardBackground"
|
||||
android:textColor="@color/base_red"
|
||||
app:strokeColor="@color/base_red"
|
||||
android:text="@string/editor_business_vacant_button"/>
|
||||
@@ -441,6 +441,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="@dimen/margin_base"
|
||||
app:backgroundTint="?cardBackground"
|
||||
android:textColor="@color/base_red"
|
||||
app:strokeColor="@color/base_red"
|
||||
tools:text="Reset my changes"/>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurfaceContainerHigh"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?windowBackgroundForced"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/frameLayout"
|
||||
android:background="?attr/colorSurfaceContainerHigh"
|
||||
android:layout_marginBottom="@dimen/margin_quarter">
|
||||
android:background="?windowBackgroundForced">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/phones_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?cardBackground"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
style="@style/MwmWidget.FrameLayout.Elevation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurfaceContainerHigh"
|
||||
android:background="?windowBackgroundForced"
|
||||
android:layout_above="@+id/tv__mode_switch"
|
||||
android:layout_below="@id/toolbar"/>
|
||||
|
||||
@@ -19,13 +19,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/tv__mode_switch"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="?attr/colorSurfaceContainerHigh"/>/>
|
||||
android:background="?cardBackground"/>
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/tv__mode_switch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="?clickableBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="@dimen/margin_base"
|
||||
android:text="@string/editor_time_advanced"
|
||||
@@ -34,7 +35,7 @@
|
||||
android:textColor="?colorSecondary" />
|
||||
|
||||
<include
|
||||
layout="@layout/item_divider"
|
||||
layout="@layout/shadow_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/tv__mode_switch"/>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurfaceContainerHigh">>
|
||||
android:background="?windowBackgroundForced">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -17,7 +17,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
style="@style/MwmWidget.M3.Editor.CardView">
|
||||
style="@style/MwmWidget.M3.Editor.CardView"
|
||||
app:cardBackgroundColor="?cardBackground">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/examples"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
android:id="@+id/recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurfaceContainerHigh"
|
||||
android:background="?windowBackgroundForced"
|
||||
android:paddingStart="@dimen/margin_half"
|
||||
android:paddingEnd="@dimen/margin_half"
|
||||
android:scrollbars="vertical"/>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
android:layout_margin="4dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:cardBackgroundColor="?appBackground"
|
||||
app:cardBackgroundColor="?cardBackground"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="2dp">
|
||||
|
||||
|
||||
@@ -21,6 +21,5 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/edit_socket_info_tooltip"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:layout_marginBottom="@dimen/margin_quarter"/>
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
</LinearLayout>
|
||||
@@ -4,5 +4,5 @@
|
||||
android:id="@+id/recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?appBackground"
|
||||
android:background="?cardBackground"
|
||||
android:scrollbars="vertical"/>
|
||||
|
||||
@@ -975,4 +975,5 @@
|
||||
<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>
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_marginBottom">@dimen/margin_half</item>
|
||||
<item name="cardBackgroundColor">?appBackground</item>
|
||||
<item name="cardBackgroundColor">?cardBackground</item>
|
||||
<item name="android:padding">@dimen/margin_base</item>
|
||||
<item name="cardPreventCornerOverlap">false</item>
|
||||
</style>
|
||||
|
||||
@@ -239,6 +239,10 @@
|
||||
<item name="android:foreground">@drawable/shadow_top</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.FrameLayout.BookmarkCategories">
|
||||
<item name="android:background">?windowBackgroundForced</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.Counter">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
|
||||
@@ -278,6 +278,10 @@
|
||||
<style name="MwmTheme.Navigation">
|
||||
<item name="iconTint">@color/white_primary</item>
|
||||
</style>
|
||||
|
||||
<style name="PopupMenu" parent="ThemeOverlay.Material3">
|
||||
<item name="android:popupBackground">?windowBackgroundForced</item>
|
||||
</style>
|
||||
<!-- Theme required to apply M3 dialog style on preference screen -->
|
||||
<style name="MwmTheme.M3.AlertDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog">
|
||||
<item name="dialogCornerRadius">28dp</item>
|
||||
|
||||
Reference in New Issue
Block a user