Dialog resizing issue

91 views
Skip to first unread message

Mario Barón

unread,
Oct 21, 2013, 12:26:59 PM10/21/13
to codenameone...@googlegroups.com
Hey guys, 

I have an issue with the dialogs of my Android app, I created the dialog using the Designer but within it I have a label which is supposed to show an image I capture using the device's camera. The problem occurs randomly and apparently has to do with the resizing of the dialog to fit the Image I'm trying to show. I attach a couple of screenshots of the problem. The first screenshot of the problem is when the device is held vertically, the second one is when the device is held horizontally and the third one is how it is supposed to look.

Could this be an issue with the dialog class or is it something that I have to set to the Dialog to behave correctly. 


Thanks a lot for your help
Dialog resize 1.png
Dialog resize 3.png
Dialog resize 2.png

Shai Almog

unread,
Oct 21, 2013, 4:09:01 PM10/21/13
to codenameone...@googlegroups.com
Hi,
does it happen after rotation when the dialog is already visible?
You can try invoking Dialog.setAutoAdjustDialogSize(false) and see if it helps.

Mario Barón

unread,
Oct 21, 2013, 4:39:23 PM10/21/13
to codenameone...@googlegroups.com
Hey Shai,

thanks for the quick answer. The problem occurs right after I capture the photo like this:

Image img = controladorCamara.capturarFoto(Utilidades.getAnchoFotoCamara(), Utilidades.getAltoFotoCamara());
       
if (img != null) {
   
Resources res = fetchResourceFile();
   
Dialog d = (Dialog) createContainer(res, "AgregarRegistroVisual");
    d
.setDisposeWhenPointerOutOfBounds(true);
    findLblImagenRegistro
(d).setIcon(imagen);
}

I'll try your suggestion to see if it helps. Oh, by the way, the Android build server appears to be down or at least not displaying the builds sent as of now, is it under maintenance?

Thanks for your help.

Mario Barón

unread,
Oct 21, 2013, 5:14:15 PM10/21/13
to codenameone...@googlegroups.com
Hey Shai,

jumm it didn't work, as a matter of fact it's kind of happening more regularly now. The device I'm using is the galaxy note 2. Any other idea why this could be happening?

thanks.


On Monday, October 21, 2013 11:26:59 AM UTC-5, Mario Barón wrote:

Shai Almog

unread,
Oct 22, 2013, 1:48:16 AM10/22/13
to codenameone...@googlegroups.com
I see you creating the dialog but I don't see the code of showing the dialog?
Do you show it on the EDT?
Reply all
Reply to author
Forward
0 new messages