|
|
@ -160,7 +160,6 @@ class ReadView(context: Context, attrs: AttributeSet) : |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@SuppressLint("ClickableViewAccessibility") |
|
|
|
@SuppressLint("ClickableViewAccessibility") |
|
|
|
override fun onTouchEvent(event: MotionEvent): Boolean { |
|
|
|
override fun onTouchEvent(event: MotionEvent): Boolean { |
|
|
|
callBack.screenOffTimerStart() |
|
|
|
|
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { |
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { |
|
|
|
val insets = |
|
|
|
val insets = |
|
|
|
this.rootWindowInsets.getInsetsIgnoringVisibility(WindowInsets.Type.mandatorySystemGestures()) |
|
|
|
this.rootWindowInsets.getInsetsIgnoringVisibility(WindowInsets.Type.mandatorySystemGestures()) |
|
|
@ -174,6 +173,7 @@ class ReadView(context: Context, attrs: AttributeSet) : |
|
|
|
|
|
|
|
|
|
|
|
when (event.action) { |
|
|
|
when (event.action) { |
|
|
|
MotionEvent.ACTION_DOWN -> { |
|
|
|
MotionEvent.ACTION_DOWN -> { |
|
|
|
|
|
|
|
callBack.screenOffTimerStart() |
|
|
|
if (isTextSelected) { |
|
|
|
if (isTextSelected) { |
|
|
|
curPage.cancelSelect() |
|
|
|
curPage.cancelSelect() |
|
|
|
isTextSelected = false |
|
|
|
isTextSelected = false |
|
|
@ -205,6 +205,7 @@ class ReadView(context: Context, attrs: AttributeSet) : |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
MotionEvent.ACTION_UP -> { |
|
|
|
MotionEvent.ACTION_UP -> { |
|
|
|
|
|
|
|
callBack.screenOffTimerStart() |
|
|
|
removeCallbacks(longPressRunnable) |
|
|
|
removeCallbacks(longPressRunnable) |
|
|
|
if (!pressDown) return true |
|
|
|
if (!pressDown) return true |
|
|
|
pressDown = false |
|
|
|
pressDown = false |
|
|
|