Java Code Examples for com.codename1.ui.Dialog#setTransitionOutAnimator()
The following examples show how to use
com.codename1.ui.Dialog#setTransitionOutAnimator() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Oauth2.java From CodenameOne with GNU General Public License v2.0 | 6 votes |
/** * This method preforms the actual authentication, this method is a blocking * method that will display the user the html authentication pages. * * @return the method if passes authentication will return the access token * or null if authentication failed. * * @throws IOException the method will throw an IOException if something * went wrong in the communication. * @deprecated use createAuthComponent or showAuthentication which work * asynchronously and adapt better to different platforms */ public String authenticate() { if (token == null) { login = new Dialog(); boolean i = Dialog.isAutoAdjustDialogSize(); Dialog.setAutoAdjustDialogSize(false); login.setLayout(new BorderLayout()); login.setScrollable(false); Component html = createLoginComponent(null, null, null, null); login.addComponent(BorderLayout.CENTER, html); login.setScrollable(false); login.setDialogUIID("Container"); login.setTransitionInAnimator(CommonTransitions.createSlide(CommonTransitions.SLIDE_VERTICAL, true, 300)); login.setTransitionOutAnimator(CommonTransitions.createSlide(CommonTransitions.SLIDE_VERTICAL, false, 300)); login.show(0, 0, 0, 0, false, true); Dialog.setAutoAdjustDialogSize(i); } return token; }
Example 2
Source File: MasterDetail.java From CodenameOne with GNU General Public License v2.0 | 4 votes |
/** * @deprecated this was a half baked idea that made it into the public API */ public static void bindTabletLandscapeMaster(final Form rootForm, Container parentContainer, Component landscapeUI, final Component portraitUI, final String commandTitle, Image commandIcon) { landscapeUI.setHideInPortrait(true); parentContainer.addComponent(BorderLayout.WEST, landscapeUI); final Command masterCommand = new Command(commandTitle, commandIcon) { public void actionPerformed(ActionEvent ev) { Dialog dlg = new Dialog(); dlg.setLayout(new BorderLayout()); dlg.setDialogUIID("Container"); dlg.getContentPane().setUIID("Container"); Container titleArea = new Container(new BorderLayout()); dlg.addComponent(BorderLayout.NORTH, titleArea); titleArea.setUIID("TitleArea"); Label title = new Label(commandTitle); titleArea.addComponent(BorderLayout.CENTER, title); title.setUIID("Title"); Container body = new Container(new BorderLayout()); body.setUIID("Form"); body.addComponent(BorderLayout.CENTER, portraitUI); dlg.setTransitionInAnimator(CommonTransitions.createSlide(CommonTransitions.SLIDE_HORIZONTAL, false, 250)); dlg.setTransitionOutAnimator(CommonTransitions.createSlide(CommonTransitions.SLIDE_HORIZONTAL, true, 250)); dlg.addComponent(BorderLayout.CENTER, body); dlg.setDisposeWhenPointerOutOfBounds(true); dlg.showStetched(BorderLayout.WEST, true); dlg.removeComponent(portraitUI); } }; if(Display.getInstance().isPortrait()) { if(rootForm.getCommandCount() > 0) { rootForm.addCommand(masterCommand, 1); } else { rootForm.addCommand(masterCommand); } } rootForm.addOrientationListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { if(portraitUI.getParent() != null) { Form f = Display.getInstance().getCurrent(); if(f instanceof Dialog) { ((Dialog)f).dispose(); } } if(Display.getInstance().isPortrait()) { rootForm.addCommand(masterCommand, 1); } else { rootForm.removeCommand(masterCommand); rootForm.revalidate(); } } }); }