Hi guys,
Wanted to help out a fellow community member to achieve pushing views to a secondary display and I'm posting it on a new thread as suggested by multiple members. This is not the most elegant piece of code nor it is flexible. All it allows is, detect and push views to first secondary display it can find. That's all I wanted it to do in my project. So, I'll post it as is for now, and when I get more time I'll make it better.
Add both files to your Additional libraries folder. In your project, select the library, and use it as below,
Wanted to help out a fellow community member to achieve pushing views to a secondary display and I'm posting it on a new thread as suggested by multiple members. This is not the most elegant piece of code nor it is flexible. All it allows is, detect and push views to first secondary display it can find. That's all I wanted it to do in my project. So, I'll post it as is for now, and when I get more time I'll make it better.
Add both files to your Additional libraries folder. In your project, select the library, and use it as below,
Use:
Sub Class_Globals
Dim Xui As XUI
Dim SecondScreen As Secondaryscreen
End Sub
Public Sub Initialize
SecondScreen.Initialise 'this will automatically search for second display. If found it calls back 'ReturningDisplayDimensions' with the dimensions of the secondary display
End Sub
Sub ReturningDisplayDimensions(Dimensions() As Int) 'called from the wrappped library if there is a second display
Dim p As B4XView = xui.createPanel("")
p.setlayoutanimated(0,0,0,Dimensions(0), Dimensions(1))
p.LoadLayout("layout")
SecondScreen.SetViewToScreen(p, False)
End Sub