Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CodenameOne/src/com/codename1/ui/spinner/Picker.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.codename1.ui.VirtualInputDevice;
import com.codename1.ui.events.ActionEvent;
import com.codename1.ui.events.ActionListener;
import com.codename1.ui.geom.Rectangle;
import com.codename1.ui.layouts.BorderLayout;
import com.codename1.ui.layouts.BoxLayout;
import com.codename1.ui.layouts.FlowLayout;
Expand Down Expand Up @@ -864,6 +865,21 @@ public void actionPerformed(ActionEvent evt) {
throw new RuntimeException("Attempt to show interaction dialog while button is not on form. Illegal state");
}

// The popup is anchored to the very bottom of the screen, so on devices with a
// bottom inset (e.g. the iPhone home indicator) its bottom-most row would be drawn
// underneath the inset. Reserve that inset as bottom padding so the whole popup stays
// inside the safe area. When BELOW_SPINNER custom buttons exist the padding goes on
// their bar (so the bar's background extends through the inset and the buttons remain
// tappable above it); otherwise it goes on the content pane. See issue #5152.
Rectangle safeArea = form.getSafeArea();
int bottomInset = Display.getInstance().getDisplayHeight() - (safeArea.getY() + safeArea.getHeight());
if (bottomInset > 0) {
Container insetTarget = bottomCustomButtons != null ? bottomCustomButtons : dlg.getContentPane();
Style insetStyle = insetTarget.getAllStyles();
insetStyle.setPaddingUnitBottom(Style.UNIT_TYPE_PIXELS);
insetStyle.setPaddingBottom(insetTarget.getStyle().getPaddingBottom() + bottomInset);
}

final int top = Math.max(0, form.getContentPane().getHeight() - dlg.getPreferredH());
if (top == 0) {
wrapper.getUnselectedStyle().setPaddingTop(0);
Expand Down
Binary file modified scripts/android/screenshots/LightweightPickerButtons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified scripts/android/screenshots/ValidatorLightweightPicker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified scripts/ios/screenshots-metal/LightweightPickerButtons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified scripts/ios/screenshots-metal/ValidatorLightweightPicker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified scripts/ios/screenshots/LightweightPickerButtons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified scripts/ios/screenshots/LightweightPickerButtons_above_center.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified scripts/ios/screenshots/LightweightPickerButtons_below_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified scripts/ios/screenshots/LightweightPickerButtons_between_mixed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified scripts/ios/screenshots/ValidatorLightweightPicker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading