mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
custom-selector: adds a button to delete the current folder in custom selector (#5925)
* Issue #5811: "Delete folder" menu in custom image selector * Issue 5811: folder deletion for api < 29. * Issue 5811: folder deletion for api < 29. * Issue 5811: folder deletion for api 29. * Issue 5811: folder deletion * Issue 5811: fixes merge conflicts, replaces used function onActivityResult with an ActivityResultLauncher * Update Constants.java --------- Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
This commit is contained in:
parent
17a8845dfd
commit
634bc3ede1
11 changed files with 447 additions and 12 deletions
|
|
@ -11,7 +11,7 @@
|
|||
android:id="@+id/partial_access_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/toolbar_layout"/>
|
||||
app:layout_constraintTop_toBottomOf="@id/toolbar_layout" />
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/fragment_container"
|
||||
|
|
|
|||
|
|
@ -40,17 +40,36 @@
|
|||
app:layout_constraintStart_toEndOf="@+id/back"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- Warning Icon (image_limit_error) -->
|
||||
<ImageButton
|
||||
android:id="@+id/image_limit_error"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#00FFFFFF"
|
||||
android:padding="@dimen/standard_gap"
|
||||
android:contentDescription="@string/custom_selector_limit_error_desc"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/menu_overflow"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0"
|
||||
app:layout_constraintStart_toEndOf="@id/title"
|
||||
app:srcCompat="@drawable/ic_error_red_24dp" />
|
||||
|
||||
<!-- Overflow Menu Icon (menu_overflow) -->
|
||||
<ImageButton
|
||||
android:id="@+id/menu_overflow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#00FFFFFF"
|
||||
android:padding="@dimen/standard_gap"
|
||||
android:contentDescription="@string/menu_overflow_desc"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0"
|
||||
app:srcCompat="@drawable/ic_error_red_24dp" />
|
||||
app:layout_constraintStart_toEndOf="@id/image_limit_error"
|
||||
app:srcCompat="@drawable/ic_overflow" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</merge>
|
||||
9
app/src/main/res/menu/menu_custom_selector.xml
Normal file
9
app/src/main/res/menu/menu_custom_selector.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/action_delete_folder"
|
||||
android:title="@string/custom_selector_delete_folder"
|
||||
android:icon="@drawable/ic_delete_grey_700_24dp"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
||||
|
|
@ -117,6 +117,7 @@
|
|||
<string name="categories_search_text_hint">Search categories</string>
|
||||
<string name="depicts_search_text_hint">Search for items that your media depicts (mountain, Taj Mahal, etc.)</string>
|
||||
<string name="menu_save_categories">Save</string>
|
||||
<string name="menu_overflow_desc">Overflow menu</string>
|
||||
<string name="refresh_button">Refresh</string>
|
||||
<string name="display_list_button">List</string>
|
||||
<string name="contributions_subtitle_zero">(No uploads yet)</string>
|
||||
|
|
@ -832,6 +833,17 @@ Upload your first media by tapping on the add button.</string>
|
|||
<string name="pending">Pending</string>
|
||||
<string name="failed">Failed</string>
|
||||
<string name="could_not_load_place_data">Could not load place data</string>
|
||||
|
||||
<string name="custom_selector_delete_folder">Delete Folder</string>
|
||||
<string name="custom_selector_confirm_deletion_title">Confirm Deletion</string>
|
||||
<string name="custom_selector_confirm_deletion_message">Are you sure you want to delete folder %1$s containing %2$d items?</string>
|
||||
<string name="custom_selector_delete">Delete</string>
|
||||
<string name="custom_selector_cancel">Cancel</string>
|
||||
<string name="custom_selector_folder_deleted_success">Folder %1$s deleted successfully</string>
|
||||
<string name="custom_selector_folder_deleted_failure">Failed to delete folder %1$s</string>
|
||||
<string name="custom_selector_error_trashing_folder_contents">Error in trashing folder contents: %1$s</string>
|
||||
<string name="custom_selector_folder_not_found_error">Failed to retrieve folder path for bucket ID: %1$d</string>
|
||||
|
||||
<string name="red_pin">This place has no picture yet, go take one!</string>
|
||||
<string name="green_pin">This place has a picture already.</string>
|
||||
<string name="grey_pin">Now checking whether this place has a picture.</string>
|
||||
|
|
|
|||
|
|
@ -51,6 +51,13 @@
|
|||
android:summary="@string/display_campaigns_explanation"
|
||||
android:title="@string/display_campaigns" />
|
||||
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="displayDeletionButton"
|
||||
app:singleLineTitle="false"
|
||||
android:summary="Enable the "Delete folder" button in the custom picker"
|
||||
android:title="Show Deletion Button" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue