Remove some other deprecation warnings

This commit is contained in:
Matéo Duparc 2021-09-05 15:00:16 +02:00
parent d36910ac19
commit b9a7411cdb
Signed by untrusted user: hardcoresushi
GPG Key ID: 007F84120107191E

View File

@ -1,9 +1,10 @@
package sushi.hardcore.droidfs.widgets package sushi.hardcore.droidfs.widgets
import androidx.appcompat.app.AlertDialog
import android.content.Context import android.content.Context
import android.view.View
import android.view.WindowManager import android.view.WindowManager
import androidx.appcompat.app.AlertDialog
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsControllerCompat
class ColoredAlertDialogBuilder: AlertDialog.Builder { class ColoredAlertDialogBuilder: AlertDialog.Builder {
constructor(context: Context): super(context) constructor(context: Context): super(context)
@ -29,8 +30,11 @@ class ColoredAlertDialogBuilder: AlertDialog.Builder {
val dialog = create() val dialog = create()
dialog.show() dialog.show()
if (keepFullScreen){ if (keepFullScreen){
dialog.window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN dialog.window?.let {
dialog.window?.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) WindowInsetsControllerCompat(it, it.decorView)
.hide(WindowInsetsCompat.Type.statusBars())
it.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
}
} }
return dialog return dialog
} }