From e94e405b80da4a65bcf31e25cc8845749d3a9851 Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 7 May 2020 17:45:04 -0400 Subject: [PATCH] Adding fast scroll to d/l queue Also fixed fast scroll bubbles with long titles closes #270 --- .../tachiyomi/ui/download/DownloadAdapter.kt | 4 ++++ .../ui/download/DownloadBottomSheet.kt | 5 +++-- .../main/res/layout/download_bottom_sheet.xml | 21 ++++++++++++------- .../main/res/layout/material_fastscroll.xml | 21 ++++++++++++++----- 4 files changed, 37 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadAdapter.kt index f8a7cc32bb..4e81ecb29b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadAdapter.kt @@ -29,4 +29,8 @@ class DownloadAdapter(controller: DownloadItemListener) : FlexibleAdapter - dl_recycler.updateLayoutParams { + recycler_layout.doOnApplyWindowInsets { v, windowInsets, _ -> + v.updateLayoutParams { topMargin = windowInsets.systemWindowInsetTop + headerHeight - sheet_layout.height } } diff --git a/app/src/main/res/layout/download_bottom_sheet.xml b/app/src/main/res/layout/download_bottom_sheet.xml index 31a0934b9f..a2b57f02ce 100644 --- a/app/src/main/res/layout/download_bottom_sheet.xml +++ b/app/src/main/res/layout/download_bottom_sheet.xml @@ -16,9 +16,9 @@ android:id="@+id/sheet_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical" android:background="@drawable/bottom_sheet_rounded_background" android:backgroundTint="?attr/colorPrimaryVariant" + android:orientation="vertical" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -44,9 +44,9 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginStart="10dp" + android:layout_marginTop="6dp" android:layout_marginEnd="10dp" android:layout_marginBottom="10dp" - android:layout_marginTop="6dp" android:ellipsize="end" android:gravity="center" android:maxLines="1" @@ -57,22 +57,29 @@ + android:layout_height="match_parent" + android:background="?android:attr/colorBackground"> + tools:listitem="@layout/download_item" /> + android:visibility="gone" /> + + \ No newline at end of file diff --git a/app/src/main/res/layout/material_fastscroll.xml b/app/src/main/res/layout/material_fastscroll.xml index 2629326880..4b83ba20d1 100644 --- a/app/src/main/res/layout/material_fastscroll.xml +++ b/app/src/main/res/layout/material_fastscroll.xml @@ -1,6 +1,7 @@ @@ -11,8 +12,8 @@ android:layout_gravity="end" android:background="@android:color/transparent"/> - @@ -21,10 +22,17 @@ style="@style/FloatingTextView" android:id="@+id/fast_scroller_bubble" android:layout_gravity="end|center_vertical" - android:layout_toStartOf="@+id/fast_scroller_handle" + app:layout_constraintEnd_toStartOf="@+id/fast_scroller_handle" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" android:gravity="center" + app:layout_constrainedWidth="true" + android:layout_marginStart="52dp" + app:layout_constraintStart_toStartOf="parent" + android:maxLines="5" android:visibility="gone" - tools:text="A" + app:layout_constraintHorizontal_bias="1.0" + tools:text="sdfs fas d fsA" tools:visibility="visible"/> @@ -34,10 +42,13 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:contentDescription="@null" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" android:paddingStart="6dp" android:paddingEnd="4dp" android:src="@drawable/thumb_drawable"/> - + \ No newline at end of file