Dialogs truncated in landscape mode on Android device

27 views
Skip to first unread message

P5music

unread,
Mar 18, 2021, 4:40:07 AM3/18/21
to CodenameOne Discussions
I am testing my CodenameOne app on real Android device or emulators, and I see that in landscape mode it can happens that dialogs, even small ones, are in bad positioning ad their buttons does not appear.

I have some long dialogs, like the license disclaimer, that are scrollable and it solves for it.

But I cannot make small dialogs scrollable just to see the buttons. 

So is it possible to have a better positioning of dialogs?
The screen space is severely limited by the topbar, that is huge.
Many dialogs are truncated, some of them are not readable at all.

Is there a solution?

Javier Anton

unread,
Mar 18, 2021, 4:54:50 AM3/18/21
to codenameone...@googlegroups.com
Are you placing a TextArea/SpanLabel in your Dialog? If so, you need to recalculate its size after shown and resize it

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/1d9f520b-e177-4e13-a446-9e2afabc9b15n%40googlegroups.com.

P5music

unread,
Mar 18, 2021, 5:11:36 AM3/18/21
to CodenameOne Discussions
Sorry,
what I wrote is misleading, the issue is that the topbar being huge, the dialogs are overflowing at the bottom, they are in good shape, like they are in portrait mode. Just there is not enough space. Maybe I have to use smaller text and optimize spacings. 


Javier Anton

unread,
Mar 18, 2021, 5:16:12 AM3/18/21
to codenameone...@googlegroups.com
I assume you are talking about InteractionDialog. There is a method setFormMode that switches drawing over toolbar I believe

P5music

unread,
Mar 18, 2021, 10:45:06 AM3/18/21
to CodenameOne Discussions
@Javier that works but it seems a bit extreme: the dialogs now are on the top part of the interface.

Javier Anton

unread,
Mar 18, 2021, 5:25:16 PM3/18/21
to codenameone...@googlegroups.com
Use the show(int int int int) method and specify your margins

Shai Almog

unread,
Mar 19, 2021, 3:15:36 AM3/19/21
to CodenameOne Discussions
Reply all
Reply to author
Forward
0 new messages