package com.doverfuelingsolutions.issp.utils

import android.os.Build
import android.view.View
import android.view.WindowInsets
import androidx.appcompat.app.AppCompatActivity
import com.doverfuelingsolutions.issp.utils.log.DFSLog

class ActivityUtil {

    companion object {

        @Suppress("DEPRECATION")
        fun fullscreen(activity: AppCompatActivity) {
            activity.supportActionBar?.hide()
            if (Build.VERSION.SDK_INT >= 30) {
                activity.window.insetsController?.hide(WindowInsets.Type.navigationBars())
            } else {
                activity.window.decorView.systemUiVisibility =
                    View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
            }
        }
    }
}