From 1557f713f42739f76fd9808d18d4b914132becff Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 7 Feb 2021 10:49:08 -0500 Subject: [PATCH] Don't restrict filter sheet height anymore --- .../tachiyomi/widget/MaxHeightViewPager.kt | 29 ------------------- .../main/res/layout/common_tabbed_sheet.xml | 2 +- 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 app/src/main/java/eu/kanade/tachiyomi/widget/MaxHeightViewPager.kt diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/MaxHeightViewPager.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/MaxHeightViewPager.kt deleted file mode 100644 index f6e609d48..000000000 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/MaxHeightViewPager.kt +++ /dev/null @@ -1,29 +0,0 @@ -package eu.kanade.tachiyomi.widget - -import android.content.Context -import android.util.AttributeSet -import androidx.core.view.forEach -import androidx.viewpager.widget.ViewPager - -/** - * A [ViewPager] that sets its height to the maximum height of its children. - * This is a way to mimic WRAP_CONTENT for its height. - */ -class MaxHeightViewPager(context: Context, attrs: AttributeSet?) : ViewPager(context, attrs) { - - override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { - var measuredHeight = heightMeasureSpec - - var height = 0 - forEach { - it.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)) - val h = it.measuredHeight - if (h > height) height = h - } - if (height != 0) { - measuredHeight = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY) - } - - super.onMeasure(widthMeasureSpec, measuredHeight) - } -} diff --git a/app/src/main/res/layout/common_tabbed_sheet.xml b/app/src/main/res/layout/common_tabbed_sheet.xml index 7ae742052..5a8360616 100644 --- a/app/src/main/res/layout/common_tabbed_sheet.xml +++ b/app/src/main/res/layout/common_tabbed_sheet.xml @@ -43,7 +43,7 @@ -