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

Method hide

CodenameOne/src/com/codename1/ui/Sheet.java:1191–1219  ·  view source on GitHub ↗
(int duration)

Source from the content-addressed store, hash-verified

1189 }
1190
1191 private void hide(int duration) {
1192 final Container cnt = CN.getCurrentForm().getFormLayeredPane(Sheet.class, true);
1193 setX(getHiddenX(cnt));
1194 setY(getHiddenY(cnt));
1195 cnt.animateUnlayout(duration, 255, new Runnable() {
1196 @Override
1197 public void run() {
1198 Container parent = cnt.getParent();
1199
1200 if (parent != null && parent.getComponentForm() != null) {
1201 cnt.remove();
1202 Form parentForm = parent.getComponentForm();
1203 parentForm.revalidateLater();
1204 // revalidateLater() only schedules work for the next
1205 // paint cycle, but cnt.remove() does not by itself wake
1206 // the EDT, so without an explicit repaint here the
1207 // form's dim overlay remains on screen until the next
1208 // user input. See issue #4899.
1209 parentForm.repaint();
1210 fireCloseEvent(true);
1211 stopTrackingBounds();
1212
1213
1214 }
1215
1216 }
1217 });
1218
1219 }
1220
1221 /// Animates the sheet from its current (mid-drag) position to the off-screen
1222 /// hidden position and then disposes it. Unlike `#hide(int)` this does not

Callers 5

actionPerformedMethod · 0.95
backMethod · 0.95
capture.jsFile · 0.45
VaFunction · 0.45

Calls 7

getCurrentFormMethod · 0.95
setXMethod · 0.95
getHiddenXMethod · 0.95
setYMethod · 0.95
getHiddenYMethod · 0.95
animateUnlayoutMethod · 0.95
getFormLayeredPaneMethod · 0.80

Tested by

no test coverage detected