List of usage examples for android.view.animation Animation start
public void start()
From source file:com.pdftron.pdf.utils.ViewerUtils.java
@TargetApi(Build.VERSION_CODES.HONEYCOMB) public static void animateView(final View view, final PDFViewCtrl pdfViewCtrl) { // Example of another animation that could be applied to the view. //ValueAnimator colorAnim = ObjectAnimator.ofInt(view, "backgroundColor", /*Red*/0xFFFF8080, /*Blue*/0xFF8080FF); //colorAnim.setDuration(1500); //colorAnim.setEvaluator(new ArgbEvaluator()); //colorAnim.setRepeatCount(2); //colorAnim.setRepeatMode(ValueAnimator.REVERSE); // Honeycomb introduced new Animation classes that are easier to use // and provide more options. Let's do a runtime check here and use // older classes for pre-Honeycomb devices. if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB) { AlphaAnimation anim1 = new AlphaAnimation(0.0f, 1.0f); final AlphaAnimation anim2 = new AlphaAnimation(1.0f, 0.0f); anim1.setDuration(500);/*from ww w . jav a 2 s . co m*/ anim2.setDuration(500); anim1.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { view.startAnimation(anim2); } }); anim2.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { if (pdfViewCtrl != null) { pdfViewCtrl.removeView(view); } } }); view.startAnimation(anim1); } else { // Since we want the flashing view to be removed once the animation // is finished, we use this listener to remove the view from // PDFViewCtrl when the event is triggered. Animator.AnimatorListener animListener = new Animator.AnimatorListener() { @Override public void onAnimationStart(Animator animation) { } @Override public void onAnimationRepeat(Animator animation) { } @Override public void onAnimationEnd(Animator animation) { pdfViewCtrl.removeView(view); } @Override public void onAnimationCancel(Animator animation) { } }; // Get animator for the flashing view. Animator fader = createAlphaAnimator(view, animListener); // If using more than one animator, you can create a set and // play them together, or in some other order... AnimatorSet animation = new AnimatorSet(); animation.playTogether(/*colorAnim, */fader); animation.start(); } }
From source file:org.zywx.wbpalmstar.engine.EBrowserWindow.java
public void removeViewFromCurrentWindow(View child) { //Message msg = mWindLoop.obtainMessage(); //msg.what = F_WHANDLER_REMOVE_VIEW; //msg.obj = child; //mWindLoop.sendMessage(msg); Animation removeAnim = child.getAnimation(); if (null != removeAnim) { removeAnim.start(); }/*from ww w . ja v a 2 s.c o m*/ removeView(child); }
From source file:org.zywx.wbpalmstar.engine.EBrowserWindow.java
public void addViewToCurrentWindow(View child) { //Message msg = mWindLoop.obtainMessage(); //msg.what = F_WHANDLER_ADD_VIEW; //msg.obj = child; //mWindLoop.sendMessage(msg); child.setTag(EViewEntry.F_PLUGIN_VIEW_TAG); Animation anim = child.getAnimation(); addView(child);/*from w ww. jav a 2 s . c om*/ if (null != anim) { anim.start(); } bringChildToFront(child); }