1

I have an Android App that uses several popup dialogs.

I could figure out quite well how to style them, but there is still a big padding that looks odd on the screen.

enter image description here

Especially the top padding is huge. Seems to me that this the space for the title area. I have tried to remove it with d.getTitleComponent().remove(), but to no avail.

How can I reduce the padding?

This is my code:

 Button buttonDialog = new Button("Okay");
 Dialog d = new Dialog();
 TextArea popupBody = new TextArea("text.... !", 4, 10);                        
                    
 popupBody.setUIID("PopupBody");
 popupBody.setEditable(false);
                
 d.setLayout(new BorderLayout());
 d.setDialogUIID("Popup");
 d.setDisposeWhenPointerOutOfBounds(true);

 d.add(BorderLayout.CENTER, popupBody);
 d.add(BorderLayout.SOUTH,label);
 d.add(BorderLayout.NORTH,buttonDialog);

 d.showPopupDialog(buttonAgain);

CSS is like this:

Popup {
    background-color: white;
    border-radius: 5pt;
    padding: 0pt;
}

PopupBody {
    border: 2pt solid red;
    border-radius: 5pt;
    color: white;
    font-size: 8pt; 
    padding: 35pt;
}
rainer
  • 3,295
  • 5
  • 34
  • 50
  • I don't understand what you did here. Your showing a popup dialog but the styling of the red arrow is on a text area within the dialog. You have a label in the south which might take up space and PopupBody itself might have margin which take up space. Why not use the arrow of the popup itself? – Shai Almog Sep 07 '20 at 01:55
  • Shai, the arrow is not the problem. I am talking about the space above the label in the the south. The padding above the label "Okay" is too big. I am using padding 0 for the dialog and the label has no upper margin. Still the UPPER padding/ margin is too big .. When I use a title, the TOP padding is normal. Seems that there is a reserved space/ component for the title ..... – rainer Sep 07 '20 at 11:29
  • Concerning the arrow, I could import the image with PopupDialogArrowBottomImage: url(Botton_Arrow.png) .. but that's not the problem here. My problem is the margin above the button. I have edited the image for more clarity – rainer Sep 07 '20 at 14:14
  • We don't need that arrow stuff, newer popup dialogs work seamlessly without it. This is because popup dialogs need to reserve space for their own arrow so they take up that extra padding. I'm not sure why the arrow isn't rendered in your case. – Shai Almog Sep 08 '20 at 02:38

0 Answers0