Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix toolbars not hiding in multiwindow #3021

Merged
merged 1 commit into from
Dec 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ class PagerActivity : AppCompatActivity(), AudioBarListener, OnBookmarkTagsUpdat
private var isDualPages = false
private var promptedForExtraDownload = false
private var progressDialog: ProgressDialog? = null
private var isInMultiWindowMode = false
private var isFoldableDeviceOpenAndVertical = false

private var bookmarksMenuItem: MenuItem? = null
Expand Down Expand Up @@ -529,7 +528,7 @@ class PagerActivity : AppCompatActivity(), AudioBarListener, OnBookmarkTagsUpdat
} else if (position == barPos - 1 || position == barPos + 1) {
// Swiping to previous or next ViewPager page (i.e. next or previous quran page)
val updatedSelectionIndicator =
selectionIndicator.withXScroll((viewPager.getWidth() - positionOffsetPixels).toFloat())
selectionIndicator.withXScroll((viewPager.width - positionOffsetPixels).toFloat())
readingEventPresenterBridge.withSelectionIndicator(
updatedSelectionIndicator
)
Expand Down Expand Up @@ -794,6 +793,10 @@ class PagerActivity : AppCompatActivity(), AudioBarListener, OnBookmarkTagsUpdat
windowInsetsController.systemBarsBehavior =
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && isInMultiWindowMode) {
animateToolBar(isVisible)
}
}

private fun setUiVisibilityKitKat(isVisible: Boolean) {
Expand All @@ -808,7 +811,7 @@ class PagerActivity : AppCompatActivity(), AudioBarListener, OnBookmarkTagsUpdat
}
viewPager.systemUiVisibility = flags

if (isInMultiWindowMode) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && isInMultiWindowMode) {
animateToolBar(isVisible)
}
}
Expand Down Expand Up @@ -883,8 +886,6 @@ class PagerActivity : AppCompatActivity(), AudioBarListener, OnBookmarkTagsUpdat

audioPresenter.bind(this)
recentPagePresenter.bind(currentPageFlow)
isInMultiWindowMode =
Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && isInMultiWindowMode

if (shouldReconnect) {
foregroundDisposable.add(
Expand Down
Loading