Android Question hide navigation buttons from code


Well-Known Member
Licensed User
Longtime User
I would like to know how to hide the navigation buttons from code.

-In the library : ParsBottomSheetBuilder: i see that.... when show a popup menu, the buttons are hidden

-I would like to hide the navigations buttons when show BottomPopupDrawer ...

Captura.JPG (2).gif


Well-Known Member
Licensed User
Longtime User
ok after having a look seems like my code hides it compleatly alongside the state bar

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:

    Dim lv As LayoutValues = GetRealSize
    Dim jo333 As JavaObject = Activity
    jo333.RunMethod("setBottom", Array(lv.Height))
    jo333.RunMethod("setRight", Array(lv.Width))
    Activity.Height = lv.Height
    Activity.Width = lv.Width
    End Sub
    Sub GetRealSize As LayoutValues
    Dim lv As LayoutValues
    Dim po As Phone
    If po.SdkVersion >= 17 Then
        Dim ctxt As JavaObject
        Dim display As JavaObject = ctxt.RunMethodJO("getSystemService", Array("window")).RunMethod("getDefaultDisplay", Null)
        Dim point As JavaObject
        point.InitializeNewInstance("", Null)
        display.RunMethod("getRealSize", Array(point))
        lv.Width = point.GetField("x")
        lv.Height = point.GetField("y")
        '''Add android:windowLayoutInDisplayCutoutMode = never in manifest if you don't want to use notch area
        '''Add android:windowLayoutInDisplayCutoutMode = shortEdges in manifest if you want to use notch area
        Dim r As Rect
        Dim WindowVisibleDisplayFrame As JavaObject = ctxt.RunMethodJO("getWindow", Null)
        WindowVisibleDisplayFrame = WindowVisibleDisplayFrame.RunMethodJO("getDecorView", Null)
        WindowVisibleDisplayFrame = WindowVisibleDisplayFrame.RunMethodJO("getWindowVisibleDisplayFrame",Array(r))
        If GetDeviceLayoutValues.Width > GetDeviceLayoutValues.Height Then
            lv.Width = lv.Width - r.left
            lv.Height = lv.Height -
        End If
        lv.Width = 100%x
        lv.Height = 100%y
    End If
    lv.Scale = 100dip / 100
    Return lv
End Sub

Sub Activity_WindowFocusChanged(HasFocus As Boolean)
    If HasFocus Then
            Dim jo As JavaObject = Activity
            jo.RunMethod("setSystemUiVisibility", Array As Object(5894)) '3846 - non-sticky
            'Log(LastException) 'This can cause another error
        End Try 'ignore
    End If
End Sub

not what you are looking for but can be used as a starting point

I have tried the code, it is the same as immersive mode, but it does not do a blocking effect on the bottom buttons like this library does.

I'll keep looking, thanks :)
Upvote 0