Code example for ViewFlipper

Methods: getChildAtgetCurrentView

0
  public void setContentView(int which) {
    flipper.setDisplayedChild(which);
  } 
 
  public void animateContentView(final int child) {
    final View currentView = flipper.getCurrentView();
    final View nextView = flipper.getChildAt(child);
    TextView text1 = (TextView) currentView.findViewById(android.R.id.text1);
    TextView text2 = (TextView) currentView.findViewById(android.R.id.text2);
 
    AnimatorSet fadeAnim = new AnimatorSet();
    fadeAnim.playTogether(ObjectAnimator.ofFloat(text1, "alpha", 1, 0),
        ObjectAnimator.ofFloat(text2, "alpha", 1, 0));
 
    // AnimatorSet scaleAnim = new AnimatorSet(); 
    // scaleAnim.playTogether(ObjectAnimator.ofFloat(currentView, "scaleX", 1, 0.5f), 
    // ObjectAnimator.ofFloat(currentView, "scaleY", 1, 0.5f)); 
    // 
    // AnimatorSet flipAnim = new AnimatorSet(); 
    // flipAnim.playTogether(ObjectAnimator.ofFloat(currentView, "rotationX", 0, 90)); 
    //