From 2d046ac23517d293ee520400916fa47cff9cd29b Mon Sep 17 00:00:00 2001 From: Lucas Delanier Date: Sun, 12 Mar 2023 21:00:17 +0100 Subject: [PATCH] fix full screen mode by adding onresume to mainactivity :bulb: --- .../main/java/com/example/shakecraft/MainActivity.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/MainActivity.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/MainActivity.kt index 973ed9a..f5c9a46 100644 --- a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/MainActivity.kt +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/MainActivity.kt @@ -3,6 +3,7 @@ package com.example.shakecraft import android.os.Build import androidx.appcompat.app.AppCompatActivity import android.os.Bundle +import android.view.View import androidx.annotation.RequiresApi import androidx.core.view.WindowCompat import androidx.core.view.WindowInsetsCompat @@ -43,6 +44,15 @@ class MainActivity : AppCompatActivity() { } + override fun onResume() { + super.onResume() + + // Masquer la barre de navigation et la barre d'état + window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + or View.SYSTEM_UI_FLAG_FULLSCREEN + or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) + } + } \ No newline at end of file