From 55bdd3b4d61f9188bc94c49a93e5dc4f9e9cc623 Mon Sep 17 00:00:00 2001 From: Jay Date: Sat, 22 Feb 2020 17:51:57 -0800 Subject: [PATCH] More fixes to category header --- .../tachiyomi/ui/library/LibraryHeaderItem.kt | 9 +- .../layout/library_category_header_item.xml | 101 +++++++++--------- 2 files changed, 56 insertions(+), 54 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderItem.kt index eedb5e6aa0..862cc5f96b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderItem.kt @@ -21,7 +21,6 @@ import eu.kanade.tachiyomi.data.library.LibraryUpdateService import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.system.launchUI import eu.kanade.tachiyomi.util.view.gone -import eu.kanade.tachiyomi.util.view.invisible import eu.kanade.tachiyomi.util.view.visible import kotlinx.android.synthetic.main.library_category_header_item.view.* @@ -104,18 +103,18 @@ class LibraryHeaderItem(private val categoryF: (Int) -> Category, val catId: Int adapter.mode == SelectableAdapter.Mode.MULTI -> { checkboxImage.visible() catProgress.gone() - updateButton.invisible() + updateButton.gone() setSelection() } category.id == -1 -> { checkboxImage.gone() catProgress.gone() - updateButton.invisible() + updateButton.gone() } LibraryUpdateService.categoryInQueue(category.id) -> { checkboxImage.gone() catProgress.visible() - updateButton.invisible() + updateButton.gone() } else -> { checkboxImage.gone() @@ -127,7 +126,7 @@ class LibraryHeaderItem(private val categoryF: (Int) -> Category, val catId: Int private fun addCategoryToUpdate() { if (adapter.libraryListener.updateCategory(adapterPosition)) { - updateButton.invisible() + updateButton.gone() launchUI { adapter.notifyItemChanged(adapterPosition) } diff --git a/app/src/main/res/layout/library_category_header_item.xml b/app/src/main/res/layout/library_category_header_item.xml index 20e81e0b75..d95c463666 100644 --- a/app/src/main/res/layout/library_category_header_item.xml +++ b/app/src/main/res/layout/library_category_header_item.xml @@ -6,52 +6,47 @@ android:layout_height="wrap_content" android:gravity="center_vertical"> + + + - - @@ -86,25 +78,36 @@ android:layout_marginStart="10dp" android:indeterminate="true" app:layout_constraintBottom_toBottomOf="@+id/category_title" + app:layout_constraintEnd_toStartOf="@+id/category_sort" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toEndOf="@+id/category_title" app:layout_constraintTop_toTopOf="@+id/category_title" /> - - + android:layout_marginEnd="10dp" + android:clickable="true" + android:drawableEnd="@drawable/ic_sort_white_24dp" + android:drawablePadding="6dp" + android:layout_marginBottom="4dp" + android:drawableTint="@color/gray_button" + android:ellipsize="none" + android:focusable="true" + android:gravity="center|end" + android:textAlignment="textEnd" + android:maxLines="3" + android:padding="6dp" + android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" + android:textColor="?android:attr/textColorPrimary" + android:textSize="12sp" + android:textStyle="normal" + app:layout_constrainedWidth="true" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="1.0" + app:layout_constraintStart_toEndOf="@id/space" + app:layout_constraintWidth_min="80dp" + tools:text="Drag and Drop" /> \ No newline at end of file