Fixes 4620 : Editing categories of an existing picture: Reuse categories selection UI from the Upload Wizard (#4928)

* Entry to new UI

* Getting existing categories

* Hidden categories managed

* Category edit updated

* Category Edition implemented

* Java docs added

* Java docs added

* Java docs added

* Previous UI discarded

* Test added

* More test added

* More test added

* More test added

* More test added

* More java docs added

* Minor changes
This commit is contained in:
Ayan Sarkar 2022-04-11 16:00:21 +05:30 committed by GitHub
parent 48343035d3
commit 11292ab514
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 977 additions and 913 deletions

View file

@ -9,20 +9,6 @@
android:id="@+id/mediaDetailFrameLayout"
>
<LinearLayout
android:id="@+id/dummy_category_edit_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="35dp"
android:layout_gravity="bottom"
android:visibility="gone"
android:orientation="vertical"
android:weightSum="10">
<include
layout="@layout/layout_edit_categories" />
</LinearLayout>
<LinearLayout
android:id="@+id/dummy_caption_description_container"
android:layout_width="match_parent"
@ -368,14 +354,39 @@
</LinearLayout>
<Button
android:id="@+id/categoryEditButton"
android:layout_width="24dp"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_margin="@dimen/standard_gap"
android:layout_gravity="end"
android:background="@drawable/ic_baseline_edit_24" />
android:layout_margin="@dimen/standard_gap">
<ProgressBar
android:id="@+id/progressBarEditCategory"
style="?android:progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/tiny_gap"
android:layout_marginRight="@dimen/tiny_gap"
android:layout_gravity="center_vertical|end"
android:indeterminate="true"
android:indeterminateOnly="true"
android:visibility="gone"
tools:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/mediaDetailCategoryContainer"
app:layout_constraintBottom_toTopOf="@id/mediaDetailuploadeddate" />
<Button
android:id="@+id/categoryEditButton"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="end"
android:visibility="gone"
android:background="@drawable/ic_baseline_edit_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/mediaDetailCategoryContainer"
app:layout_constraintBottom_toTopOf="@id/mediaDetailuploadeddate"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
style="@style/MediaDetailContainer"
android:layout_width="match_parent"

View file

@ -1,119 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:id="@+id/category_edit_layout"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:orientation="vertical"
android:background="?attr/mainBackground"
android:elevation="30dp">
<TextView
android:id="@+id/tv_subtitle"
android:layout_width="wrap_content"
android:layout_height="@dimen/half_standard_height"
android:layout_margin="@dimen/quarter_standard_height"
android:gravity="center_vertical"
android:text="Type categories"
android:textSize="@dimen/subtitle_text"
android:visibility="visible" />
<FrameLayout
android:id="@+id/category_search_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_gap"
>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_container_search"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<SearchView
android:id="@+id/et_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:queryHint="@string/categories_search_text_hint"
android:iconifiedByDefault="false"
android:imeOptions="actionSearch"
android:inputType="text"
android:maxLines="1"/>
</com.google.android.material.textfield.TextInputLayout>
<ProgressBar
android:id="@+id/pb_categories"
style="?android:progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/tiny_gap"
android:layout_marginRight="@dimen/tiny_gap"
android:layout_gravity="center_vertical|end"
android:indeterminate="true"
android:indeterminateOnly="true"
android:visibility="gone" />
</FrameLayout>
<TextView
android:id="@+id/existing_categories"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/quarter_standard_height"
android:gravity="center_vertical"
android:textSize="@dimen/subtitle_text"
android:visibility="visible" />
<TextView
android:id="@+id/no_results_found"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/quarter_standard_height"
android:gravity="center_vertical"
android:text="No results found"
android:textSize="@dimen/description_text_size"
android:visibility="gone" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_categories"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen_200"
android:background="?attr/mainBackground"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/cancel_categories_button"
android:layout_width="wrap_content"
android:layout_margin="@dimen/quarter_standard_height"
android:layout_height="wrap_content"
android:text="@string/cancel"
android:padding="@dimen/small_gap"
android:textColor="@color/white"
android:background="@color/opak_middle_grey"
/>
<Button
android:id="@+id/update_categories_button"
android:layout_width="wrap_content"
android:layout_margin="@dimen/quarter_standard_height"
android:layout_height="wrap_content"
android:text="@string/category_edit_button_text"
android:padding="@dimen/small_gap"
android:textColor="@color/white"
android:background="@color/button_blue"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>

View file

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/category_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<CheckBox
android:id="@+id/category_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checkMark="?android:attr/textCheckMark"
android:checked="false"
android:gravity="center_vertical"
android:padding="@dimen/tiny_gap"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/category_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Category"
app:layout_constraintLeft_toRightOf="@+id/category_checkbox"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -6,6 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/standard_gap"
android:background="?attr/mainBackground"
>
<LinearLayout
android:layout_width="match_parent"