I tried the CloneyBird example, but with the same result.
If I insert the following code into the example, it does what I would expect. (Picture 1)
(Draw a filled rectangle almost to the edge)
Dim shapeRenderer As lgShapeRenderer
shapeRenderer.Initialize
shapeRenderer.Begin( shapeRenderer.SHAPETYPE_Filled )
shapeRenderer.Rect( 1%x,1%y, 98%x,98%y )
shapeRenderer.End
shapeRenderer.Dispose
Then I turn on Immersive Mode with this code: (Picture 2)
(I found the code on the forum)
Private Sub SetImmersiveMode
Activity_WindowFocusChanged(True)
Dim lv As LayoutValues = GetRealSize
Dim jo As JavaObject = Activity
jo.RunMethod("setBottom", Array(lv.Height))
jo.RunMethod("setRight", Array(lv.Width))
Activity.Height = lv.Height
Activity.Width = lv.Width
Log( "immersion: "&lv.Width&" "&lv.Height)
End Sub
Sub GetRealSize As LayoutValues
Dim lv As LayoutValues
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim display As JavaObject = ctxt.RunMethodJO("getSystemService", Array("window")).RunMethod("getDefaultDisplay", Null)
Dim point As JavaObject
point.InitializeNewInstance("android.graphics.Point", Null)
display.RunMethod("getRealSize", Array(point))
lv.Width = point.GetField("x")
lv.Height = point.GetField("y")
lv.Scale = 100dip / 100
Return lv
End Sub
Sub Activity_WindowFocusChanged(HasFocus As Boolean)
If HasFocus Then
Try
Dim jo As JavaObject = Activity
Sleep(300)
jo.RunMethod("setSystemUiVisibility", Array As Object(5894)) '3846 - non-sticky
Catch
'Log(LastException) 'This can cause another error
End Try 'ignore
End If
End Sub
When I use "shapeRenderer.Rect( 1%x,1%y, 98%x,98%y )", it is drawn outside the screen"
I have to change the y-values to get the same result. (Picture 2)
Dim shapeRenderer As lgShapeRenderer
shapeRenderer.Initialize
shapeRenderer.Begin( shapeRenderer.SHAPETYPE_Filled )
shapeRenderer.Rect( 1%x,5%y, 98%x,94%y )
shapeRenderer.End
shapeRenderer.Dispose
I mean the change from 1%y to 5%y and 98%y to 94%y
Please, What am I doing wrong?