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() . 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   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
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
@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
@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
@UiHandler("btnCloseGrid")
void onCloseGrid(ClickEvent e) {
    MaterialAnimation gridAnimation = new MaterialAnimation();
    gridAnimation.setTransition(Transition.CLOSE_GRID);
    gridAnimation.animate(gridPanel);
}
 
Example 6
@UiHandler("btnShowGrid")
void onShowGrid(ClickEvent e) {
    MaterialAnimation gridAnimation = new MaterialAnimation();
    gridAnimation.setTransition(Transition.SHOW_GRID);
    gridAnimation.animate(gridPanel);
}
 
Example 7
@UiHandler("btnStaggered")
void onStaggered(ClickEvent e) {
    MaterialAnimation gridAnimation = new MaterialAnimation();
    gridAnimation.setTransition(Transition.SHOW_STAGGERED_LIST);
    gridAnimation.animate(listContainer);
}
 
Example 8
@UiHandler("btnFade")
void onFade(ClickEvent e) {
    MaterialAnimation gridAnimation = new MaterialAnimation();
    gridAnimation.setTransition(Transition.FADE_IN_IMAGE);
    gridAnimation.animate(image);
}