Fixed: testZimFileRendering test due to URL mismatch.

* Improved in full screen mode navigationBar was showing(3 button navigationBar in bottom) on Android 9.
This commit is contained in:
MohitMaliFtechiz 2025-08-29 12:39:27 +05:30 committed by Kelson
parent badd101177
commit aae67533e3

View File

@ -19,10 +19,8 @@
package org.kiwix.kiwixmobile.core.extensions
import android.annotation.SuppressLint
import android.os.Build
import android.view.View
import android.view.Window
import android.view.WindowManager
import androidx.annotation.ColorInt
import androidx.appcompat.widget.TooltipCompat
import androidx.core.view.WindowCompat
@ -98,32 +96,18 @@ fun View.setToolTipWithContentDescription(description: String) {
fun View.showFullScreenMode(window: Window) {
WindowCompat.setDecorFitsSystemWindows(window, false)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
WindowInsetsControllerCompat(window, window.decorView).apply {
hide(WindowInsetsCompat.Type.systemBars())
hide(WindowInsetsCompat.Type.displayCutout())
systemBarsBehavior =
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
}
}
@Suppress("Deprecation")
window.apply {
addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
WindowInsetsControllerCompat(window, window.decorView).apply {
hide(WindowInsetsCompat.Type.systemBars())
hide(WindowInsetsCompat.Type.displayCutout())
systemBarsBehavior =
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
}
}
fun View.closeFullScreenMode(window: Window) {
WindowCompat.setDecorFitsSystemWindows(window, false)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
WindowInsetsControllerCompat(window, window.decorView).apply {
show(WindowInsetsCompat.Type.systemBars())
show(WindowInsetsCompat.Type.displayCutout())
}
}
@Suppress("DEPRECATION")
window.apply {
addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
WindowInsetsControllerCompat(window, window.decorView).apply {
show(WindowInsetsCompat.Type.systemBars())
show(WindowInsetsCompat.Type.displayCutout())
}
}