Is there a way to display 2 layouts?

wheretheidivides

Active Member
Licensed User
Longtime User
So I have a program that is forced into portrait mode. It have 3 invisible panels, 1 at top, 1 in middle and 1 at bottom. Everything is on these panels that are docked. That way there is no black bar on longer aspect ratio screens. You just get a little more room in 2 areas. The background is 100%x and 100%y generic so it stretches out for every screen.

Now here's the thing. Using the layout designer, if I choose a variant in landscape mode, it messes up. You can change the layout for landscape, but when you look at portrait, it has changed.

The reason this came up was I hooked up my tablet to a TV set and it was at a 90 degrees angle. On it's side. With newer systems like Ooya coming out that hook up to TVs, you need a landscape mode now.


So I was wondering if you can have a portrait bal and a landscape bal instead of 1 bal for both? Right now there is 1 bal with both landscape and portrait. Is there a way to break these up to 2 bals?

(and before you say I don't know what I'm taking about, I do. You can modify portrait and landscape, but when you get to some things, it changes both modes. That is why I'm asking. I need a portrait mode so everything is designed for that. But now would like a landscape, but using tricks to get it to display on multiple aspect ratio screens, it's one or the other. Or maybe Erel could fix this to allow changes? I'll go into detail if need be.)
 
Last edited:

wheretheidivides

Active Member
Licensed User
Longtime User
OK, let me explain a bit. If you have a portrait mode layout and then make a landscape variant, some things you can change and others you can not.

You can change the position and size of panels. You can not change the font size. If you do, then the font size is changed for both portrait and landscape. SO that's what I mean. It'd be nice if you could change everything in landscape without effecting portrait mode. Especially text would be amazing.

See, the text on the panels were designed for portrait, but when you change to landscape, they don't fit. You have to modify the position and scale. But then some of the text gets cut off.

This would also allow panels to be different on layout and portrait. Let's say that I use 3 invisible panels in portrait mode to stretch out the objects. 1 gets docked on top, 1 on the bottom and 1 in the middle. Now all aspect ratios look good. But if I go to landscape mode, this doesn't work. I want to center them horizontally. They are too tall for landscape. O if you could change the parent of other things for landscape, then one could modify the landscape layout to make it look good on all aspect ratios.

If you don't get what I mean, download low-joe from play store. Look at portrait and you will see good layout. Now look at landscape. See the right side of the screen? This open area is on some devices with a longer aspect ratio. The thing is I can not center the items as they are on invisible panels designed for portrait mode Now if there was a way in landscape mode to add an invisible panel and put these objects on it, I could just center the invisible panel. see what I mean?

and no, if I put everything on a invisible panel for portrait mode, then I could not stretch it out height wise.
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Apart from using designer's scripts in order to reorganize your layout, if you insist on loading different layouts according to position type, you can use methods as for e.g.
B4X:
if 100%x>100%y then 'load landscape layout else 'load portrait
 
Upvote 0
Top