Sub SetStatusBarColor(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))
End If
End Sub
Sub SetStatusBarColor(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))
End If
End Sub
Sub SetStatusBarColor(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))
End If
End Sub
hi erel.
sory to ask here on a old topic.
i m trying this code now here, and i have a question.
how can i make to this code works 2 times on the same activity?
i have a splash yellow, i want show the splash in yellow and statusbar too, later the splash visible = false i want change the color of statusbar again.
i m trying but it stay with yellow, dont change the color on the second time.
Sub SetStatusBarColor(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))
End If
End Sub
If I set the "clr" = White, how do I set the TextColor of the statusbar to Black?
Because setting it to white, sets the text to white as well. Therefore you can't read anything on the StatusBar.
Hi, i'm using SetStatusBarColor to set status bar color but the problem when i select light or white color i can't see the statusbar icons because its also white how to change it ?
Hi, i'm using SetStatusBarColor to set status bar color but the problem when i select light or white color i can't see the statusbar icons because its also white how to change it ?
It can be done. Google Gmail does it when you touch the Search panel, that panel animates and changes the status bar color to gray and the text to black. Actually, the text color is already black. Then you press the left pointing arrow, it animates back again, and the status bar color changes to white (with the text color black).