@ -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
@ -48,7 +48,7 @@ class NumberPickerDialog(context: Context) {
listener?.invoke()
}
return this;
return this
fun show(callBack: ((value: Int) -> Unit)?) {
@ -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 {
@ -14,6 +14,7 @@ import kotlin.math.roundToInt
/**
* 不画最后一条分隔线
*/
@Suppress("MemberVisibilityCanBePrivate", "RedundantRequireNotNullCall", "unused")
class DividerNoLast(context: Context, orientation: Int) :
RecyclerView.ItemDecoration() {
@ -51,7 +51,7 @@ import kotlin.math.min
* | | ----------------------------------------------> | |
* +-------------------+ +-----------------------+
@Suppress("unused", "MemberVisibilityCanBePrivate")
class DragSelectTouchHelper(
* Developer callback which controls the behavior of DragSelectTouchHelper.
@ -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
@ -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.*
class LoadMoreView(context: Context) : FrameLayout(context) {
var hasMore = true
@ -4,6 +4,7 @@ import android.content.Context
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.LinearSmoothScroller
class UpLinearLayoutManager(val context: Context) : LinearLayoutManager(context) {
fun smoothScrollToPosition(position: Int) {
@ -7,6 +7,7 @@ import androidx.annotation.ColorInt
import androidx.recyclerview.widget.RecyclerView
class FastScrollRecyclerView : RecyclerView {
private lateinit var mFastScroller: FastScroller
@ -33,9 +33,11 @@ import kotlin.math.min
import kotlin.math.roundToInt
@Suppress("SameParameterValue")
class FastScroller : LinearLayout {
@ColorInt
private var mBubbleColor: Int = 0
private var mHandleColor: Int = 0
private var mBubbleHeight: Int = 0
@ -16,6 +16,7 @@ import io.legado.app.lib.theme.ThemeStore
import java.lang.reflect.InvocationTargetException
import java.lang.reflect.Method
class VerticalSeekBar : AppCompatSeekBar {
private var mIsDragging: Boolean = false
@ -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
@ -8,7 +8,7 @@ import java.net.URL
import java.util.*
import java.util.regex.Pattern
object NetworkUtils {
fun getUrl(response: Response<*>): String {
val networkResponse = response.raw().networkResponse()