Android Question setSystemUiVisibility flags

Cableguy

Expert
Licensed User
Longtime User
Hi Guys,

I am using the below code to change the color of the StatusBar, the NavigationBar and also change the Statusbar visibility flag....
I rekon I could also change the Navigation bar visibility flag... but I have no idea of what value that flag is!!!

B4X:
Sub SetStatusNavigationBarColor(clr As Int)
    Dim p As Phone
    If p.SdkVersion >= 21 Then
        Dim jo As JavaObject
        jo.InitializeContext
        Dim window As JavaObject = jo.RunMethodJO("getWindow", Null)
        window.RunMethod("addFlags", Array (0x80000000))
        window.RunMethod("clearFlags", Array (0x04000000))
        window.RunMethod("setStatusBarColor", Array(clr))
        window.RunMethod("setNavigationBarColor", Array(clr))
    End If
    If p.SdkVersion >= 23 Then
        jo = Root
        jo.RunMethod("setSystemUiVisibility", Array(8192)) 'SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
    End If
End Sub
 

Cableguy

Expert
Licensed User
Longtime User
Found It!!!
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
It looks that setSystemUIVisibility has been deprecated from API 30, in favour of WindowInsetsController.

Found It!!!
Good! Could you share it when possible?
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
It looks that setSystemUIVisibility has been deprecated from API 30, in favour of WindowInsetsController.


Good! Could you share it when possible?
 
Upvote 0
Top