List of usage examples for android.view.animation LinearInterpolator LinearInterpolator
public LinearInterpolator()
From source file:org.chromium.chrome.browser.toolbar.ToolbarPhone.java
private ObjectAnimator createEnterTabSwitcherModeAnimation() { ObjectAnimator enterAnimation = ObjectAnimator.ofFloat(this, mTabSwitcherModePercentProperty, 1.f); enterAnimation.setDuration(TAB_SWITCHER_MODE_ENTER_ANIMATION_DURATION_MS); enterAnimation.setInterpolator(new LinearInterpolator()); enterAnimation.addListener(new AnimatorListenerAdapter() { @Override/*from ww w . j a va2s .c o m*/ public void onAnimationEnd(Animator animation) { // This is to deal with the view going invisible when resuming the activity and // running this animation. The view is still there and clickable but does not // render and only a layout triggers a refresh. See crbug.com/306890. if (!mToggleTabStackButton.isEnabled()) requestLayout(); } }); return enterAnimation; }
From source file:org.chromium.chrome.browser.toolbar.ToolbarPhone.java
private ObjectAnimator createExitTabSwitcherAnimation(final boolean animateNormalToolbar) { ObjectAnimator exitAnimation = ObjectAnimator.ofFloat(this, mTabSwitcherModePercentProperty, 0.f); exitAnimation.setDuration(animateNormalToolbar ? TAB_SWITCHER_MODE_EXIT_NORMAL_ANIMATION_DURATION_MS : TAB_SWITCHER_MODE_EXIT_FADE_ANIMATION_DURATION_MS); exitAnimation.setInterpolator(new LinearInterpolator()); exitAnimation.addListener(new AnimatorListenerAdapter() { @Override/* w w w . j a v a2 s .c o m*/ public void onAnimationEnd(Animator animation) { updateViewsForTabSwitcherMode(); } }); return exitAnimation; }
From source file:com.aimfire.demo.CamcorderActivity.java
/** * Style 1 animation will simulate a determinate loading * * @return Animator/* w w w . jav a 2 s. c om*/ */ private Animator prepare3DAnimator() { final AnimatorSet animatorSet = new AnimatorSet(); mScanProgDrawable.setIndeterminate(false); mScanProgDrawable.setUseRotation(false); mScanProgDrawable.setUseArc(false); mScanProgDrawable.setUseAlpha(false); mScanProgDrawable.setUseWifiBar(true); mScanProgDrawable.setMessageText(getString(R.string.scanning)); mScanProgDrawable.setSuppText(getString(R.string.tap_to_stop)); //if(!mScanProgDrawable.getMessageText().equals(getString(R.string.connecting))) //{ //mScanProgDrawable.setMessageText(getString(R.string.scanning) + (mAnimCyclesCnt+1) + " of " + CONNECT_ANIM_CYCLES); //} Animator determinateAnimator = ObjectAnimator.ofFloat(mScanProgDrawable, CircularProgressDrawable.PROGRESS_PROPERTY, 0, 1); determinateAnimator.setDuration(CONNECT_ANIM_CYCLE_LENGTH_SECONDS * 1000); /* * wifi bar highlight changes 3 times a second */ Animator wifiBarAnimator = ObjectAnimator.ofInt(mScanProgDrawable, CircularProgressDrawable.WIFI_BAR_PROPERTY, 0, 2 * CONNECT_ANIM_CYCLE_LENGTH_SECONDS); wifiBarAnimator.setDuration(CONNECT_ANIM_CYCLE_LENGTH_SECONDS * 1000); wifiBarAnimator.setInterpolator(new LinearInterpolator()); animatorSet.playTogether(wifiBarAnimator, determinateAnimator); animatorSet.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animator) { restartScanAnim(); } }); return animatorSet; }
From source file:com.lifehackinnovations.siteaudit.FloorPlanActivity.java
public ImageView.OnLayoutChangeListener hourglasslistener() { OnLayoutChangeListener olcl = new ImageView.OnLayoutChangeListener() { @Override/*from w ww .j a v a 2 s. c o m*/ public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { RotateAnimation animation = new RotateAnimation(0f, 350f, v.getWidth() / 2, v.getHeight() / 2); animation.setInterpolator(new LinearInterpolator()); animation.setRepeatCount(Animation.INFINITE); animation.setDuration(700); ((ImageView) v).startAnimation(animation); } }; return olcl; }
From source file:cc.flydev.launcher.Page.java
private void onDropToDelete() { final View dragView = mDragView; final float toScale = 0f; final float toAlpha = 0f; // Create and start the complex animation ArrayList<Animator> animations = new ArrayList<Animator>(); AnimatorSet motionAnim = new AnimatorSet(); motionAnim.setInterpolator(new DecelerateInterpolator(2)); motionAnim.playTogether(ObjectAnimator.ofFloat(dragView, "scaleX", toScale), ObjectAnimator.ofFloat(dragView, "scaleY", toScale)); animations.add(motionAnim);//w w w.ja va 2 s . c o m AnimatorSet alphaAnim = new AnimatorSet(); alphaAnim.setInterpolator(new LinearInterpolator()); alphaAnim.playTogether(ObjectAnimator.ofFloat(dragView, "alpha", toAlpha)); animations.add(alphaAnim); final Runnable onAnimationEndRunnable = createPostDeleteAnimationRunnable(dragView); AnimatorSet anim = new AnimatorSet(); anim.playTogether(animations); anim.setDuration(DRAG_TO_DELETE_FADE_OUT_DURATION); anim.addListener(new AnimatorListenerAdapter() { public void onAnimationEnd(Animator animation) { onAnimationEndRunnable.run(); } }); anim.start(); mDeferringForDelete = true; }