|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
package eu.kanade.tachiyomi.ui.recently_read
|
|
|
|
|
|
|
|
|
|
import android.os.Build
|
|
|
|
|
import android.view.MotionEvent
|
|
|
|
|
import android.view.View
|
|
|
|
|
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
|
|
|
|
import eu.kanade.tachiyomi.R
|
|
|
|
@ -8,6 +10,7 @@ import eu.kanade.tachiyomi.data.glide.GlideApp
|
|
|
|
|
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
|
|
|
|
|
import kotlinx.android.synthetic.main.recently_read_item.*
|
|
|
|
|
import java.util.Date
|
|
|
|
|
import kotlin.math.max
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Holder that contains recent manga item
|
|
|
|
@ -23,6 +26,7 @@ class RecentlyReadHolder(
|
|
|
|
|
val adapter: RecentlyReadAdapter
|
|
|
|
|
) : BaseFlexibleViewHolder(view, adapter) {
|
|
|
|
|
|
|
|
|
|
private var lastTouchUpY = 0f
|
|
|
|
|
init {
|
|
|
|
|
remove.setOnClickListener {
|
|
|
|
|
adapter.removeClickListener.onRemoveClick(adapterPosition)
|
|
|
|
@ -33,7 +37,17 @@ class RecentlyReadHolder(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cover.setOnClickListener {
|
|
|
|
|
adapter.coverClickListener.onCoverClick(adapterPosition)
|
|
|
|
|
adapter.coverClickListener.onCoverClick(adapterPosition, lastTouchUpY)
|
|
|
|
|
}
|
|
|
|
|
cover.setOnTouchListener { v, event ->
|
|
|
|
|
when (event?.action) {
|
|
|
|
|
MotionEvent.ACTION_UP -> {
|
|
|
|
|
val topH = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
|
|
|
|
v.rootWindowInsets.systemWindowInsetTop else 38
|
|
|
|
|
lastTouchUpY = max(topH + 175f, event.rawY - topH - 154f)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|