MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / setAllowClose

Method setAllowClose

CodenameOne/src/com/codename1/ui/Sheet.java:527–543  ·  view source on GitHub ↗
(boolean allowClose)

Source from the content-addressed store, hash-verified

525 /// - `allowClose`: True to allow user to close the sheet. False to prevent it.
526 ///
527 public void setAllowClose(boolean allowClose) {
528 if (allowClose != this.allowClose) {
529 this.allowClose = allowClose;
530 if (!allowClose && isInitialized()) {
531 form.removePointerPressedListener(formPointerListener);
532 detachSwipeListeners(form);
533 dragging = false;
534 } else if (allowClose && isInitialized()) {
535 form.addPointerPressedListener(formPointerListener);
536 attachSwipeListeners(form);
537 }
538 if (parentSheet == null) {
539 backButton.setVisible(allowClose);
540 backButton.setEnabled(allowClose);
541 }
542 }
543 }
544
545 /// Checks whether this sheet can be dismissed by swiping it toward the
546 /// edge of the screen (e.g. swiping down for a south-positioned sheet).

Callers 2

Calls 7

detachSwipeListenersMethod · 0.95
attachSwipeListenersMethod · 0.95
setEnabledMethod · 0.65
isInitializedMethod · 0.45
setVisibleMethod · 0.45

Tested by 2