fix: make bottom to top work properly (#320)

* fix: make bottom to top work properly

Fixes navigating to the wrong chapter, despite the UI being correct. Makes bottom to top its own setting that functions as expected, not just top to bottom with a RTL slider bar.

* fix: allow inversion to pick sides
This commit is contained in:
TwistedUmbrellaX 2024-04-04 04:26:21 -04:00 committed by GitHub
parent 47b1940ace
commit 75e90541c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 57 additions and 28 deletions

View file

@ -214,7 +214,8 @@ fun initActivity(a: Activity) {
window,
window.decorView
).hide(WindowInsetsCompat.Type.statusBars())
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && statusBarHeight == 0 && a.resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && statusBarHeight == 0
&& a.resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) {
window.decorView.rootWindowInsets?.displayCutout?.apply {
if (boundingRects.size > 0) {
statusBarHeight = min(boundingRects[0].width(), boundingRects[0].height())