android.widget.ViewFlipper.getInAnimation()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中android.widget.ViewFlipper.getInAnimation()方法的一些代码示例,展示了ViewFlipper.getInAnimation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ViewFlipper.getInAnimation()方法的具体详情如下:
包路径:android.widget.ViewFlipper
类名称:ViewFlipper
方法名:getInAnimation

ViewFlipper.getInAnimation介绍

暂无

代码示例

代码示例来源:origin: davideas/FlipView

private void initInAnimation(@IntRange(from = 0) long duration) {
  if (getInAnimation() == null)
    this.setInAnimation(getContext(), R.anim.grow_from_middle_x_axis);
  super.getInAnimation().setDuration(duration);
  super.getInAnimation().setStartOffset(anticipateInAnimationTime > duration ?
      duration : duration - anticipateInAnimationTime);
}

代码示例来源:origin: davideas/FlipView

/**
 * Shows a specific View immediately, no animation will be performed.
 * <p>Command is always performed even if the view is disabled.</p>
 *
 * @param whichChild the index of the child view to display (first View has {@code index=0}).
 */
public final void flipSilently(int whichChild) {
  if (DEBUG) Log.d(TAG, "flipSilently whichChild=" + whichChild);
  whichChild = checkIndex(whichChild);
  Animation inAnimation = super.getInAnimation();
  Animation outAnimation = super.getOutAnimation();
  super.setInAnimation(null);
  super.setOutAnimation(null);
  super.setDisplayedChild(whichChild);
  super.setInAnimation(inAnimation);
  super.setOutAnimation(outAnimation);
}

代码示例来源:origin: tyzlmjj/AndroidUI

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  final TextView textView = (TextView) findViewById(R.id.text);
  final ViewFlipper flipper = (ViewFlipper) findViewById(R.id.flipper);
  flipper.addView(getImageView(R.mipmap.abcde_a));
  flipper.addView(getImageView(R.mipmap.abcde_b));
  flipper.addView(getImageView(R.mipmap.abcde_d));
  flipper.setInAnimation(this, R.anim.push_up_in);
  flipper.setOutAnimation(this, R.anim.push_up_out);
  flipper.setFlipInterval(3000);
  flipper.getInAnimation().setAnimationListener(new Animation.AnimationListener() {
    @Override
    public void onAnimationStart(Animation animation) {
    }
    @Override
    public void onAnimationEnd(Animation animation) {
      textView.setText((flipper.getDisplayedChild()+1)+"/"+flipper.getChildCount());
    }
    @Override
    public void onAnimationRepeat(Animation animation) {
    }
  });
  textView.setText((flipper.getDisplayedChild()+1)+"/"+flipper.getChildCount());
  flipper.startFlipping();
}

相关文章