Android Question Why does this app layout fail in split screen?

agraham

Expert
Licensed User
Longtime User
I am trying to make an app adapt to split-screen mode, which is by default approximately square on my Android 10 Xaiomi Mi Max 3 but it doesn't work as I expect - perhaps I expect wrong!

It only ever loads the landscape or portrait variants, even when in split screen mode.

Also if you hold the device in portrait mode with this app as the top split-screen app and reduce the vertical height of the app by pushing the splitter bar up then the layout remains the portrait layout but the anchoring of the lower buttons fails and they are not shown.

Maybe it's me but I don't get this at all :(
 

Attachments

  • SplitScreenTest.zip
    9.6 KB · Views: 170

agraham

Expert
Licensed User
Longtime User
If 100%y < 400 Then
That's a bit hacky! It's the sort of code smell that I would try to avoid, embedding constants in code. That's why in post #16 above I suggested a SplitScreen keyword in designer script with a couple of other enhancements.
 
Upvote 0

AnandGupta

Expert
Licensed User
Longtime User
I give up. You insist that using anchors and designer script is the way to do things but are then resistant to suggestions that would make it easier to do just that!
I think it is because, there is a limit a 'designer' can do. We have to understand that a designer may fail in some specific conditions.
Take for example, I create a button in center in a 4" screen in designer, then it will not be in center in a 6" screen. The designer do not have the option to set it with anchors. Things become more complicated if we add more buttons and labels to it.

Using script we have to set some views and rest fall in line.

Correct me if I am wrong.

Regards,

Anand
 
Upvote 0
Top