mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-25 05:51:33 -04:00
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:
parent
badd101177
commit
aae67533e3
@ -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())
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user