Android Question how to Get the screen's (root) Corner Radius ?

Cableguy

Expert
Licensed User
Longtime User
Solution
B4X:
Private Sub GetActivityWindowInsets As JavaObject
    Dim ctxt As JavaObject
    ctxt.InitializeContext
    Return ctxt.RunMethodJO("getWindow", Null).RunMethodJO("getDecorView", Null).RunMethod("getRootWindowInsets", Null)
End Sub

B4X:
For position = 0 To 3
    Dim RoundedCorner As JavaObject = insets.RunMethod("getRoundedCorner", Array(position))
    Log(RoundedCorner)
Next

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Private Sub GetActivityWindowInsets As JavaObject
    Dim ctxt As JavaObject
    ctxt.InitializeContext
    Return ctxt.RunMethodJO("getWindow", Null).RunMethodJO("getDecorView", Null).RunMethod("getRootWindowInsets", Null)
End Sub

B4X:
For position = 0 To 3
    Dim RoundedCorner As JavaObject = insets.RunMethod("getRoundedCorner", Array(position))
    Log(RoundedCorner)
Next
 
Upvote 0
Solution
Cookies are required to use this site. You must accept them to continue using the site. Learn more…