feat: 优化代码

pull/106/head
kunfei 5 years ago
parent f7b434f4b7
commit 8b513c31fe
  1. 6
      app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt
  2. 4
      app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt

@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.util.AttributeSet import android.util.AttributeSet
import android.view.MotionEvent
import android.widget.FrameLayout import android.widget.FrameLayout
import io.legado.app.R import io.legado.app.R
import io.legado.app.constant.AppConst.TIME_FORMAT import io.legado.app.constant.AppConst.TIME_FORMAT
@ -109,6 +110,11 @@ class ContentView : FrameLayout {
content_text_view.selectAble = selectAble content_text_view.selectAble = selectAble
} }
fun selectText(e: MotionEvent) {
}
fun scrollTo(pos: Int?) { fun scrollTo(pos: Int?) {
if (pos != null) { if (pos != null) {
content_text_view.post { content_text_view.post {

@ -266,6 +266,10 @@ abstract class PageDelegate(protected val pageView: PageView) :
return true return true
} }
override fun onLongPress(e: MotionEvent) {
curPage.selectText(e)
}
/** /**
* 移动结束 * 移动结束
*/ */

Loading…
Cancel
Save