Android Question Why two Root.LoadLayout()'s in example camEx2?

toby

Well-Known Member
Licensed User
Longtime User
The Camera2 example contains the following piece of code. You can see that there are two Root.LoadLayout() sub calls. What's the purpose? if it's not a hidden feature, could someone show me where I can read about the related documentation?
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("1")
    Root.LoadLayout("StillPicture")
    VideoFileDir = rp.GetSafeDirDefaultExternal("")
    VideoFileName = "1.mp4"
    cam.Initialize(pnlCamera)
    Log(cam.SupportedHardwareLevel)
    buttons = Array(btnScene, btnAutoExposure, btnEffects, btnFocus, btnMode)
    SetState(False, False, VideoMode)
End Sub
 

William Lancee

Well-Known Member
Licensed User
Longtime User
First, LoadLayout is not over-riding. When the two layouts are loaded all the views in both are in the root node tree.
(And you could add more, either as layout files or with AddView)
Second, I looked at the code and it is a marvel of hiding and showing views as needed.
(If you think like I do, that code could be - it is beautiful)
 
Upvote 1
Top