Android Question AppCompat Toolbar b4xdrawer under status bar?

techknight

Well-Known Member
Licensed User
Longtime User
I am having a weird issue with my app.

I have the B4X Drawer integrated into my App, I have added the dynamic menues, it all works great.

So then I turned off full screen so I can see the status bar at the top. Well... the status bar is showing on top of the actionbar/app, and I dont know why!

Here is my manifest code:

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="19" />
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
CreateResource(values, theme.xml,
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.NoActionBar">
        <item name="colorPrimary">#42A5F5</item>
        <item name="colorPrimaryDark">#1976D2</item>
        <item name="colorAccent">#ADFF2F</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="windowActionModeOverlay">true</item>
        <item name="android:windowTranslucentNavigation">false</item>
        <item name="android:windowTranslucentStatus">true</item>
    </style>
</resources>
)
SetApplicationAttribute(android:theme, "@style/MyAppTheme")
AddPermission(android.permission.ACCESS_COARSE_LOCATION)

Here is my action bar creation code:
B4X:
    Drawer.Initialize(Me, "Drawer", Activity, 300dip)
    Activity.SetBackgroundImage(bmp)
 
    ProgressDialogShow2("Loading, Please Wait...", False)
 
    Drawer.CenterPanel.LoadLayout("bslarge")
 
    ToolbarHelper.Initialize
    ToolbarHelper.ShowUpIndicator = True 'set to true to show the up arrow (In this case, hamburger menu)
    Dim bd As BitmapDrawable
    bd.Initialize(LoadBitmap(File.DirAssets, "hamburger.png"))
    ToolbarHelper.UpIndicatorDrawable =  bd
    ToolbarHelper.Title = "Major Display SportsMonitor SCB3000 Baseball"
 
    #IF 2A and NOT(CTNC)
        ToolbarHelper.Subtitle = "V" & Left(pm.GetVersionName("md.smbaseball2a"), 3) & "." & Right(pm.GetVersionName("md.smbaseball2a"), 1)
    #END IF
    #IF 2A AND CTNC
        ToolbarHelper.Subtitle = "V" & Left(pm.GetVersionName("md.smbaseball2actnc"), 3) & "." & Right(pm.GetVersionName("md.smbaseball2actnc"), 1)
    #END IF     
    #IF 2B
        ToolbarHelper.Subtitle = "V" & Left(pm.GetVersionName("md.smbaseball2b"), 3) & "." & Right(pm.GetVersionName("md.smbaseball2b"), 1)
    #END IF
 
 
    ACToolBarLight1.InitMenuListener
    Drawer.LeftPanel.LoadLayout("Left")
 
    'Activity.Title = "Major Display SportsMonitor SCB3000 " & PM.GetVersionName("md.smpc01")
    shutdown = False

    'SetMenuItems(CommEngine.connected)
 
    'RefreshTimer.Enabled = True
    ProgressDialogHide

Sub Activity_CreateMenu(Menu As ACMenu)
    Menu.Clear
    Select Case CommEngine.connected
        Case True
            Dim Item As ACMenuItem = ACToolBarLight1.Menu.Add2(0, 0, "mnuConnection", Null)
            Item.ShowAsAction = Item.SHOW_AS_ACTION_ALWAYS
            UpdateIcon("mnuConnection", LoadBitmap(File.DirAssets, "power-green.png"))
        Case False
            Dim Item As ACMenuItem = ACToolBarLight1.Menu.Add2(0, 0, "mnuConnection", Null)
            Item.ShowAsAction = Item.SHOW_AS_ACTION_ALWAYS
            UpdateIcon("mnuConnection", LoadBitmap(File.DirAssets, "power-red.png"))
    End Select
    Dim Item As ACMenuItem = ACToolBarLight1.Menu.Add2(0, 0, "mnuClear", Null)
    Item.ShowAsAction = Item.SHOW_AS_ACTION_ALWAYS
    UpdateIcon("mnuClear", LoadBitmap(File.DirAssets, "trash.png"))
End Sub

any ideas?
 
Top