alexa

How can I make the status bar / navigation bar invisible on Android, while keeping the padding at the top / bottom of the screen in android ?

How can I make the status bar / navigation bar invisible on Android, while keeping the padding at the top / bottom of the screen in android ?

You can transparent the status bar

 <style name="Theme.Transparent" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowTranslucentNavigation">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
</style> 

For hiding StatusBar

 if (Build.VERSION.SDK_INT < 16) {
    window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN)
} else if (Build.VERSION.SDK_INT < 30) {
    window.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN
    actionBar?.hide()
} else {
    window.decorView.windowInsetsController?.hide(WindowInsets.Type.statusBars())
}

274 0
7

Write a Comments


* Be the first to Make Comment

GoodFirms Badge
GoodFirms Badge

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online

Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry