Java Code Examples for gwt.material.design.addins.client.pathanimator.MaterialPathAnimator#reverseAnimate()

The following examples show how to use gwt.material.design.addins.client.pathanimator.MaterialPathAnimator#reverseAnimate() . 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: PathAnimatorShowcase.java    From gwt-material-demo with Apache License 2.0 6 votes vote down vote up
@UiHandler("btnPause")
void onPause(ClickEvent e){
    // Execute the close callback animation
    MaterialPathAnimator.reverseAnimate(btnFAB.getElement(), musicPanel.getElement(), () -> {
        // Setting the visibility of the FAB for reverse animation
        new MaterialAnimation().transition(Transition.ZOOMIN).animate(btnFAB);
        btnFAB.setVisibility(Style.Visibility.VISIBLE);
        btnFAB.setOpacity(1);

        // Hide the music panel once the pause button is clicked
        musicPanel.setVisibility(Style.Visibility.HIDDEN);
        musicPanel.setOpacity(0);

        // Setting the previous music label with Bounce down animation
        lblMusic.setText("Lady Gaga / Telephone");
        new MaterialAnimation().transition(Transition.BOUNCEINDOWN).animate(lblMusic);

        // Setting the image of the artist
        imgMusic.setUrl("https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRi9lfCkLutb7ugJlIjn84qWNoiICopC-Vyx7QQJRHF5E7GlqFG");
    });
}
 
Example 2
Source File: MaterialOverlayTab.java    From gwt-material-addins with Apache License 2.0 6 votes vote down vote up
public void minimize(MaterialOverlay overlay) {
    if (!maximized) {
        MaterialPathAnimator animator = new MaterialPathAnimator();
        animator.setReverseCallback(() -> {
            register(overlay);
            overlay.getElement().getStyle().setVisibility(Style.Visibility.HIDDEN);
            overlay.getElement().getStyle().setOpacity(0);
        });
        animator.setSourceElement(activator.getElement());
        animator.setTargetElement(overlay.getElement());
        animator.reverseAnimate();
        body().attr("style", "overflow: auto !important");
    } else {
        Scheduler.get().scheduleDeferred(() -> {
            overlays.stream().filter(other -> other != overlay).forEach(other -> other.removeStyleName(AddinsCssName.HIDDEN));
            overlay.removeStyleName(AddinsCssName.MAXIMIZE);
        });
    }
    maximized = false;
}
 
Example 3
Source File: MaterialPathAnimatorTest.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
public void testStaticInstance() {
    // given
    MaterialPanel source = new MaterialPanel();
    MaterialPanel target = new MaterialPanel();
    RootPanel.get().add(source);
    RootPanel.get().add(target);

    // when / then
    target.setVisibility(Style.Visibility.HIDDEN);
    target.setOpacity(0);
    assertEquals("hidden", target.getElement().getStyle().getVisibility());
    assertEquals("0", target.getElement().getStyle().getOpacity());
    MaterialPathAnimator.animate(source, target);
    MaterialPathAnimator.reverseAnimate(source, target);
}
 
Example 4
Source File: TreeView.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
@UiHandler("btnFinish")
void onFinishDialog(ClickEvent e) {
    MaterialTreeItem item = new MaterialTreeItem();
    item.setText(txtName.getText());
    item.setIconType(IconType.FOLDER);
    item.setIconColor(Color.BLUE);
    docTree.getSelectedItem().addItem(item);
    MaterialPathAnimator.reverseAnimate(btnAdd.getElement(), addOverlay.getElement());
}
 
Example 5
Source File: TreeView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnCancel")
void onCancelDialog(ClickEvent e) {
    MaterialPathAnimator.reverseAnimate(btnAdd.getElement(), addOverlay.getElement());
}
 
Example 6
Source File: PathAnimatorView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnClose1")
void onClose(ClickEvent e) {
    MaterialPathAnimator.reverseAnimate(btnSource1.getElement(), panelTarget1.getElement());
}
 
Example 7
Source File: PathAnimatorView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnClose2")
void onCardClose(ClickEvent e) {
    MaterialPathAnimator.reverseAnimate(btnSource2.getElement(), panelTarget2.getElement());
}
 
Example 8
Source File: PathAnimatorView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnClose3")
void onCardClose3(ClickEvent e) {
    MaterialPathAnimator.reverseAnimate(btnSource3.getElement(), panelTarget3.getElement());
}
 
Example 9
Source File: PathAnimatorView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnClose4")
void onClose4(ClickEvent e) {
    MaterialPathAnimator.reverseAnimate(btnSource4.getElement(), panelTarget4.getElement());
}
 
Example 10
Source File: PathAnimatorView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnCloseCol1")
void onCloseCol1(ClickEvent e) {
    MaterialPathAnimator.reverseAnimate(col1.getElement(), panelTargetCol1.getElement());
}
 
Example 11
Source File: PathAnimatorView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnCloseCol2")
void onCloseCol2(ClickEvent e) {
    MaterialPathAnimator.reverseAnimate(col2.getElement(), panelTargetCol2.getElement());
}
 
Example 12
Source File: PathAnimatorView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnCloseCol3")
void onCloseCol3(ClickEvent e) {
    MaterialPathAnimator.reverseAnimate(col3.getElement(), panelTargetCol3.getElement());
}
 
Example 13
Source File: PathAnimatorView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnCloseCol4")
void onCloseCol4(ClickEvent e) {
    MaterialPathAnimator.reverseAnimate(col4.getElement(), panelTargetCol4.getElement());
}
 
Example 14
Source File: PathAnimatorView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnCloseCol5")
void onCloseCol5(ClickEvent e) {
    MaterialPathAnimator.reverseAnimate(col5.getElement(), panelTargetCol5.getElement());
}
 
Example 15
Source File: PathAnimatorView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnCloseCol6")
void onCloseCol6(ClickEvent e) {
    MaterialPathAnimator.reverseAnimate(col6.getElement(), panelTargetCol6.getElement());
}
 
Example 16
Source File: PathAnimatorView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnCloseCol7")
void onCloseCol7(ClickEvent e) {
    MaterialPathAnimator.reverseAnimate(col7.getElement(), panelTargetCol7.getElement());
}
 
Example 17
Source File: TreeView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnDelete")
void onDeleteDialog(ClickEvent e) {
    docTree.getSelectedItem().removeFromTree();
    MaterialPathAnimator.reverseAnimate(btnAdd.getElement(), addOverlay.getElement());
}
 
Example 18
Source File: ProfileOverlay.java    From gwt-material-patterns with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnCloseProfile")
void onCloseProfiled(ClickEvent e){
    MaterialPathAnimator.reverseAnimate(getCustomerCollapsible().getColapsItem().getElement(), overlay.getElement());
}