pull/1222/head
gedoor 3 years ago
parent 62901356c5
commit ad5bfc4b57
  1. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 4
      app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt
  3. 6
      app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt

@ -7,6 +7,7 @@ import android.content.res.Configuration
import android.os.Bundle import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import android.util.Log
import android.view.* import android.view.*
import android.view.ViewGroup.LayoutParams.WRAP_CONTENT import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
@ -150,6 +151,7 @@ class ReadBookActivity : ReadBookBaseActivity(),
override fun onWindowFocusChanged(hasFocus: Boolean) { override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus) super.onWindowFocusChanged(hasFocus)
Log.d("navigationBarHeight", navigationBarHeight.toString())
upSystemUiVisibility() upSystemUiVisibility()
} }

@ -250,7 +250,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
selectStart[2] != charIndex selectStart[2] != charIndex
) { ) {
if (selectToInt(relativePos, lineIndex, charIndex) if (selectToInt(relativePos, lineIndex, charIndex)
< selectToInt(selectEnd) <= selectToInt(selectEnd)
) { ) {
selectStart[0] = relativePos selectStart[0] = relativePos
selectStart[1] = lineIndex selectStart[1] = lineIndex
@ -276,7 +276,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
|| selectEnd[2] != charIndex || selectEnd[2] != charIndex
) { ) {
if (selectToInt(relativePos, lineIndex, charIndex) if (selectToInt(relativePos, lineIndex, charIndex)
> selectToInt(selectStart) >= selectToInt(selectStart)
) { ) {
selectEnd[0] = relativePos selectEnd[0] = relativePos
selectEnd[1] = lineIndex selectEnd[1] = lineIndex

@ -43,9 +43,9 @@ class ReadView(context: Context, attrs: AttributeSet) :
upContent() upContent()
} }
var isScroll = false var isScroll = false
var prevPage: PageView = PageView(context) val prevPage by lazy { PageView(context) }
var curPage: PageView = PageView(context) val curPage by lazy { PageView(context) }
var nextPage: PageView = PageView(context) val nextPage by lazy { PageView(context) }
val defaultAnimationSpeed = 300 val defaultAnimationSpeed = 300
private var pressDown = false private var pressDown = false
private var isMove = false private var isMove = false

Loading…
Cancel
Save