diff --git a/app/src/main/java/org/zotero/android/pdf/reader/PdfReaderScreen.kt b/app/src/main/java/org/zotero/android/pdf/reader/PdfReaderScreen.kt index 37aba03b..481cd9c1 100644 --- a/app/src/main/java/org/zotero/android/pdf/reader/PdfReaderScreen.kt +++ b/app/src/main/java/org/zotero/android/pdf/reader/PdfReaderScreen.kt @@ -32,6 +32,8 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.dp +import androidx.core.view.WindowCompat +import androidx.core.view.WindowInsetsCompat import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.Lifecycle import org.zotero.android.architecture.ui.CustomLayoutSize @@ -64,6 +66,16 @@ internal fun PdfReaderScreen( } } CustomThemeWithStatusAndNavBars(isDarkTheme = viewState.isDark) { + val window = activity.window + val decorView = window.decorView + val systemBars = WindowInsetsCompat.Type.systemBars() + val insetsController = WindowCompat.getInsetsController(window, decorView) + if (viewState.isTopBarVisible) { + insetsController.show(systemBars) + } else { + insetsController.hide(systemBars) + } + val params = viewModel.screenArgs val uri = params.uri val lazyListState = rememberLazyListState() diff --git a/app/src/main/java/org/zotero/android/pdf/reader/PdfReaderViewModel.kt b/app/src/main/java/org/zotero/android/pdf/reader/PdfReaderViewModel.kt index 263460ad..4239dd10 100644 --- a/app/src/main/java/org/zotero/android/pdf/reader/PdfReaderViewModel.kt +++ b/app/src/main/java/org/zotero/android/pdf/reader/PdfReaderViewModel.kt @@ -11,6 +11,8 @@ import android.transition.TransitionManager import android.view.MotionEvent import android.view.View import android.view.ViewGroup +import androidx.core.view.WindowCompat +import androidx.core.view.WindowInsetsCompat import androidx.core.view.isVisible import androidx.fragment.app.FragmentManager import androidx.fragment.app.commit @@ -1612,6 +1614,12 @@ class PdfReaderViewModel @Inject constructor( this.document.annotationProvider.removeAnnotationFromPage(it) } submitPendingPage(fragment.pageIndex) + val activity = fragment.activity + if (activity != null) { + WindowCompat.getInsetsController(activity.window, activity.window.decorView).show( + WindowInsetsCompat.Type.systemBars() + ) + } super.onCleared() } diff --git a/buildSrc/src/main/kotlin/BuildConfig.kt b/buildSrc/src/main/kotlin/BuildConfig.kt index b3af0bb8..d4da268b 100644 --- a/buildSrc/src/main/kotlin/BuildConfig.kt +++ b/buildSrc/src/main/kotlin/BuildConfig.kt @@ -4,7 +4,7 @@ object BuildConfig { const val compileSdkVersion = 34 const val targetSdk = 34 - val versionCode = 83 // Must be updated on every build + val versionCode = 84 // Must be updated on every build val version = Version( major = 1, minor = 0,