Reader seekbar now above gesture area
Co-Authored-By: tonarii <tonarii@users.noreply.github.com>
This commit is contained in:
parent
744b0a3f58
commit
ace3147479
@ -145,6 +145,17 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
|||||||
|
|
||||||
config = ReaderConfig()
|
config = ReaderConfig()
|
||||||
initializeMenu()
|
initializeMenu()
|
||||||
|
val container: ViewGroup = findViewById(R.id.reader_container)
|
||||||
|
val readerBHeight = reader_menu_bottom.layoutParams.height
|
||||||
|
container.doOnApplyWindowInsets { _, insets, padding ->
|
||||||
|
val bottomInset = if (Build.VERSION.SDK_INT >= 29)
|
||||||
|
(insets.mandatorySystemGestureInsets.bottom - insets.systemWindowInsetBottom)
|
||||||
|
else 0
|
||||||
|
reader_menu_bottom.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
|
height = readerBHeight + bottomInset
|
||||||
|
}
|
||||||
|
reader_menu_bottom.updatePaddingRelative(bottom = padding.bottom + bottomInset)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,8 +20,6 @@ class ReaderSeekBar @JvmOverloads constructor(
|
|||||||
* Whether the seekbar should draw from right to left.
|
* Whether the seekbar should draw from right to left.
|
||||||
*/
|
*/
|
||||||
var isRTL = false
|
var isRTL = false
|
||||||
private val boundingBox: Rect = Rect()
|
|
||||||
private val exclusions = listOf(boundingBox)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws the seekbar, translating the canvas if using a right to left reader.
|
* Draws the seekbar, translating the canvas if using a right to left reader.
|
||||||
@ -45,14 +43,4 @@ class ReaderSeekBar @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
return super.onTouchEvent(event)
|
return super.onTouchEvent(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
|
|
||||||
super.onLayout(changed, left, top, right, bottom)
|
|
||||||
if (Build.VERSION.SDK_INT >= 29) {
|
|
||||||
if (changed) {
|
|
||||||
boundingBox.set(left, top, right, bottom)
|
|
||||||
systemGestureExclusionRects = exclusions
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user