From 4f9728e51d706caf7e40fb86591d6063f2d71e7b Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Oct 2020 19:12:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/widget/ArcView.kt | 5 ++--- .../java/io/legado/app/ui/widget/SearchView.kt | 5 ++--- .../app/ui/widget/anima/RefreshProgressBar.kt | 5 ++--- .../legado/app/ui/widget/anima/RotateLoading.kt | 5 ++--- .../legado/app/ui/widget/image/CoverImageView.kt | 6 ++---- .../legado/app/ui/widget/image/FilletImageView.kt | 5 ++--- .../io/legado/app/ui/widget/image/PhotoView.kt | 5 ++--- .../legado/app/ui/widget/recycler/LoadMoreView.kt | 3 ++- .../ui/widget/seekbar/VerticalSeekBarWrapper.kt | 5 ++--- .../io/legado/app/ui/widget/text/BadgeView.kt | 6 +++--- .../app/ui/widget/text/InertiaScrollTextView.kt | 15 ++++++--------- 11 files changed, 27 insertions(+), 38 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/ArcView.kt b/app/src/main/java/io/legado/app/ui/widget/ArcView.kt index 6338c6638..b92d552af 100644 --- a/app/src/main/java/io/legado/app/ui/widget/ArcView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/ArcView.kt @@ -8,9 +8,8 @@ import io.legado.app.R class ArcView @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : View(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : View(context, attrs) { private var mWidth = 0 private var mHeight = 0 diff --git a/app/src/main/java/io/legado/app/ui/widget/SearchView.kt b/app/src/main/java/io/legado/app/ui/widget/SearchView.kt index 82d24c671..975fe9d57 100644 --- a/app/src/main/java/io/legado/app/ui/widget/SearchView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/SearchView.kt @@ -18,9 +18,8 @@ import io.legado.app.R class SearchView @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : SearchView(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : SearchView(context, attrs) { private var mSearchHintIcon: Drawable? = null private var textView: TextView? = null diff --git a/app/src/main/java/io/legado/app/ui/widget/anima/RefreshProgressBar.kt b/app/src/main/java/io/legado/app/ui/widget/anima/RefreshProgressBar.kt index 1791b3be7..3a0af5b03 100644 --- a/app/src/main/java/io/legado/app/ui/widget/anima/RefreshProgressBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/anima/RefreshProgressBar.kt @@ -14,9 +14,8 @@ import io.legado.app.R @Suppress("unused", "MemberVisibilityCanBePrivate") class RefreshProgressBar @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : View(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : View(context, attrs) { private var a = 1 private var durProgress = 0 private var secondDurProgress = 0 diff --git a/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt b/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt index e587da788..634f9689e 100644 --- a/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt +++ b/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt @@ -20,9 +20,8 @@ import io.legado.app.utils.dp @Suppress("MemberVisibilityCanBePrivate") class RotateLoading @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : View(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : View(context, attrs) { private var mPaint: Paint diff --git a/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt b/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt index 5a85a0573..d09eae0dd 100644 --- a/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt @@ -22,12 +22,10 @@ import io.legado.app.utils.getPrefString @Suppress("unused") class CoverImageView @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 + attrs: AttributeSet? = null ) : androidx.appcompat.widget.AppCompatImageView( context, - attrs, - defStyleAttr + attrs ) { internal var width: Float = 0.toFloat() internal var height: Float = 0.toFloat() diff --git a/app/src/main/java/io/legado/app/ui/widget/image/FilletImageView.kt b/app/src/main/java/io/legado/app/ui/widget/image/FilletImageView.kt index 57428fe47..eefcdafc8 100644 --- a/app/src/main/java/io/legado/app/ui/widget/image/FilletImageView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/image/FilletImageView.kt @@ -12,9 +12,8 @@ import kotlin.math.max class FilletImageView @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : AppCompatImageView(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : AppCompatImageView(context, attrs) { internal var width: Float = 0.toFloat() internal var height: Float = 0.toFloat() private var leftTopRadius: Int = 0 diff --git a/app/src/main/java/io/legado/app/ui/widget/image/PhotoView.kt b/app/src/main/java/io/legado/app/ui/widget/image/PhotoView.kt index 08cc63e3a..5d80f087e 100644 --- a/app/src/main/java/io/legado/app/ui/widget/image/PhotoView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/image/PhotoView.kt @@ -27,9 +27,8 @@ import kotlin.math.roundToInt @Suppress("UNUSED_PARAMETER", "unused", "MemberVisibilityCanBePrivate", "PropertyName") class PhotoView @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : AppCompatImageView(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : AppCompatImageView(context, attrs) { val MIN_ROTATE = 35 val ANIMA_DURING = 340 val MAX_SCALE = 2.5f diff --git a/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt index 57df4f6e0..ed62431e1 100644 --- a/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt @@ -1,6 +1,7 @@ package io.legado.app.ui.widget.recycler import android.content.Context +import android.util.AttributeSet import android.view.View import android.view.ViewGroup import android.widget.FrameLayout @@ -10,7 +11,7 @@ import io.legado.app.utils.visible import kotlinx.android.synthetic.main.view_load_more.view.* @Suppress("unused") -class LoadMoreView(context: Context) : FrameLayout(context) { +class LoadMoreView(context: Context, attrs: AttributeSet? = null) : FrameLayout(context, attrs) { var hasMore = true private set diff --git a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBarWrapper.kt b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBarWrapper.kt index da69c33ab..683953f1a 100644 --- a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBarWrapper.kt +++ b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBarWrapper.kt @@ -13,9 +13,8 @@ import kotlin.math.max class VerticalSeekBarWrapper @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : FrameLayout(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : FrameLayout(context, attrs) { private val childSeekBar: VerticalSeekBar? get() { diff --git a/app/src/main/java/io/legado/app/ui/widget/text/BadgeView.kt b/app/src/main/java/io/legado/app/ui/widget/text/BadgeView.kt index c24e13e87..353fa9de4 100644 --- a/app/src/main/java/io/legado/app/ui/widget/text/BadgeView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/text/BadgeView.kt @@ -24,11 +24,11 @@ import io.legado.app.utils.visible /** * Created by milad heydari on 5/6/2016. */ +@Suppress("MemberVisibilityCanBePrivate", "unused") class BadgeView @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyle: Int = android.R.attr.textViewStyle -) : AppCompatTextView(context, attrs, defStyle) { + attrs: AttributeSet? = null +) : AppCompatTextView(context, attrs) { var isHideOnNull = true set(hideOnNull) { diff --git a/app/src/main/java/io/legado/app/ui/widget/text/InertiaScrollTextView.kt b/app/src/main/java/io/legado/app/ui/widget/text/InertiaScrollTextView.kt index 051d5af4e..9644b8676 100644 --- a/app/src/main/java/io/legado/app/ui/widget/text/InertiaScrollTextView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/text/InertiaScrollTextView.kt @@ -15,14 +15,11 @@ import kotlin.math.max import kotlin.math.min -open class InertiaScrollTextView : AppCompatTextView { - constructor(context: Context) : super(context) - - constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) - - constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) - : super(context, attrs, defStyleAttr) - +@Suppress("unused") +open class InertiaScrollTextView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null +) : AppCompatTextView(context, attrs) { private val scrollStateIdle = 0 private val scrollStateDragging = 1 @@ -218,7 +215,7 @@ open class InertiaScrollTextView : AppCompatTextView { } } - internal fun postOnAnimation() { + fun postOnAnimation() { if (mEatRunOnAnimationRequest) { mReSchedulePostAnimationCallback = true } else {