mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
[GSoC 2022] Improve custom picker (all features) (#5035)
* Project Initiated by creating helper classes for database operations * Database created * Rest of the work and documentation * Requested changes done * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * [GSoC] Insert and Remove Images from not for upload (#4999) * Inserted and marked images as not for upload * Documentation added * Test delete * Implemented remove from not for upload * Test fixed * Requested changes done * Added tests for new lines in existing classes * [GSoC] Added Bubble Scroll (#5023) * Library added * Bubble scroll implemented * Left and right swipe * Requested changes * [GSoC] Hide/Unhide actioned pictures and change numbering (#5012) * Changed numbering of marked images * Hide Unhide implemented * Test fixed * Improved speed for database operation * Improved speed for database operation * Changed progress dialog * Improved hiding speed * Test fixed * Fixed bug * Fixed bug and improved performance * Fixed bug and improved performance * Test fixed * Bug fixed * Bug fixed * Bug fixed * Bug fixed * Bug fixed * Code clean up * Test hiding images * Test hiding images * Test hiding images * Code clean up and test fixed * Fixed layout * Fixed bug * Bug fixed * Renamed method * Documentation added explaining logic * Documentation added explaining logic * [GSoC] Full Screen Mode (#5032) * Gesture detection implemented * Left and right swipe * Selection implemented * onDown implemented * onDown implemented * FS mode implemented * OnSwipe doc * Scope cancel * Added label in Manifest * Merged two features * Requested changes * Image uploaded bug fixed * Increased DB version * Made requested changes * Made requested changes * Made requested changes * Made requested changes * Solved image flashing bug * Solved image flashing bug * Requested changes * Requested changes * Changed name of a function * Fixed transaction failure on large number of images * Tested with isIdentity * Tested with isIdentity * Increased the threshold * Added info dialog * Minor changes * ImageAdapter Test * CustomSelectorActivity Test * Requested changes * Test for ZoomableActivity * Test for ZoomableActivity * Test for ImageLoader * Test for OnSwipeTouchListener * Test for rest * Reverted some test changes * Added more tests for ImageAdapter * Added more tests for ImageAdapter and swipe gesture Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
This commit is contained in:
parent
b5ffe7120c
commit
33679eb6b4
41 changed files with 2560 additions and 284 deletions
6
app/src/main/res/drawable/not_for_upload.xml
Normal file
6
app/src/main/res/drawable/not_for_upload.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#D50000" android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp">
|
||||
|
||||
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM4,12c0,-4.42 3.58,-8 8,-8 1.85,0 3.55,0.63 4.9,1.69L5.69,16.9C4.63,15.55 4,13.85 4,12zM12,20c-1.85,0 -3.55,-0.63 -4.9,-1.69L18.31,7.1C19.37,8.45 20,10.15 20,12c0,4.42 -3.58,8 -8,8z"/>
|
||||
|
||||
</vector>
|
||||
|
|
@ -13,7 +13,12 @@
|
|||
android:id="@+id/fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/bottom_layout"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar_layout"/>
|
||||
|
||||
<include
|
||||
layout="@layout/custom_selector_bottom_layout"
|
||||
android:id="@+id/bottom_sheet"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -23,4 +23,21 @@
|
|||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/selection_count"
|
||||
android:layout_width="@dimen/dimen_20"
|
||||
android:layout_height="@dimen/dimen_20"
|
||||
app:layout_constraintDimensionRatio="H,1:1"
|
||||
android:textSize="@dimen/subtitle_text"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:layout_margin="@dimen/dimen_6"
|
||||
android:gravity="center|center_vertical"
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:text="12"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/circle_shape"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
|||
49
app/src/main/res/layout/custom_selector_bottom_layout.xml
Normal file
49
app/src/main/res/layout/custom_selector_bottom_layout.xml
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/bottom_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/not_for_upload"
|
||||
android:layout_width="@dimen/dimen_0"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/mark_as_not_for_upload"
|
||||
android:textColor="@color/white"
|
||||
android:visibility="visible"
|
||||
android:layout_margin="@dimen/dimen_5"
|
||||
app:layout_constraintBottom_toBottomOf="@id/bottom_layout"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline3"
|
||||
app:layout_constraintStart_toStartOf="@id/bottom_layout"
|
||||
app:layout_constraintTop_toTopOf="@id/bottom_layout" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/upload"
|
||||
android:layout_width="@dimen/dimen_0"
|
||||
android:layout_height="@dimen/dimen_0"
|
||||
android:text="@string/upload"
|
||||
android:textColor="@color/white"
|
||||
android:visibility="visible"
|
||||
android:layout_margin="@dimen/dimen_5"
|
||||
app:layout_constraintBottom_toBottomOf="@id/bottom_layout"
|
||||
app:layout_constraintEnd_toEndOf="@id/bottom_layout"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline3"
|
||||
app:layout_constraintTop_toTopOf="@id/bottom_layout" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</merge>
|
||||
|
|
@ -28,8 +28,9 @@
|
|||
android:textAlignment="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dimen_20"
|
||||
app:layout_constraintStart_toEndOf="@id/back"
|
||||
app:layout_constraintEnd_toStartOf="@id/done"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:singleLine="true"
|
||||
|
|
@ -37,20 +38,5 @@
|
|||
android:text="@string/custom_selector_title"
|
||||
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/done"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:clickable="true"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:focusable="true"
|
||||
android:padding="@dimen/standard_gap"
|
||||
app:srcCompat="?attr/custom_selector_done"
|
||||
android:visibility="invisible"
|
||||
android:contentDescription="@string/done" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</merge>
|
||||
|
|
@ -3,13 +3,37 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?attr/mainBackground">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
<Switch
|
||||
android:id="@+id/switchWidget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:text="@string/show_already_actioned_pictures"
|
||||
android:padding="@dimen/dimen_10"
|
||||
android:checked="true" />
|
||||
|
||||
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
|
||||
android:id="@+id/selector_rv"
|
||||
android:background="?attr/mainBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/mainBackground"
|
||||
android:layout_height="@dimen/dimen_0"
|
||||
app:fastScrollPopupBgColor="@color/primaryColor"
|
||||
app:fastScrollPopupTextColor="@android:color/primary_text_dark"
|
||||
app:fastScrollPopupTextSize="@dimen/subheading_text_size"
|
||||
app:fastScrollPopupBackgroundSize="@dimen/bubble_size"
|
||||
app:fastScrollThumbColor="@color/primaryColor"
|
||||
app:fastScrollTrackColor="@color/upload_overlay_background_light"
|
||||
app:fastScrollPopupPosition="adjacent"
|
||||
app:layout_constraintBottom_toTopOf="@id/progressLayout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/switchWidget"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
|
|
@ -38,4 +62,41 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/progressLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/dimen_5"
|
||||
android:background="@color/drawerHeader_background_light"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/selector_rv">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/hiding_already_actioned_pictures"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/dimen_5"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintTop_toBottomOf="@id/text"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
54
app/src/main/res/layout/full_screen_mode_info_dialog.xml
Normal file
54
app/src/main/res/layout/full_screen_mode_info_dialog.xml
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_margin="@dimen/dimen_10">
|
||||
|
||||
<ScrollView
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
|
||||
android:text="@string/welcome_to_full_screen_mode_text"
|
||||
android:textSize="@dimen/normal_text"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dimen_10"
|
||||
android:text="@string/full_screen_mode_zoom_info"
|
||||
android:textSize="@dimen/description_text_size"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dimen_10"
|
||||
android:layout_marginEnd="@dimen/dimen_10"
|
||||
android:layout_marginStart="@dimen/dimen_10"
|
||||
android:text="@string/full_screen_mode_features_info"
|
||||
android:textSize="@dimen/description_text_size"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btn_ok"
|
||||
android:layout_marginHorizontal="@dimen/dimen_40"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/welcome_custom_selector_ok"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -82,6 +82,23 @@
|
|||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="uploaded_overlay,uploaded_overlay_icon"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/not_for_upload_overlay_icon"
|
||||
android:layout_width="@dimen/dimen_50"
|
||||
android:layout_height="@dimen/dimen_50"
|
||||
android:paddingBottom="@dimen/dimen_20"
|
||||
android:paddingEnd="@dimen/dimen_20"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:srcCompat="@drawable/not_for_upload"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/not_for_upload_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="selected_overlay,not_for_upload_overlay_icon"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
<dimen name="progressbar_stroke">3dp</dimen>
|
||||
<dimen name="notification_width">110dp</dimen>
|
||||
<dimen name="notification_height">160dp</dimen>
|
||||
<dimen name="bubble_size">36dp</dimen>
|
||||
|
||||
<!-- Text sizes -->
|
||||
<dimen name="heading_text_size">24sp</dimen>
|
||||
|
|
@ -59,11 +60,13 @@
|
|||
<!-- Commonly used dimensions -->
|
||||
<dimen name="dimen_0">0dp</dimen>
|
||||
<dimen name="dimen_2">2dp</dimen>
|
||||
<dimen name="dimen_5">5dp</dimen>
|
||||
<dimen name="dimen_6">6dp</dimen>
|
||||
<dimen name="dimen_10">10dp</dimen>
|
||||
<dimen name="dimen_20">20dp</dimen>
|
||||
<dimen name="dimen_40">40dp</dimen>
|
||||
<dimen name="dimen_42">42dp</dimen>
|
||||
<dimen name="dimen_50">50dp</dimen>
|
||||
<dimen name="dimen_250">250dp</dimen>
|
||||
<dimen name="dimen_150">150dp</dimen>
|
||||
<dimen name="dimen_72">72dp</dimen>
|
||||
|
|
|
|||
|
|
@ -734,9 +734,21 @@ Upload your first media by tapping on the add button.</string>
|
|||
<string name="error_feedback">Error while sending feedback</string>
|
||||
<string name="enter_description">What is your feedback?</string>
|
||||
<string name="your_feedback">Your feedback</string>
|
||||
<string name="mark_as_not_for_upload">Mark as not for upload</string>
|
||||
<string name="unmark_as_not_for_upload">Unmark as not for upload</string>
|
||||
<string name="show_already_actioned_pictures">Show already actioned pictures</string>
|
||||
<string name="hiding_already_actioned_pictures">Hiding already actioned pictures</string>
|
||||
<string name="no_more_images_found">No more images found</string>
|
||||
<string name="this_image_is_already_uploaded">This image is already uploaded</string>
|
||||
<string name="can_not_select_this_image_for_upload">Can not select this image for upload</string>
|
||||
<string name="image_selected">Image selected</string>
|
||||
<string name="image_marked_as_not_for_upload">Image marked as not for upload</string>
|
||||
<string name="menu_view_report">Report</string>
|
||||
<string name="report_violation">Report violation</string>
|
||||
<string name="report_user">Report this user</string>
|
||||
<string name="report_content">Report this content</string>
|
||||
<string name="request_user_block">Request to block this user</string>
|
||||
<string name="welcome_to_full_screen_mode_text">Welcome to Full-Screen Selection Mode</string>
|
||||
<string name="full_screen_mode_zoom_info">Use two fingers to zoom in and out.</string>
|
||||
<string name="full_screen_mode_features_info">Swipe fast and long to perform these actions: \n- Left/Right: Go to previous/next \n- Up: Select\n- Down: Mark as not for upload.</string>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue