diff --git a/app/src/main/java/io/legado/app/ui/widget/dynamiclayout/DynamicFrameLayout.kt b/app/src/main/java/io/legado/app/ui/widget/dynamiclayout/DynamicFrameLayout.kt index 99e0cd702..683cbc5d9 100644 --- a/app/src/main/java/io/legado/app/ui/widget/dynamiclayout/DynamicFrameLayout.kt +++ b/app/src/main/java/io/legado/app/ui/widget/dynamiclayout/DynamicFrameLayout.kt @@ -12,6 +12,7 @@ import androidx.appcompat.widget.AppCompatTextView import io.legado.app.R import kotlinx.android.synthetic.main.view_dynamic.view.* +@Suppress("unused") class DynamicFrameLayout(context: Context, attrs: AttributeSet?) : FrameLayout(context, attrs), ViewSwitcher { private var errorView: View? = null diff --git a/app/src/main/java/io/legado/app/ui/widget/number/NumberPickerDialog.kt b/app/src/main/java/io/legado/app/ui/widget/number/NumberPickerDialog.kt index 3b4c8f5db..91dd8ffa3 100644 --- a/app/src/main/java/io/legado/app/ui/widget/number/NumberPickerDialog.kt +++ b/app/src/main/java/io/legado/app/ui/widget/number/NumberPickerDialog.kt @@ -48,7 +48,7 @@ class NumberPickerDialog(context: Context) { listener?.invoke() } } - return this; + return this } fun show(callBack: ((value: Int) -> Unit)?) { diff --git a/app/src/main/java/io/legado/app/ui/widget/prefs/ColorPreference.kt b/app/src/main/java/io/legado/app/ui/widget/prefs/ColorPreference.kt index 8f293eebb..468f4ce71 100644 --- a/app/src/main/java/io/legado/app/ui/widget/prefs/ColorPreference.kt +++ b/app/src/main/java/io/legado/app/ui/widget/prefs/ColorPreference.kt @@ -16,6 +16,7 @@ import com.jaredrummler.android.colorpicker.* import io.legado.app.lib.theme.ATH import io.legado.app.utils.ColorUtils +@Suppress("MemberVisibilityCanBePrivate", "unused") class ColorPreference(context: Context, attrs: AttributeSet) : Preference(context, attrs), ColorPickerDialogListener { diff --git a/app/src/main/java/io/legado/app/ui/widget/recycler/DividerNoLast.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/DividerNoLast.kt index 5c9e38e4d..92ac1a672 100644 --- a/app/src/main/java/io/legado/app/ui/widget/recycler/DividerNoLast.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/DividerNoLast.kt @@ -14,6 +14,7 @@ import kotlin.math.roundToInt /** * 不画最后一条分隔线 */ +@Suppress("MemberVisibilityCanBePrivate", "RedundantRequireNotNullCall", "unused") class DividerNoLast(context: Context, orientation: Int) : RecyclerView.ItemDecoration() { diff --git a/app/src/main/java/io/legado/app/ui/widget/recycler/DragSelectTouchHelper.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/DragSelectTouchHelper.kt index 015595ec1..baa4645bb 100644 --- a/app/src/main/java/io/legado/app/ui/widget/recycler/DragSelectTouchHelper.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/DragSelectTouchHelper.kt @@ -51,7 +51,7 @@ import kotlin.math.min * | | ----------------------------------------------> | | * +-------------------+ +-----------------------+ */ -@Suppress("unused") +@Suppress("unused", "MemberVisibilityCanBePrivate") class DragSelectTouchHelper( /** * Developer callback which controls the behavior of DragSelectTouchHelper. diff --git a/app/src/main/java/io/legado/app/ui/widget/recycler/ItemTouchCallback.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/ItemTouchCallback.kt index a68ac72f4..368fd8c36 100644 --- a/app/src/main/java/io/legado/app/ui/widget/recycler/ItemTouchCallback.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/ItemTouchCallback.kt @@ -12,6 +12,7 @@ import androidx.viewpager.widget.ViewPager * Created by GKF on 2018/3/16. */ +@Suppress("MemberVisibilityCanBePrivate") class ItemTouchCallback(private val callback: Callback) : ItemTouchHelper.Callback() { private var swipeRefreshLayout: SwipeRefreshLayout? = null 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 a2437c0b4..01cb906cb 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 @@ -9,6 +9,7 @@ import io.legado.app.utils.invisible import io.legado.app.utils.visible import kotlinx.android.synthetic.main.view_load_more.view.* +@Suppress("unused") class LoadMoreView(context: Context) : FrameLayout(context) { var hasMore = true diff --git a/app/src/main/java/io/legado/app/ui/widget/recycler/UpLinearLayoutManager.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/UpLinearLayoutManager.kt index 0af559c45..1dfd9ec9a 100644 --- a/app/src/main/java/io/legado/app/ui/widget/recycler/UpLinearLayoutManager.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/UpLinearLayoutManager.kt @@ -4,6 +4,7 @@ import android.content.Context import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearSmoothScroller +@Suppress("MemberVisibilityCanBePrivate", "unused") class UpLinearLayoutManager(val context: Context) : LinearLayoutManager(context) { fun smoothScrollToPosition(position: Int) { diff --git a/app/src/main/java/io/legado/app/ui/widget/recycler/scroller/FastScrollRecyclerView.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/scroller/FastScrollRecyclerView.kt index f080f5cba..35623f5e2 100644 --- a/app/src/main/java/io/legado/app/ui/widget/recycler/scroller/FastScrollRecyclerView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/scroller/FastScrollRecyclerView.kt @@ -7,6 +7,7 @@ import androidx.annotation.ColorInt import androidx.recyclerview.widget.RecyclerView import io.legado.app.R +@Suppress("MemberVisibilityCanBePrivate", "unused") class FastScrollRecyclerView : RecyclerView { private lateinit var mFastScroller: FastScroller diff --git a/app/src/main/java/io/legado/app/ui/widget/recycler/scroller/FastScroller.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/scroller/FastScroller.kt index 7a66873d5..a8372689e 100644 --- a/app/src/main/java/io/legado/app/ui/widget/recycler/scroller/FastScroller.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/scroller/FastScroller.kt @@ -33,9 +33,11 @@ import kotlin.math.min import kotlin.math.roundToInt +@Suppress("SameParameterValue") class FastScroller : LinearLayout { @ColorInt private var mBubbleColor: Int = 0 + @ColorInt private var mHandleColor: Int = 0 private var mBubbleHeight: Int = 0 diff --git a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt index f08e2b3c6..ab4509954 100644 --- a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt @@ -16,6 +16,7 @@ import io.legado.app.lib.theme.ThemeStore import java.lang.reflect.InvocationTargetException import java.lang.reflect.Method +@Suppress("SameParameterValue") class VerticalSeekBar : AppCompatSeekBar { private var mIsDragging: Boolean = false diff --git a/app/src/main/java/io/legado/app/utils/FloatExtensions.kt b/app/src/main/java/io/legado/app/utils/FloatExtensions.kt index 4e3c7f9ed..ab5178cd6 100644 --- a/app/src/main/java/io/legado/app/utils/FloatExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/FloatExtensions.kt @@ -1,3 +1,5 @@ +@file:Suppress("unused") + package io.legado.app.utils import android.content.res.Resources @@ -7,7 +9,6 @@ val Float.dp: Float android.util.TypedValue.COMPLEX_UNIT_DIP, this, Resources.getSystem().displayMetrics ) - val Float.sp: Float get() = android.util.TypedValue.applyDimension( android.util.TypedValue.COMPLEX_UNIT_SP, this, Resources.getSystem().displayMetrics diff --git a/app/src/main/java/io/legado/app/utils/NetworkUtils.kt b/app/src/main/java/io/legado/app/utils/NetworkUtils.kt index 4a3e236cb..40ec8edc6 100644 --- a/app/src/main/java/io/legado/app/utils/NetworkUtils.kt +++ b/app/src/main/java/io/legado/app/utils/NetworkUtils.kt @@ -8,7 +8,7 @@ import java.net.URL import java.util.* import java.util.regex.Pattern -@Suppress("unused") +@Suppress("unused", "MemberVisibilityCanBePrivate") object NetworkUtils { fun getUrl(response: Response<*>): String { val networkResponse = response.raw().networkResponse()