diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 0e0152540..739c53ab2 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -7,6 +7,7 @@ import android.content.res.Configuration import android.os.Bundle import android.os.Handler import android.os.Looper +import android.util.Log import android.view.* import android.view.ViewGroup.LayoutParams.WRAP_CONTENT import androidx.activity.result.contract.ActivityResultContracts @@ -150,6 +151,7 @@ class ReadBookActivity : ReadBookBaseActivity(), override fun onWindowFocusChanged(hasFocus: Boolean) { super.onWindowFocusChanged(hasFocus) + Log.d("navigationBarHeight", navigationBarHeight.toString()) upSystemUiVisibility() } diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt index a70a546bd..67f16724a 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt @@ -250,7 +250,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at selectStart[2] != charIndex ) { if (selectToInt(relativePos, lineIndex, charIndex) - < selectToInt(selectEnd) + <= selectToInt(selectEnd) ) { selectStart[0] = relativePos selectStart[1] = lineIndex @@ -276,7 +276,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at || selectEnd[2] != charIndex ) { if (selectToInt(relativePos, lineIndex, charIndex) - > selectToInt(selectStart) + >= selectToInt(selectStart) ) { selectEnd[0] = relativePos selectEnd[1] = lineIndex diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt index b6de252c8..966407094 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt @@ -43,9 +43,9 @@ class ReadView(context: Context, attrs: AttributeSet) : upContent() } var isScroll = false - var prevPage: PageView = PageView(context) - var curPage: PageView = PageView(context) - var nextPage: PageView = PageView(context) + val prevPage by lazy { PageView(context) } + val curPage by lazy { PageView(context) } + val nextPage by lazy { PageView(context) } val defaultAnimationSpeed = 300 private var pressDown = false private var isMove = false