Are there any plans for an additional background panel/layer where we can add/set our background image/color to?
(maybe it's already accessible but I didn't see if)
The game I'm modding has a general image and the rest of the 'pages' are overlayed.
It would be nice if this image could be added within the B4XPages as first/most deep layer.
Now I create it on the activity in the main module before the page manager is initialized.
I checked that I could put both a background colour and an image on Root before I posted.
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root - we don't here as we have a Drawer
Root.LoadLayout("Login")
Root.Color = Colors.Red
I also checked it works if you use a Drawer and load the layout into its centre panel
For a colour - nothing. For an image you could try loading it once and reusing the Bitmap on other pages. I'll try that tomorrow as I'm now off for a shower and then dinner.
what I want is a straight forward method in B4XPages to have a background (color, image, gradient or something else that can be constructed via designer/code)
that's visible on all pages.
just an extra panel that's at the outer "back" will do unless there is another way that gives us access to the real root panel and not just the current page root.
Sub Activity_Create(FirstTime As Boolean)
...
Dim bmpd As BitmapDrawable
bmpd.Initialize( xui.LoadBitmapResize(File.DirAssets, "colors-icon.png", 500dip, 500dip, True))
Activity.Background = bmpd
End Sub
indeed, that's a way to get it working as mentioned above and I'll use that as a temp. workaround.
but this is a feature that should be part of the B4XPages imho then there's no need to put that code in the main module and (called from) outside the shared classes.
something like b4xpages.rootpanel or .backgroundpanel
No such thing. You should set the background in each of the pages (trivial to do). A page in B4J is a separate form and in B4i it is a separate 'Page'.
I know that but it's like letting your house painted room by room by 10 different companies instead of doing your entire house at once by 1.
Please consider it as a feature request/improvement as it will make things a lot easier for everyone as it can be set in the default page init sub
instead of doing it in the main module with a shared sub call where we then have to take care of the activity/page differences aswell.
I think Erel's implication is that as it is not possible in B4J and B4i then such a feature would not be cross-platform and so doesn't really belong in B4XPages.