Dialog taking up more screen space than needed

40 views
Skip to first unread message

cubiq1

unread,
Aug 13, 2014, 9:33:48 AM8/13/14
to codenameone...@googlegroups.com

Hi,

When pressing "Log in" before dismissing the Android on-screen keyboard, the Logging-in dialog's size is displayed incorrectly and takes up most of the screen (see attached image).

This doesn't happen if I first dismiss the keyboard by pressing "Done", then pressing "Log in".

Is there a way to fix this?

Many thanks


Shai Almog

unread,
Aug 13, 2014, 10:59:18 AM8/13/14
to codenameone...@googlegroups.com
Hi,
use Dialog.setAutoAdjustDialogSize(false) but I suggest restoring it to true after the login completes.

cubiq1

unread,
Aug 13, 2014, 12:25:34 PM8/13/14
to codenameone...@googlegroups.com
Thanks Shai. Dialog.setAutoAdjustDialogSize(true) is working well.

cubiq1

unread,
Aug 13, 2014, 1:02:09 PM8/13/14
to codenameone...@googlegroups.com
My mistake. The code you suggested isn't working, even when set to true. My code is as follows:
       
     Dialog.setAutoAdjustDialogSize(false);
     showForm
("LoadingDialog", null);

Any other ideas?

Shai Almog

unread,
Aug 14, 2014, 2:24:19 AM8/14/14
to codenameone...@googlegroups.com
It should be working when set to false, just make sure you didn't set it back to true too soon.

cubiq1

unread,
Aug 14, 2014, 11:44:41 AM8/14/14
to codenameone...@googlegroups.com
Unfortunately not, it's still showing exactly the same size as seen in the image above.

Does it make a difference that I used the CN1 designer to create the logging-in dialog?

Thanks

Shai Almog

unread,
Aug 14, 2014, 1:19:32 PM8/14/14
to codenameone...@googlegroups.com
It shouldn't make a difference that you used the designer.

cubiq1

unread,
Aug 15, 2014, 5:08:28 AM8/15/14
to codenameone...@googlegroups.com
As a work around to the problem I display an empty dialog which is immediately disposed of, then I display the logging-in dialog. Is there a better way of doing this?

Shai Almog

unread,
Aug 15, 2014, 10:58:52 AM8/15/14
to codenameone...@googlegroups.com
I don't think this should be necessary but its hard to tell remotely exactly what is going on here.
Reply all
Reply to author
Forward
0 new messages