Java Code Examples for gwt.material.design.client.ui.animate.MaterialAnimation#animate()

The following examples show how to use gwt.material.design.client.ui.animate.MaterialAnimation#animate() . 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: AnimationTest.java    From gwt-material with 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 File: CoreAnimationsView.java    From gwt-material-demo with 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 3
Source File: CoreAnimationsView.java    From gwt-material-demo with 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 4
Source File: CoreAnimationsView.java    From gwt-material-demo with 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 5
Source File: MeaningfulAnimationsView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnCloseGrid")
void onCloseGrid(ClickEvent e) {
    MaterialAnimation gridAnimation = new MaterialAnimation();
    gridAnimation.setTransition(Transition.CLOSE_GRID);
    gridAnimation.animate(gridPanel);
}
 
Example 6
Source File: MeaningfulAnimationsView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnShowGrid")
void onShowGrid(ClickEvent e) {
    MaterialAnimation gridAnimation = new MaterialAnimation();
    gridAnimation.setTransition(Transition.SHOW_GRID);
    gridAnimation.animate(gridPanel);
}
 
Example 7
Source File: MeaningfulAnimationsView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnStaggered")
void onStaggered(ClickEvent e) {
    MaterialAnimation gridAnimation = new MaterialAnimation();
    gridAnimation.setTransition(Transition.SHOW_STAGGERED_LIST);
    gridAnimation.animate(listContainer);
}
 
Example 8
Source File: MeaningfulAnimationsView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnFade")
void onFade(ClickEvent e) {
    MaterialAnimation gridAnimation = new MaterialAnimation();
    gridAnimation.setTransition(Transition.FADE_IN_IMAGE);
    gridAnimation.animate(image);
}