mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-11 10:39:08 +01:00
Cleaning up the library xml
This commit is contained in:
parent
f78daf7156
commit
271db63db8
@ -358,7 +358,7 @@ class LibraryController(
|
|||||||
|
|
||||||
elevateAppBar =
|
elevateAppBar =
|
||||||
scrollViewWith(recycler, swipeRefreshLayout = swipe_refresh, afterInsets = { insets ->
|
scrollViewWith(recycler, swipeRefreshLayout = swipe_refresh, afterInsets = { insets ->
|
||||||
category_layout?.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
category_recycler?.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
topMargin = recycler?.paddingTop ?: 0
|
topMargin = recycler?.paddingTop ?: 0
|
||||||
}
|
}
|
||||||
fast_scroller?.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
fast_scroller?.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
@ -802,15 +802,16 @@ class LibraryController(
|
|||||||
private fun showCategories(show: Boolean) {
|
private fun showCategories(show: Boolean) {
|
||||||
recycler_cover.isClickable = show
|
recycler_cover.isClickable = show
|
||||||
recycler_cover.isFocusable = show
|
recycler_cover.isFocusable = show
|
||||||
val full = category_layout.height.toFloat() + recycler.paddingTop
|
val full = category_recycler.height.toFloat() + recycler.paddingTop
|
||||||
val translateY = if (show) full else 0f
|
val translateY = if (show) full else 0f
|
||||||
recycler.animate().translationY(translateY).start()
|
recycler.animate().translationY(translateY).start()
|
||||||
category_hopper_frame.animate().translationY(translateY).start()
|
category_hopper_frame.animate().translationY(translateY).start()
|
||||||
recycler_shadow.animate().translationY(translateY + 12.dpToPx).start()
|
recycler_shadow.animate().translationY(translateY - 8.dpToPx).start()
|
||||||
recycler_cover.animate().translationY(translateY).start()
|
recycler_cover.animate().translationY(translateY).start()
|
||||||
recycler_cover.animate().alpha(if (show) 0.75f else 0f).start()
|
recycler_cover.animate().alpha(if (show) 0.75f else 0f).start()
|
||||||
recycler.suppressLayout(show)
|
recycler.suppressLayout(show)
|
||||||
activity?.toolbar?.showDropdown(!show)
|
activity?.toolbar?.showDropdown(!show)
|
||||||
|
swipe_refresh.isEnabled = !show
|
||||||
setTitle()
|
setTitle()
|
||||||
if (show) {
|
if (show) {
|
||||||
category_recycler.scrollToCategory(activeCategory)
|
category_recycler.scrollToCategory(activeCategory)
|
||||||
|
@ -70,9 +70,8 @@ class CategoryRecyclerView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onMeasure(widthSpec: Int, heightSpec: Int) {
|
override fun onMeasure(widthSpec: Int, heightSpec: Int) {
|
||||||
val recyclerView = (parent as ViewGroup)
|
val mainView = (parent.parent.parent as ViewGroup)
|
||||||
val mainView = (parent.parent.parent.parent as ViewGroup)
|
val top = marginTop
|
||||||
val top = recyclerView.marginTop
|
|
||||||
val parent = mainView.measuredHeight - top - 100.dpToPx
|
val parent = mainView.measuredHeight - top - 100.dpToPx
|
||||||
val heightS = if (parent > 0) {
|
val heightS = if (parent > 0) {
|
||||||
MeasureSpec.makeMeasureSpec(parent, MeasureSpec.AT_MOST)
|
MeasureSpec.makeMeasureSpec(parent, MeasureSpec.AT_MOST)
|
||||||
|
@ -17,32 +17,19 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<FrameLayout
|
||||||
android:id="@+id/recycler_layout"
|
android:id="@+id/recycler_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<eu.kanade.tachiyomi.ui.library.category.CategoryRecyclerView
|
||||||
android:id="@+id/category_layout"
|
android:id="@+id/category_recycler"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="?actionBarSize"
|
android:layout_marginTop="?actionBarSize"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
|
||||||
<eu.kanade.tachiyomi.ui.library.category.CategoryRecyclerView
|
|
||||||
android:id="@+id/category_recycler"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:paddingBottom="4dp"
|
android:paddingBottom="4dp"
|
||||||
android:scrollbars="vertical"
|
android:scrollbars="vertical" />
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/recycler_shadow"
|
android:id="@+id/recycler_shadow"
|
||||||
@ -55,12 +42,7 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<include
|
<include layout="@layout/library_grid_recycler" />
|
||||||
layout="@layout/library_grid_recycler"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/recycler_cover"
|
android:id="@+id/recycler_cover"
|
||||||
@ -68,12 +50,8 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:alpha="0"
|
android:alpha="0"
|
||||||
android:background="@drawable/bottom_sheet_rounded_background"
|
android:background="@drawable/bottom_sheet_rounded_background"
|
||||||
android:backgroundTint="?android:textColorPrimaryInverse"
|
android:backgroundTint="?android:textColorPrimaryInverse" />
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
</FrameLayout>
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user