Android Question Notch and video player

Sasuke Sama

Active Member
Licensed User
Hi
Im using exoplayer and i want to know if its possible to make exoplayer somehow to extend to the notch and display the video in the entire screen.
 

Erel

Administrator
Staff member
Licensed User
It might be possible to do on Android 9+. There are no APIs for this on older versions.
 

Sasuke Sama

Active Member
Licensed User
Try this:
B4X:
Sub Activity_Create(FirstTime As Boolean)
   Dim p As Phone
   If p.SdkVersion >= 28 Then
       Dim jo As JavaObject
       jo.InitializeContext
       jo = jo.RunMethod("getWindow", Null)
       jo.RunMethodJO("getAttributes", Null).SetField("layoutInDisplayCutoutMode", 1)
   End If
End Sub
https://developer.android.com/reference/android/R.attr#windowLayoutInDisplayCutoutMode
its kinda works but not as expected.
the layout dose extands to the notch ( the statebar backgroundcolor mathes the layout color) but any view such as image view or the exoplayer still stops to the notch
 
Top