Android Question navigation bar missing (until it isn't)

drgottjr

Expert
Licensed User
Longtime User
with b4a 13.7 in regular activity, the navigation bar is not visible (although the "keys" in it are touchable even though you can't see them). when you tap the "click" button, you can see the navigation bar through the transparent background. please see attached screen captures. is this expected? behavior is the same on pixel6 and pixel7, both running android 17.
 

Attachments

  • backkey1.png
    backkey1.png
    6.4 KB · Views: 13
  • backkey2.png
    backkey2.png
    9.4 KB · Views: 13

drgottjr

Expert
Licensed User
Longtime User
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
I had the same problem.

@Erel said it was a bug. You need to download Themes.jar and replace it in in the internal library folder.
themes.jar already in the internal library folder (comes with b4a.exe). plus my manifest is bare minimum that comes with minimum example. i didn't have to remove any themes-related statements. i downloaded 13.7 and tried to run the example. your case is similar: navigation bar barely visible. in my case navigation bar is not visible.
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
themes.jar already in the internal library folder (comes with b4a.exe). plus my manifest is bare minimum that comes with minimum example. i didn't have to remove any themes-related statements. i downloaded 13.7 and tried to run the example. your case is similar: navigation bar barely visible. in my case navigation bar is not visible.
The one that came with 13.70 has this bug. That's why you don't see the navigation bar icons. It's not a problem if the activity background is not white. That's why only you and me so far complained about it. Take this jar and replace the one that you already have.

 

Attachments

  • Themes.jar
    836 bytes · Views: 2
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
The one that came with 13.70 has this bug. That's why you don't see the navigation bar icons. It's not a problem if the activity background is not white. That's why only you and me so far complained about it. Take this jar and replace the one that you already have.

i'll try your themes.jar. yeah, i figured out that if the activity's background isn't white, you can see the navigation bar. so i did:
B4X:
    Dim cd As ColorDrawable
    cd.Initialize(Colors.Black, 1)
    
    ime.Initialize("ime")
    root = xui.CreatePanel("")
    Dim Content As Rect = ime.GetContentRect
    Activity.AddView(root, Content.Left, Content.Top, Content.Width, Content.Height)
    Activity.Background = cd
and i get the navigation bar. this is said to be a design feature... i'll see what the new themes.jar does. thanks again.
 

Attachments

  • backkey3.png
    backkey3.png
    6.9 KB · Views: 3
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
i'll try your themes.jar. yeah, i figured out that if the activity's background isn't white, you can see the navigation bar. so i did:
B4X:
    Dim cd As ColorDrawable
    cd.Initialize(Colors.Black, 1)
   
    ime.Initialize("ime")
    root = xui.CreatePanel("")
    Dim Content As Rect = ime.GetContentRect
    Activity.AddView(root, Content.Left, Content.Top, Content.Width, Content.Height)
    Activity.Background = cd
and i get the navigation bar. this is said to be a design feature... i'll see what the new themes.jar does. thanks again.
or do it programmatically

B4X:
Public Sub SetStatusNavigationBarColor(Root As B4XView,Color As Int,DarkText As Boolean)
    
    Try
        
        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(Color))
            window.RunMethod("setNavigationBarColor", Array(Color))
        End If
        If p.SdkVersion >= 23 Then
            jo = Root
            If DarkText Then
                jo.RunMethod("setSystemUiVisibility",Array(8192+16))
            Else
                jo.RunMethod("setSystemUiVisibility",Array(0x00000010))
            End If
        End If
    Catch
        Log("SetStatusNavigationBarColor " & LastException.Message)      
    End Try
End Sub
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
now it's the action bar (or is it called statusbar?). new themes not really better than my kludge. i see statusbarcolor and navigationbarcolor mentioned in your snippet; let me try that.
 
Upvote 0
Top