Example #1
0
  public void previous(View view) {
    if (index >= 0) {
      mViewFlipper.setInAnimation(customAnimation.inFromLeftAnimation());
      mViewFlipper.setOutAnimation(customAnimation.outToRightAnimation());

      mViewFlipper.showPrevious();
      index--;
      ToggleRadioButton();
    }
  }
Example #2
0
  public void next(View view) {
    if (index < mViewFlipper.getChildCount()) {
      mViewFlipper.setInAnimation(customAnimation.inFromRightAnimation());
      mViewFlipper.setOutAnimation(customAnimation.outToLeftAnimation());

      mViewFlipper.showNext();
      index++;

      ToggleRadioButton();
    }
  }
  public void startAnimation(int x, int y) {

    createLog("Starting Animation");
    if (explosion == null || explosion.getState() == Explosion.STATE_DEAD) {
      explosion = new Explosion(EXPLOSION_SIZE, x, y);
    }

    mAnimation.setDuration(mDuration);
    mAnimation.setInterpolator(mInterpolator);
    startAnimation(mAnimation);

    createLog("Started");
  }
Example #4
0
  /** Initialize this example. */
  private Widget initialize() {

    // Create a new panel
    absolutePanel = new AbsolutePanel();

    // Add a widget that we will animate
    animateeTop = new Image("gwtLogoThumb.png");
    animateeBottom = new Image("gwtLogoThumb.png");
    animateeLeft = new Image("gwtLogoThumb.png");
    animateeRight = new Image("gwtLogoThumb.png");
    absolutePanel.add(animateeTop);
    absolutePanel.add(animateeBottom);
    absolutePanel.add(animateeLeft);
    absolutePanel.add(animateeRight);

    // Wrap the absolute panel in a DecoratorPanel
    VerticalPanel absolutePanelWrapper = new VerticalPanel();
    absolutePanelWrapper.add(absolutePanel);

    // Add the components to a panel and return it
    absolutePanelWrapper.add(createOptionsBar());

    // Create the custom animation
    animation = new CustomAnimation(70);

    // Set the start position of the widgets
    animation.onComplete();

    absolutePanel.setSize((animation.centerX * 2 + 10) + "px", (animation.centerY * 2 + 10) + "px");

    // Return the layout
    return absolutePanelWrapper;
  }
  public void setAnimationListener(ParticleAnimationListener listener) {
    mListener = listener;

    mAnimation.setAnimationListener(
        new AnimationListener() {

          @Override
          public void onAnimationStart(Animation animation) {}

          @Override
          public void onAnimationRepeat(Animation animation) {}

          @Override
          public void onAnimationEnd(Animation animation) {
            mListener.onAnimationEnd();
          }
        });
  }