From 92fe48720c2b0cd0051b4cf5e102b568f7f1105b Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 10 Sep 2020 01:03:35 +0200 Subject: [PATCH] Removed unused MaxHeightScrollView --- .../ui/android/views/MaxHeightScrollView.kt | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/MaxHeightScrollView.kt diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/MaxHeightScrollView.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/MaxHeightScrollView.kt deleted file mode 100644 index ba93ede2..00000000 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/MaxHeightScrollView.kt +++ /dev/null @@ -1,42 +0,0 @@ -package net.dankito.banking.ui.android.views - -import android.content.Context -import android.util.AttributeSet -import android.widget.ScrollView - - -open class MaxHeightScrollView @JvmOverloads constructor( - context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : ScrollView(context, attrs, defStyleAttr) { - - companion object { - const val DisableMaxHeight = -1 - } - - - open var maxHeightInPixel = DisableMaxHeight - protected set - - - open fun setMaxHeightInDp(maxHeightInDp: Int) { - val density = resources.displayMetrics.density - maxHeightInPixel = (maxHeightInDp * density).toInt() - } - - open fun disableMaxHeight() { - maxHeightInPixel = DisableMaxHeight - } - - - override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { - if (maxHeightInPixel >= 0) { - val adjustedHeightMeasureSpec = MeasureSpec.makeMeasureSpec(maxHeightInPixel, MeasureSpec.AT_MOST) - - super.onMeasure(widthMeasureSpec, adjustedHeightMeasureSpec) - } - else { - super.onMeasure(widthMeasureSpec, heightMeasureSpec) - } - } - -} \ No newline at end of file