Java Code Examples for gwt.material.design.client.ui.animate.Transition

The following examples show how to use gwt.material.design.client.ui.animate.Transition. These examples are extracted from open source projects. 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 Project: gwt-material   Source File: AnimationTest.java    License: Apache License 2.0 6 votes vote down vote up
public void testAnimation() {
    MaterialPanel panel = new MaterialPanel();
    RootPanel.get().add(panel);
    MaterialAnimation animation = new MaterialAnimation();
    animation.delay(0);
    assertEquals(animation.getDelay(), 0);
    animation.infinite(true);
    assertTrue(animation.isInfinite());
    animation.infinite(false);
    assertFalse(animation.isInfinite());
    animation.duration(20);
    assertEquals(animation.getDuration(), 20);
    animation.transition(Transition.FADEIN);
    assertEquals(animation.getTransition(), Transition.FADEIN);
    animation.animate(panel);
    assertEquals(animation.getWidget(), panel);
    // Check Advance Logic
    String WEBKIT_ANIMATION_DURATION = panel.getElement().getStyle().getProperty("WebkitAnimationDuration");
    assertEquals(WEBKIT_ANIMATION_DURATION, animation.getDuration() + "ms");
}
 
Example 2
Source Project: gwt-material-demo   Source File: ApplicationView.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void setPageTitle(String title, String description, String link, String specification) {
    this.title.setText(title);
    this.description.setText(description);
    this.link = link;
    this.specification = specification;

    if (link.isEmpty()) {
        chipJava.setVisible(false);
        chipXml.setVisible(false);
    } else {
        chipJava.setVisible(true);
        chipXml.setVisible(true);
    }

    if (specification.isEmpty()) {
        chipSpecification.setVisible(false);
    } else {
        chipSpecification.setVisible(true);
    }

    new MaterialAnimation().transition(Transition.BOUNCEINLEFT).animate(this.title);
    new MaterialAnimation().transition(Transition.BOUNCEINLEFT).animate(this.description);
}
 
Example 3
Source Project: gwt-material-demo   Source File: PathAnimatorShowcase.java    License: Apache License 2.0 6 votes vote down vote up
@UiHandler("btnFAB")
void onFAB(ClickEvent e){
    // Execute the opening callback once the fab is clicked
    MaterialPathAnimator.animate(btnFAB.getElement(), musicPanel.getElement(), () -> {
        // Hide the fab with zoom out animation
        new MaterialAnimation().transition(Transition.ZOOMOUT).animate(btnFAB);
        btnFAB.setVisibility(Style.Visibility.HIDDEN);
        btnFAB.setOpacity(0);

        // Setting the visibility of the music panel
        musicPanel.setVisibility(Style.Visibility.VISIBLE);
        musicPanel.setOpacity(1);

        // Setting the music label with Bounce up animation
        lblMusic.setText("Pharell Williams / Love Yourself to Dance");
        new MaterialAnimation().transition(Transition.BOUNCEINUP).animate(lblMusic);

        // Setting the image of the artist
        imgMusic.setUrl("http://thatgrapejuice.net/wp-content/uploads/2013/08/pharrell-williams-that-grape-juice.png");
    });
}
 
Example 4
Source Project: gwt-material-demo   Source File: PathAnimatorShowcase.java    License: 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 5
Source Project: gwt-material-demo   Source File: CoreAnimationsView.java    License: Apache License 2.0 5 votes vote down vote up
private void animate() {
    String value = lstAnimations.getSelectedValue();
    Transition transition = Transition.fromStyleName(value);
    MaterialAnimation animation = new MaterialAnimation();
    animation.setTransition(transition);
    animation.setDelay(0);
    animation.setDuration(1000);
    animation.setInfinite(false);
    animation.animate(card);
}
 
Example 6
Source Project: gwt-material-demo   Source File: CoreAnimationsView.java    License: Apache License 2.0 5 votes vote down vote up
@UiHandler("btnAnimateInfinite")
void onAnimateInfinite(ClickEvent e) {
    infiniteAnimation = new MaterialAnimation();
    infiniteAnimation.setDelay(0);
    infiniteAnimation.setTransition(Transition.PULSE);
    infiniteAnimation.setDuration(1000);
    infiniteAnimation.setInfinite(true);
    infiniteAnimation.animate(iconHeart);
}
 
Example 7
Source Project: gwt-material-demo   Source File: CoreAnimationsView.java    License: Apache License 2.0 5 votes vote down vote up
@UiHandler("btnAnimateCallback")
void onCallback(ClickEvent e) {
    MaterialAnimation animation = new MaterialAnimation();
    animation.setDelay(0);
    animation.setDuration(1000);
    animation.transition(Transition.FLIPINX);
    animation.animate(iconCallback, () -> {
        MaterialToast.fireToast("Animation is finished");
    });
}
 
Example 8
Source Project: gwt-material-demo   Source File: ScrollFireView.java    License: Apache License 2.0 5 votes vote down vote up
@Inject
ScrollFireView(Binder uiBinder) {
    initWidget(uiBinder.createAndBindUi(this));

    MaterialScrollfire.apply(panel.getElement(), () -> {
        MaterialToast.fireToast("Toasted");
    });
    MaterialScrollfire.apply(listContainer.getElement(), () -> new MaterialAnimation().transition(Transition.SHOW_STAGGERED_LIST).animate(listContainer));
    MaterialScrollfire.apply(image.getElement(), () -> new MaterialAnimation().transition(Transition.FADE_IN_IMAGE).animate(image));

}
 
Example 9
Source Project: gwt-material-addins   Source File: WalkthroughItem.java    License: Apache License 2.0 5 votes vote down vote up
public void animate() {
    if (!animated) {
        new MaterialAnimation().transition(Transition.FADEIN).delay(0).duration(600).animate(image, () -> {
            image.setOpacity(1);
            titleLabel.setOpacity(1);
            descriptionLabel.setOpacity(1);
            new MaterialAnimation().transition(Transition.SLIDEINRIGHT).animate(titleLabel);
            new MaterialAnimation().transition(Transition.SLIDEINRIGHT).animate(descriptionLabel);
        });

        animated = true;
    }
}
 
Example 10
Source Project: gwt-material-addins   Source File: AppLoadingState.java    License: Apache License 2.0 5 votes vote down vote up
public void reset(Widget target, int delay) {
    new MaterialAnimation().transition(Transition.BOUNCEOUTDOWN).delay(delay).animate(this, () -> {
        target.setVisible(true);
        new MaterialAnimation().transition(Transition.BOUNCEINUP).animate(target, () -> {
            RootPanel.get().getElement().getStyle().clearOverflow();
            target.setVisible(true);
        });
        setVisible(false);
    });
}
 
Example 11
Source Project: gwt-material-addins   Source File: LoadingStatePanel.java    License: Apache License 2.0 5 votes vote down vote up
public void setState(State state, String title, String description) {
    this.state = state;
    setTitle(title);
    setDescription(description);
    setVisible(true);
    if (isAnimation()) {
        new MaterialAnimation().transition(Transition.BOUNCEIN).animate(icon);
        new MaterialAnimation().transition(Transition.BOUNCEINUP).animate(lblTitle);
        new MaterialAnimation().transition(Transition.BOUNCEINUP).animate(lblDescription);
    }
    if (state == State.LOADING) {
        icon.setIconType(IconType.LOOP);
        icon.setBackgroundColor(Color.WHITE);
        icon.setIconColor(Color.BLACK);
        LoadingEvent.fire(this);
        loader.show();

    } else if (state == State.SUCCESS) {
        loader.hide();
        icon.setIconType(IconType.CHECK);
        icon.setBackgroundColor(Color.BLUE);
        icon.setIconColor(Color.WHITE);

        SuccessEvent.fire(this);
    } else if (state == State.ERROR) {
        loader.hide();
        icon.setIconType(IconType.ERROR);
        icon.setBackgroundColor(Color.RED);
        icon.setIconColor(Color.WHITE);

        ErrorEvent.fire(this);
    }
}
 
Example 12
Source Project: gwt-material-demo   Source File: PathAnimatorShowcase.java    License: Apache License 2.0 4 votes vote down vote up
public PathAnimatorShowcase() {
    initWidget(uiBinder.createAndBindUi(this));
    new MaterialAnimation().transition(Transition.BOUNCEINDOWN).animate(btnFAB);
}
 
Example 13
@UiHandler("btnCloseGrid")
void onCloseGrid(ClickEvent e) {
    MaterialAnimation gridAnimation = new MaterialAnimation();
    gridAnimation.setTransition(Transition.CLOSE_GRID);
    gridAnimation.animate(gridPanel);
}
 
Example 14
@UiHandler("btnShowGrid")
void onShowGrid(ClickEvent e) {
    MaterialAnimation gridAnimation = new MaterialAnimation();
    gridAnimation.setTransition(Transition.SHOW_GRID);
    gridAnimation.animate(gridPanel);
}
 
Example 15
@UiHandler("btnStaggered")
void onStaggered(ClickEvent e) {
    MaterialAnimation gridAnimation = new MaterialAnimation();
    gridAnimation.setTransition(Transition.SHOW_STAGGERED_LIST);
    gridAnimation.animate(listContainer);
}
 
Example 16
@UiHandler("btnFade")
void onFade(ClickEvent e) {
    MaterialAnimation gridAnimation = new MaterialAnimation();
    gridAnimation.setTransition(Transition.FADE_IN_IMAGE);
    gridAnimation.animate(image);
}
 
Example 17
Source Project: gwt-material-demo   Source File: CardsView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("btnShow")
void onShow(ClickEvent e) {
    new MaterialAnimation().transition(Transition.SHOW_GRID).animate(rowCards);
}
 
Example 18
Source Project: gwt-material-addins   Source File: MaterialStepper.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setNextInTransition(Transition transition) {
    getStepperTransitionMixin().setNextInTransition(transition);
}
 
Example 19
Source Project: gwt-material-addins   Source File: MaterialStepper.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setNextOutTransition(Transition transition) {
    getStepperTransitionMixin().setNextOutTransition(transition);
}
 
Example 20
Source Project: gwt-material-addins   Source File: MaterialStepper.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setPreviousInTransition(Transition transition) {
    getStepperTransitionMixin().setPreviousInTransition(transition);
}
 
Example 21
Source Project: gwt-material-addins   Source File: MaterialStepper.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setPreviousOutTransition(Transition transition) {
    getStepperTransitionMixin().setPreviousOutTransition(transition);
}
 
Example 22
@Override
public void setNextInTransition(Transition nextInTransition) {
    this.nextInTransition = nextInTransition;
}
 
Example 23
@Override
public void setNextOutTransition(Transition nextOutTransition) {
    this.nextOutTransition = nextOutTransition;
}
 
Example 24
@Override
public void setPreviousInTransition(Transition previousInTransition) {
    this.previousInTransition = previousInTransition;
}
 
Example 25
@Override
public void setPreviousOutTransition(Transition previousOutTransition) {
    this.previousOutTransition = previousOutTransition;
}
 
Example 26
Source Project: gwt-material-addins   Source File: HasStepperTransition.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Will set the next incoming transition of {@link gwt.material.design.addins.client.stepper.MaterialStepper}
 */
void setNextInTransition(Transition transition);
 
Example 27
Source Project: gwt-material-addins   Source File: HasStepperTransition.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Will set the next out coming transition of {@link gwt.material.design.addins.client.stepper.MaterialStepper}
 */
void setNextOutTransition(Transition transition);
 
Example 28
Source Project: gwt-material-addins   Source File: HasStepperTransition.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Will set the previous incoming transition of {@link gwt.material.design.addins.client.stepper.MaterialStepper}
 */
void setPreviousInTransition(Transition transition);
 
Example 29
Source Project: gwt-material-addins   Source File: HasStepperTransition.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Will set the previous out coming transition of {@link gwt.material.design.addins.client.stepper.MaterialStepper}
 */
void setPreviousOutTransition(Transition transition);