Here are the examples of the java api class android.view.animation.Animation taken from open source projects.
1. RayLayout#createShrinkAnimation()
Project: UltimateAndroid
File: RayLayout.java
File: RayLayout.java
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, long startOffset, long duration, Interpolator interpolator) { AnimationSet animationSet = new AnimationSet(false); animationSet.setFillAfter(true); final long preDuration = duration / 2; Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); rotateAnimation.setStartOffset(startOffset); rotateAnimation.setDuration(preDuration); rotateAnimation.setInterpolator(new LinearInterpolator()); rotateAnimation.setFillAfter(true); animationSet.addAnimation(rotateAnimation); Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720); translateAnimation.setStartOffset(startOffset + preDuration); translateAnimation.setDuration(duration - preDuration); translateAnimation.setInterpolator(interpolator); translateAnimation.setFillAfter(true); animationSet.addAnimation(translateAnimation); return animationSet; }
2. ArcLayout#createShrinkAnimation()
Project: UltimateAndroid
File: ArcLayout.java
File: ArcLayout.java
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, long startOffset, long duration, Interpolator interpolator) { AnimationSet animationSet = new AnimationSet(false); animationSet.setFillAfter(true); final long preDuration = duration / 2; Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); rotateAnimation.setStartOffset(startOffset); rotateAnimation.setDuration(preDuration); rotateAnimation.setInterpolator(new LinearInterpolator()); rotateAnimation.setFillAfter(true); animationSet.addAnimation(rotateAnimation); Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720); translateAnimation.setStartOffset(startOffset + preDuration); translateAnimation.setDuration(duration - preDuration); translateAnimation.setInterpolator(interpolator); translateAnimation.setFillAfter(true); animationSet.addAnimation(translateAnimation); return animationSet; }
3. RayLayout#createShrinkAnimation()
Project: UltimateAndroid
File: RayLayout.java
File: RayLayout.java
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, long startOffset, long duration, Interpolator interpolator) { AnimationSet animationSet = new AnimationSet(false); animationSet.setFillAfter(true); final long preDuration = duration / 2; Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); rotateAnimation.setStartOffset(startOffset); rotateAnimation.setDuration(preDuration); rotateAnimation.setInterpolator(new LinearInterpolator()); rotateAnimation.setFillAfter(true); animationSet.addAnimation(rotateAnimation); Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720); translateAnimation.setStartOffset(startOffset + preDuration); translateAnimation.setDuration(duration - preDuration); translateAnimation.setInterpolator(interpolator); translateAnimation.setFillAfter(true); animationSet.addAnimation(translateAnimation); return animationSet; }
4. ArcLayout#createShrinkAnimation()
Project: UltimateAndroid
File: ArcLayout.java
File: ArcLayout.java
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, long startOffset, long duration, Interpolator interpolator) { AnimationSet animationSet = new AnimationSet(false); animationSet.setFillAfter(true); final long preDuration = duration / 2; Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); rotateAnimation.setStartOffset(startOffset); rotateAnimation.setDuration(preDuration); rotateAnimation.setInterpolator(new LinearInterpolator()); rotateAnimation.setFillAfter(true); animationSet.addAnimation(rotateAnimation); Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720); translateAnimation.setStartOffset(startOffset + preDuration); translateAnimation.setDuration(duration - preDuration); translateAnimation.setInterpolator(interpolator); translateAnimation.setFillAfter(true); animationSet.addAnimation(translateAnimation); return animationSet; }
5. KJAnimations#clickCurtain()
Project: KJFrameForAndroid
File: KJAnimations.java
File: KJAnimations.java
public static void clickCurtain(View v) { AnimationSet set = new AnimationSet(false); Animation anim1 = getTranslateAnimation(0, 0, 0, -50, 110); Animation anim2 = getTranslateAnimation(0, 0, -50, 0, 80); Animation anim3 = getTranslateAnimation(0, 0, 0, -25, 25); Animation anim4 = getTranslateAnimation(0, 0, -25, 0, 25); anim1.setStartOffset(20); anim2.setStartOffset(230); anim3.setStartOffset(360); anim4.setStartOffset(400); set.addAnimation(anim1); set.addAnimation(anim2); set.addAnimation(anim3); set.addAnimation(anim4); v.startAnimation(set); }
6. KJAnimations#shakeCurtain()
Project: KJFrameForAndroid
File: KJAnimations.java
File: KJAnimations.java
public static void shakeCurtain(View v) { AnimationSet set = new AnimationSet(false); Animation anim1 = getTranslateAnimation(0, 0, 0, -200, 110); Animation anim2 = getTranslateAnimation(0, 0, -200, 0, 80); Animation anim3 = getTranslateAnimation(0, 0, 0, -50, 25); Animation anim4 = getTranslateAnimation(0, 0, -50, 0, 25); anim1.setStartOffset(20); anim2.setStartOffset(230); anim3.setStartOffset(360); anim4.setStartOffset(400); set.addAnimation(anim1); set.addAnimation(anim2); set.addAnimation(anim3); set.addAnimation(anim4); v.startAnimation(set); }
7. KJAnimations#clickCurtain()
Project: KJBlog
File: KJAnimations.java
File: KJAnimations.java
public static void clickCurtain(View v) { AnimationSet set = new AnimationSet(false); Animation anim1 = getTranslateAnimation(0, 0, 0, -50, 110); Animation anim2 = getTranslateAnimation(0, 0, -50, 0, 80); Animation anim3 = getTranslateAnimation(0, 0, 0, -25, 25); Animation anim4 = getTranslateAnimation(0, 0, -25, 0, 25); anim1.setStartOffset(20); anim2.setStartOffset(230); anim3.setStartOffset(360); anim4.setStartOffset(400); set.addAnimation(anim1); set.addAnimation(anim2); set.addAnimation(anim3); set.addAnimation(anim4); v.startAnimation(set); }
8. KJAnimations#shakeCurtain()
Project: KJBlog
File: KJAnimations.java
File: KJAnimations.java
public static void shakeCurtain(View v) { AnimationSet set = new AnimationSet(false); Animation anim1 = getTranslateAnimation(0, 0, 0, -200, 110); Animation anim2 = getTranslateAnimation(0, 0, -200, 0, 80); Animation anim3 = getTranslateAnimation(0, 0, 0, -50, 25); Animation anim4 = getTranslateAnimation(0, 0, -50, 0, 25); anim1.setStartOffset(20); anim2.setStartOffset(230); anim3.setStartOffset(360); anim4.setStartOffset(400); set.addAnimation(anim1); set.addAnimation(anim2); set.addAnimation(anim3); set.addAnimation(anim4); v.startAnimation(set); }
9. AwesomeTextView#startRotate()
Project: Android-Bootstrap
File: AwesomeTextView.java
File: AwesomeTextView.java
/** * Starts a rotating animation on the AwesomeTextView * * @param clockwise true for clockwise, false for anti clockwise spinning * @param speed how fast the item should rotate */ public void startRotate(boolean clockwise, AnimationSpeed speed) { Animation rotate; //set up the rotation animation if (clockwise) { rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); } else { rotate = new RotateAnimation(360, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); } //set up some extra variables rotate.setRepeatCount(Animation.INFINITE); rotate.setInterpolator(new LinearInterpolator()); rotate.setStartOffset(0); rotate.setRepeatMode(Animation.RESTART); rotate.setDuration(speed.getRotateDuration()); startAnimation(rotate); }
10. DragSortGridView#moveView()
Project: WayHoo
File: DragSortGridView.java
File: DragSortGridView.java
private void moveView(int fromPosition, int toPosition) { if (DEBUG_LOG) { L.d(TAG, "moveView from:" + fromPosition + ",to:" + toPosition); } final View from = getView(fromPosition); final View to = getView(toPosition); final Rect fromRect = new Rect(); getLayout(from, fromRect); final Rect toRect = new Rect(); getLayout(to, toRect); Animation translate = new TranslateAnimation(0, toRect.left - fromRect.left, 0, toRect.top - fromRect.top); translate.setDuration(150); translate.setFillEnabled(true); translate.setFillBefore(true); translate.setFillAfter(true); translate.setAnimationListener(new MoveViewAnimationListener(from, to.getLeft(), to.getTop())); from.startAnimation(translate); }
11. MainWearActivity#textViewAnimatedChange()
Project: gpslogger
File: MainWearActivity.java
File: MainWearActivity.java
private void textViewAnimatedChange(final TextView v, final String new_text) { final Animation anim_out = AnimationUtils.loadAnimation(this, android.R.anim.fade_out); anim_out.setDuration(500); final Animation anim_in = AnimationUtils.loadAnimation(this, android.R.anim.fade_in); anim_in.setDuration(20); anim_out.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { v.setText(new_text); anim_in.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { } }); v.startAnimation(anim_in); } }); v.startAnimation(anim_out); }
12. MainMenuMgr#intLayoutAnim()
Project: android_tv_metro
File: MainMenuMgr.java
File: MainMenuMgr.java
private void intLayoutAnim() { Animation slideIn = new TranslateAnimation(TranslateAnimation.RELATIVE_TO_SELF, -1, TranslateAnimation.ABSOLUTE, 0, TranslateAnimation.ABSOLUTE, 0, TranslateAnimation.ABSOLUTE, 0); slideIn.setDuration(KAnimTimeShort); mAnimIn = new LayoutAnimationController(slideIn, LayoutAnimDelay); Animation slideOut = new TranslateAnimation(TranslateAnimation.ABSOLUTE, 0, TranslateAnimation.RELATIVE_TO_SELF, -1, TranslateAnimation.ABSOLUTE, 0, TranslateAnimation.ABSOLUTE, 0); slideOut.setDuration(KAnimTimeShort); slideOut.setFillAfter(true); mAnimOut = new LayoutAnimationController(slideOut, LayoutAnimDelay); mAnimOut.setOrder(LayoutAnimationController.ORDER_REVERSE); mainMenu.setLayoutAnimation(mAnimIn); mHideShowListener = new HideShowListener(); mainMenu.setLayoutAnimationListener(mHideShowListener); mReady.autoSetVal(true, AnimationBlockTimer); }
13. AwesomeTextView#startFlashing()
Project: Android-Bootstrap
File: AwesomeTextView.java
File: AwesomeTextView.java
/** * Starts a Flashing Animation on the AwesomeTextView * * @param forever whether the animation should be infinite or play once * @param speed how fast the item should flash */ public void startFlashing(boolean forever, AnimationSpeed speed) { Animation fadeIn = new AlphaAnimation(0, 1); //set up extra variables fadeIn.setDuration(50); fadeIn.setRepeatMode(Animation.REVERSE); //default repeat count is 0, however if user wants, set it up to be infinite fadeIn.setRepeatCount(0); if (forever) { fadeIn.setRepeatCount(Animation.INFINITE); } fadeIn.setStartOffset(speed.getFlashDuration()); startAnimation(fadeIn); }
14. ImportMenuView#animation()
Project: AndroidStudyDemo
File: ImportMenuView.java
File: ImportMenuView.java
public void animation(Context context) { Animation firstBallAnim = AnimationUtils.loadAnimation(context, R.anim.sda_baiduread_collistionimportqrcodebutton); mFirstBallRL.startAnimation(firstBallAnim); Animation pcAnim = AnimationUtils.loadAnimation(context, R.anim.sda_baiduread_collistionimportpcbutton); mPCRL.startAnimation(pcAnim); Animation sdcardAnim = AnimationUtils.loadAnimation(context, R.anim.sda_baiduread_collistionimportsdcardbutton); mSDCardRL.startAnimation(sdcardAnim); Animation fadeInAnim = AnimationUtils.loadAnimation(context, R.anim.sda_baiduread_fade_in); mShadowView.startAnimation(fadeInAnim); }
15. LocalLyricsFragment#setListShown()
Project: QuickLyric
File: LocalLyricsFragment.java
File: LocalLyricsFragment.java
public void setListShown(final boolean visible) { final Animation fadeIn = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_in); final Animation fadeOut = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_out); Animation.AnimationListener listener = new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { progressBar.setVisibility(visible ? View.GONE : View.VISIBLE); megaListView.setVisibility(visible ? View.VISIBLE : View.INVISIBLE); } @Override public void onAnimationRepeat(Animation animation) { } }; fadeIn.setAnimationListener(listener); fadeOut.setAnimationListener(listener); progressBar.startAnimation(visible ? fadeOut : fadeIn); megaListView.startAnimation(visible ? fadeIn : fadeOut); }
16. ZoomPageAnimator#initAnimations()
Project: Paginize
File: ZoomPageAnimator.java
File: ZoomPageAnimator.java
private void initAnimations() { Animation inScaleAnimation = new ScaleAnimation(1.2f, 1, 1.2f, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); Animation inAlphaAnimation = new AlphaAnimation(0.0f, 1f); AnimationSet inAnimationSet = new AnimationSet(true); inAnimationSet.setDuration(ANIMATION_DURATION); inAnimationSet.addAnimation(inScaleAnimation); inAnimationSet.addAnimation(inAlphaAnimation); mInAnimation = inAnimationSet; Animation outScaleAnimation = new ScaleAnimation(1, 1.4f, 1, 1.4f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); Animation outAlphaAnimation = new AlphaAnimation(1f, 0f); AnimationSet outAnimationSet = new AnimationSet(true); outAnimationSet.setDuration(ANIMATION_DURATION); outAnimationSet.addAnimation(outScaleAnimation); outAnimationSet.addAnimation(outAlphaAnimation); mOutAnimation = outAnimationSet; }
17. CategoryFragment#animateRecyclerLayoutChange()
Project: openshop.io-android
File: CategoryFragment.java
File: CategoryFragment.java
/** * Animate change of rows in products recycler LayoutManager. * * @param layoutSpanCount number of rows to display. */ private void animateRecyclerLayoutChange(final int layoutSpanCount) { Animation fadeOut = new AlphaAnimation(1, 0); fadeOut.setInterpolator(new DecelerateInterpolator()); fadeOut.setDuration(400); fadeOut.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { productsRecyclerLayoutManager.setSpanCount(layoutSpanCount); productsRecyclerLayoutManager.requestLayout(); Animation fadeIn = new AlphaAnimation(0, 1); fadeIn.setInterpolator(new AccelerateInterpolator()); fadeIn.setDuration(400); productsRecycler.startAnimation(fadeIn); } }); productsRecycler.startAnimation(fadeOut); }
18. DrawerFragment#animateSubListHide()
Project: openshop.io-android
File: DrawerFragment.java
File: DrawerFragment.java
private void animateSubListHide() { Animation slideAwayDisappear = AnimationUtils.loadAnimation(getActivity(), R.anim.slide_away_disappear); final Animation slideAwayAppear = AnimationUtils.loadAnimation(getActivity(), R.anim.slide_away_appear); slideAwayDisappear.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { drawerRecycler.setVisibility(View.VISIBLE); drawerRecycler.startAnimation(slideAwayAppear); } @Override public void onAnimationEnd(Animation animation) { drawerSubmenuLayout.setVisibility(View.GONE); } @Override public void onAnimationRepeat(Animation animation) { } }); drawerSubmenuLayout.startAnimation(slideAwayDisappear); }
19. MorphyToolbarUtils#animateInnerLayout()
Project: morphy-toolbar
File: MorphyToolbarUtils.java
File: MorphyToolbarUtils.java
/** * Animate the inner layout to the given margins * * @param endMargins array of margins at animation end * @return Animation to run */ public Animation animateInnerLayout(int[] endMargins) { final View innerLayout = morphyToolbar.getInnerLayout(); final FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) innerLayout.getLayoutParams(); final int[] startMargins = { layoutParams.leftMargin, layoutParams.topMargin, layoutParams.rightMargin, layoutParams.bottomMargin }; final int[] deltaMargins = { endMargins[0] - startMargins[0], endMargins[1] - startMargins[1], endMargins[2] - startMargins[2], endMargins[3] - startMargins[3] }; Animation a = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { layoutParams.setMargins(startMargins[0] + (int) (deltaMargins[0] * interpolatedTime), startMargins[1] + (int) (deltaMargins[1] * interpolatedTime), startMargins[2] + (int) (deltaMargins[2] * interpolatedTime), startMargins[3] + (int) (deltaMargins[3] * interpolatedTime)); innerLayout.requestLayout(); } @Override public boolean willChangeBounds() { return true; } }; a.setInterpolator(new DecelerateInterpolator()); a.setDuration(builder.animationDuration); return a; }
20. BottombarViewFlipper#close()
Project: mobile-android
File: BottombarViewFlipper.java
File: BottombarViewFlipper.java
/** * Close the option panel and return to the tools list view. */ public void close() { int height = getContent().getHeight(); Animation animationOut = createVoidAnimation(mAnimationDuration, mAnimationCloseStartOffset); animationOut.setAnimationListener(mCloseAnimationListener); height = getToolPanel().getHeight(); Animation animationIn = createInAnimation(TranslateAnimation.ABSOLUTE, height, mAnimationDuration, mAnimationCloseStartOffset); setInAnimation(animationIn); setOutAnimation(animationOut); setDisplayedChild(mToolPanelIndex); }
21. FeatherActivity#hideProgressLoader()
Project: mobile-android
File: FeatherActivity.java
File: FeatherActivity.java
/** * Hide progress loader. */ private void hideProgressLoader() { Animation fadeout = new AlphaAnimation(1, 0); fadeout.setDuration(getResources().getInteger(R.integer.feather_config_mediumAnimTime)); fadeout.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { mInlineProgressLoader.setVisibility(View.GONE); } }); mInlineProgressLoader.startAnimation(fadeout); }
22. UtilsAnimation#zoomInAndOutAnimation()
Project: MaterialStyledDialogs
File: UtilsAnimation.java
File: UtilsAnimation.java
static void zoomInAndOutAnimation(Context context, final ImageView image) { Animation zoomInAnimation = AnimationUtils.loadAnimation(context, R.anim.md_styled_zoom_in); final Animation zoomOutAnimation = AnimationUtils.loadAnimation(context, R.anim.md_styled_zoom_out); zoomInAnimation.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { image.startAnimation(zoomOutAnimation); } @Override public void onAnimationRepeat(Animation animation) { } }); image.startAnimation(zoomInAnimation); }
23. RecurringPickerDialog#animIn()
Project: material
File: RecurringPickerDialog.java
File: RecurringPickerDialog.java
private void animIn(final View v, boolean immediately) { if (v.getVisibility() == View.VISIBLE) return; if (!isShowing() || immediately) { v.setVisibility(View.VISIBLE); return; } Animation anim = new AlphaAnimation(0f, 1f); anim.setDuration(getContext().getResources().getInteger(android.R.integer.config_mediumAnimTime)); anim.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { v.setVisibility(View.VISIBLE); } @Override public void onAnimationEnd(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } }); v.startAnimation(anim); }
24. RecurringPickerDialog#animOut()
Project: material
File: RecurringPickerDialog.java
File: RecurringPickerDialog.java
private void animOut(final View v, final boolean setGone, final boolean immediately) { if (!isShowing() || v.getVisibility() != View.VISIBLE || immediately) { v.setVisibility(setGone ? View.GONE : View.INVISIBLE); return; } Animation anim = new AlphaAnimation(1f, 0f); anim.setDuration(getContext().getResources().getInteger(android.R.integer.config_mediumAnimTime)); anim.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { v.setVisibility(setGone ? View.GONE : View.INVISIBLE); } @Override public void onAnimationRepeat(Animation animation) { } }); v.startAnimation(anim); }
25. Main#cancleExit()
Project: KJFrameForAndroid
File: Main.java
File: Main.java
/********************** ?????? *****************************/ /** * ???? */ private void cancleExit() { Animation anim = KJAnimations.getTranslateAnimation(0, 0, titleBarHeight, 0, 300); mTvTitle.startAnimation(anim); Animation anim2 = KJAnimations.getTranslateAnimation(0, 0, titleBarHeight, 300, 0); anim2.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { mTvDoubleClickTip.setVisibility(View.GONE); } }); mTvDoubleClickTip.startAnimation(anim2); }
26. Main#cancleExit()
Project: KJBlog
File: Main.java
File: Main.java
/********************** ?????? *****************************/ /** * ???? */ private void cancleExit() { Animation anim = KJAnimations.getTranslateAnimation(0, 0, titleBarHeight, 0, 300); mTvTitle.startAnimation(anim); Animation anim2 = KJAnimations.getTranslateAnimation(0, 0, titleBarHeight, 300, 0); anim2.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { mTvDoubleClickTip.setVisibility(View.GONE); } }); mTvDoubleClickTip.startAnimation(anim2); }
27. MainWearActivity#imageViewAnimatedChange()
Project: gpslogger
File: MainWearActivity.java
File: MainWearActivity.java
private void imageViewAnimatedChange(String buttonState) { final ImageView v = (ImageView) findViewById(R.id.btnStartStop); final int new_image = (buttonState.equals("STOPPED")) ? android.R.drawable.ic_media_play : android.R.drawable.ic_menu_close_clear_cancel; final Animation anim_out = AnimationUtils.loadAnimation(this, android.R.anim.fade_out); final Animation anim_in = AnimationUtils.loadAnimation(this, android.R.anim.fade_in); anim_out.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { v.setImageResource(new_image); anim_in.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { } }); v.startAnimation(anim_in); } }); v.startAnimation(anim_out); }
28. CustomListView#hideActionBar()
Project: GmailLikePullToRefresh
File: CustomListView.java
File: CustomListView.java
private void hideActionBar() { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View overlay = inflater.inflate(R.layout.overlay_actionbar, null); android.app.ActionBar.LayoutParams layout = new android.app.ActionBar.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); TextView swipeToRefreshText = (TextView) overlay.findViewById(R.id.swipeToRefreshText_gmaillikepulltorefresh); Animation translate = AnimationUtils.loadAnimation(context.getApplicationContext(), R.anim.slide_in_from_top); translate.setDuration(100); translate.setFillAfter(true); swipeToRefreshText.setAnimation(translate); component.actionBarView.setCustomView(overlay, layout); component.actionBarView.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); }
29. CustomListView#hideActionBar()
Project: GmailLikePullToRefresh
File: CustomListView.java
File: CustomListView.java
private void hideActionBar() { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View overlay = inflater.inflate(R.layout.overlay_actionbar, null); android.app.ActionBar.LayoutParams layout = new android.app.ActionBar.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); TextView swipeToRefreshText = (TextView) overlay.findViewById(R.id.swipeToRefreshText_gmaillikepulltorefresh); Animation translate = AnimationUtils.loadAnimation(context.getApplicationContext(), R.anim.slide_in_from_top); translate.setDuration(100); translate.setFillAfter(true); swipeToRefreshText.setAnimation(translate); component.actionBarView.setCustomView(overlay, layout); component.actionBarView.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); }
30. CustomListView#hideActionBar()
Project: GmailLikePullToRefresh
File: CustomListView.java
File: CustomListView.java
private void hideActionBar() { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View overlay = inflater.inflate(R.layout.overlay_actionbar, null); android.app.ActionBar.LayoutParams layout = new android.app.ActionBar.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); TextView swipeToRefreshText = (TextView) overlay.findViewById(R.id.swipeToRefreshText_gmaillikepulltorefresh); Animation translate = AnimationUtils.loadAnimation(context.getApplicationContext(), R.anim.slide_in_from_top); translate.setDuration(100); translate.setFillAfter(true); swipeToRefreshText.setAnimation(translate); component.actionBarView.setCustomView(overlay, layout); component.actionBarView.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); }
31. LayoutAnimation2#onCreate()
Project: codeexamples-android
File: LayoutAnimation2.java
File: LayoutAnimation2.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mStrings)); AnimationSet set = new AnimationSet(true); Animation animation = new AlphaAnimation(0.0f, 1.0f); animation.setDuration(50); set.addAnimation(animation); animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f); animation.setDuration(100); set.addAnimation(animation); LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f); ListView listView = getListView(); listView.setLayoutAnimation(controller); }
32. ChandelierLayout#hideActions()
Project: Chandelier
File: ChandelierLayout.java
File: ChandelierLayout.java
/** * Hide the actions of the {@link ChandelierLayout} */ public void hideActions() { isShowingAction = false; final float top = ViewCompat.getTranslationY(ornamentLayout); final Animation hideAnimation = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { moveActionLayout((1 - interpolatedTime) * top); } }; hideAnimation.reset(); hideAnimation.setDuration(200); startAnimation(hideAnimation); }
33. AnimationUtil#fadeIn()
Project: bither-android
File: AnimationUtil.java
File: AnimationUtil.java
public static void fadeIn(final View view) { Animation alphaAnimation = new AlphaAnimation(1.0f, 0.0f); alphaAnimation.setDuration(FADE_DURATION); alphaAnimation.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { view.setVisibility(View.INVISIBLE); } }); view.startAnimation(alphaAnimation); }
34. AnimationUtil#fadeOut()
Project: bither-android
File: AnimationUtil.java
File: AnimationUtil.java
public static void fadeOut(final View view) { view.setVisibility(View.VISIBLE); Animation alphaAnimation = new AlphaAnimation(0.0f, 1.0f); alphaAnimation.setDuration(FADE_DURATION); alphaAnimation.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { } }); view.startAnimation(alphaAnimation); }
35. RCheckHeaderView#stop()
Project: bither-android
File: RCheckHeaderView.java
File: RCheckHeaderView.java
public void stop() { if (passedCheckCount < totalCheckCount) { tvStatus.setText(R.string.rcheck_danger); } else { tvStatus.setText(R.string.rcheck_safe); } Animation anim = AnimationUtils.loadAnimation(getContext(), R.anim.check_points_scale_down); anim.setDuration(ScaleDownAnimDuration); anim.setAnimationListener(scaleDownListener); llPoints.startAnimation(anim); ivLight.clearAnimation(); ivLight.setVisibility(View.GONE); }
36. CheckHeaderView#stop()
Project: bither-android
File: CheckHeaderView.java
File: CheckHeaderView.java
public void stop() { if (passedCheckCount < totalCheckCount) { tvStatus.setText(R.string.check_private_key_danger); } else { tvStatus.setText(R.string.check_private_key_safe); } Animation anim = AnimationUtils.loadAnimation(getContext(), R.anim.check_points_scale_down); anim.setDuration(ScaleDownAnimDuration); anim.setAnimationListener(scaleDownListener); llPoints.startAnimation(anim); ivLight.clearAnimation(); ivLight.setVisibility(View.GONE); }
37. MenuAnimationUtils#loadAnimation2()
Project: Android-tv-widget
File: MenuAnimationUtils.java
File: MenuAnimationUtils.java
/** * ????2. */ public static LayoutAnimationController loadAnimation2() { int duration = 300; AnimationSet set = new AnimationSet(true); Animation animation = new AlphaAnimation(0.0f, 1.0f); animation.setDuration(duration); set.addAnimation(animation); animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f); animation.setDuration(duration); set.addAnimation(animation); LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f); controller.setOrder(LayoutAnimationController.ORDER_NORMAL); return controller; }
38. LayoutAnimation2#onCreate()
Project: android-maven-plugin
File: LayoutAnimation2.java
File: LayoutAnimation2.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mStrings)); AnimationSet set = new AnimationSet(true); Animation animation = new AlphaAnimation(0.0f, 1.0f); animation.setDuration(50); set.addAnimation(animation); animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f); animation.setDuration(100); set.addAnimation(animation); LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f); ListView listView = getListView(); listView.setLayoutAnimation(controller); }
39. ViewUtils#expand()
Project: actor-platform
File: ViewUtils.java
File: ViewUtils.java
public static void expand(final View v, int targetHeight) { v.measure(AbsListView.LayoutParams.MATCH_PARENT, AbsListView.LayoutParams.WRAP_CONTENT); final int initialHeight = new Integer(v.getLayoutParams().height); v.getLayoutParams().height = initialHeight; Animation a = new ExpandAnimation(v, targetHeight, initialHeight); a.setDuration(/*(targetHeight > 0 ? targetHeight : initialHeight / Screen.dp(1))*/ 150); a.setInterpolator(MaterialInterpolator.getInstance()); v.startAnimation(a); if (targetHeight == 0) { v.setVisibility(View.INVISIBLE); } else { v.setVisibility(View.VISIBLE); } }
40. ViewUtils#expandMentions()
Project: actor-platform
File: ViewUtils.java
File: ViewUtils.java
public static void expandMentions(final View v, final int oldRowsCount, final int newRowsCount) { if (newRowsCount == oldRowsCount) { return; } v.measure(AbsListView.LayoutParams.MATCH_PARENT, AbsListView.LayoutParams.WRAP_CONTENT); int newRowsHeight = Screen.dp(48) * newRowsCount + newRowsCount; final int targetHeight = (newRowsHeight) > Screen.dp(96 + 2) ? Screen.dp(122) : newRowsHeight; final int initialHeight = new Integer(v.getLayoutParams().height); v.getLayoutParams().height = initialHeight; v.setVisibility(View.VISIBLE); Animation a = new ExpandAnimation(v, targetHeight, initialHeight); a.setDuration((newRowsCount > oldRowsCount ? targetHeight : initialHeight / Screen.dp(1))); a.setInterpolator(MaterialInterpolator.getInstance()); v.startAnimation(a); }
41. MySceneAnim#playScreenExitAnims()
Project: ActivityOptionsICS
File: MySceneAnim.java
File: MySceneAnim.java
@Override public void playScreenExitAnims() { // TODO ????????? View sceneRoot = getSceneRoot(); Animation animation = AnimationUtils.loadAnimation(getActivity(), R.anim.slide_bottom_out); animation.setDuration(1000); animation.setAnimationListener(new TransitionAnimsListener() { @Override public void onAnimationEnd(Animation animation) { // TODO ????????? super.onAnimationEnd(animation); // you must use this method exitAnimsEnd(); } }); sceneRoot.startAnimation(animation); }
42. PostPagerFragment#expand()
Project: XDA-One
File: PostPagerFragment.java
File: PostPagerFragment.java
public void expand(final View view) { view.getLayoutParams().height = 0; view.setVisibility(View.VISIBLE); final Animation animation = new Animation() { @Override protected void applyTransformation(final float interpolatedTime, final Transformation transformation) { view.getLayoutParams().height = interpolatedTime == 1 ? ViewGroup.LayoutParams.WRAP_CONTENT : (int) (mTargetHeight * interpolatedTime); view.setLayoutParams(view.getLayoutParams()); } @Override public boolean willChangeBounds() { return true; } }; animation.setDuration(200); view.startAnimation(animation); }
43. PostPagerFragment#collapse()
Project: XDA-One
File: PostPagerFragment.java
File: PostPagerFragment.java
public void collapse(final View view) { final Animation animation = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { if (interpolatedTime == 1) { view.getLayoutParams().height = 0; view.setLayoutParams(view.getLayoutParams()); view.setVisibility(View.GONE); } else { view.getLayoutParams().height = mTargetHeight - (int) (mTargetHeight * interpolatedTime); view.setLayoutParams(view.getLayoutParams()); } } @Override public boolean willChangeBounds() { return true; } }; animation.setDuration(100); view.startAnimation(animation); }
44. BaseMessageActivity#hidePlusBar()
Project: WifiChat
File: BaseMessageActivity.java
File: BaseMessageActivity.java
protected void hidePlusBar() { mLayoutFullScreenMask.setEnabled(false); mLayoutMessagePlusBar.setEnabled(false); mLayoutMessagePlusPicture.setEnabled(false); mLayoutMessagePlusCamera.setEnabled(false); mLayoutMessagePlusFile.setEnabled(false); mLayoutFullScreenMask.setVisibility(View.GONE); Animation animation = AnimationUtils.loadAnimation(BaseMessageActivity.this, R.anim.controller_exit); animation.setInterpolator(AnimationUtils.loadInterpolator(BaseMessageActivity.this, android.R.anim.anticipate_interpolator)); mLayoutMessagePlusBar.setAnimation(animation); mLayoutMessagePlusBar.setVisibility(View.GONE); }
45. WaveSwipeRefreshLayout#startScaleDownAnimation()
Project: WaveSwipeRefreshLayout
File: WaveSwipeRefreshLayout.java
File: WaveSwipeRefreshLayout.java
/** * @param listener {@link android.view.animation.Animation.AnimationListener} */ private void startScaleDownAnimation(Animation.AnimationListener listener) { Animation scaleDownAnimation = new Animation() { @Override public void applyTransformation(float interpolatedTime, Transformation t) { mCircleView.scaleWithKeepingAspectRatio(1 - interpolatedTime); } }; scaleDownAnimation.setDuration(SCALE_DOWN_DURATION); mCircleView.setAnimationListener(listener); mCircleView.clearAnimation(); mCircleView.startAnimation(scaleDownAnimation); }
46. ActionBarSherlockCompat#hideProgressBars()
Project: Ushahidi_Android
File: ActionBarSherlockCompat.java
File: ActionBarSherlockCompat.java
private void hideProgressBars(IcsProgressBar horizontalProgressBar, IcsProgressBar spinnyProgressBar) { //getLocalFeatures(); final int features = mFeatures; Animation anim = AnimationUtils.loadAnimation(mActivity, android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
47. BasicUiUtils#collapseViews()
Project: UltimateAndroid
File: BasicUiUtils.java
File: BasicUiUtils.java
public static void collapseViews(final View v) { final int initialHeight = v.getMeasuredHeight(); Animation a = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { if (interpolatedTime == 1) { v.setVisibility(View.GONE); } else { v.getLayoutParams().height = initialHeight - (int) (initialHeight * interpolatedTime); v.requestLayout(); } } @Override public boolean willChangeBounds() { return true; } }; // 1dp/ms a.setDuration((int) (initialHeight / v.getContext().getResources().getDisplayMetrics().density) * 1); v.startAnimation(a); }
48. BasicUiUtils#collapseViews()
Project: UltimateAndroid
File: BasicUiUtils.java
File: BasicUiUtils.java
/** * Collapse a view which has already expanded * * @param v */ public static void collapseViews(final View v) { final int initialHeight = v.getMeasuredHeight(); Animation a = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { if (interpolatedTime == 1) { v.setVisibility(View.GONE); } else { v.getLayoutParams().height = initialHeight - (int) (initialHeight * interpolatedTime); v.requestLayout(); } } @Override public boolean willChangeBounds() { return true; } }; // 1dp/ms a.setDuration((int) (initialHeight / v.getContext().getResources().getDisplayMetrics().density) * 1); v.startAnimation(a); }
49. BasicUiUtils#expandViews()
Project: UltimateAndroid
File: BasicUiUtils.java
File: BasicUiUtils.java
/** * Expand a view which has already collapsed * * @param v */ public static void expandViews(final View v) { v.measure(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT); final int targtetHeight = v.getMeasuredHeight(); v.getLayoutParams().height = 0; v.setVisibility(View.VISIBLE); Animation a = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { v.getLayoutParams().height = interpolatedTime == 1 ? RelativeLayout.LayoutParams.WRAP_CONTENT : (int) (targtetHeight * interpolatedTime); v.requestLayout(); } @Override public boolean willChangeBounds() { return true; } }; // 1dp/ms a.setDuration((int) (targtetHeight / v.getContext().getResources().getDisplayMetrics().density)); v.startAnimation(a); }
50. ActionBarSherlockCompat#hideProgressBars()
Project: todo.txt-android
File: ActionBarSherlockCompat.java
File: ActionBarSherlockCompat.java
private void hideProgressBars(IcsProgressBar horizontalProgressBar, IcsProgressBar spinnyProgressBar) { //getLocalFeatures(); final int features = mFeatures; Animation anim = AnimationUtils.loadAnimation(mActivity, android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
51. AnimatedText#setFactory()
Project: text_switcher_demo
File: AnimatedText.java
File: AnimatedText.java
private void setFactory(TextSwitcher ts, final int unit, final Typeface tf) { // Declare the in and out animations and initialize them Animation in = AnimationUtils.loadAnimation(getContext(), R.anim.anim_in); Animation out = AnimationUtils.loadAnimation(getContext(), R.anim.anim_out); // set the animation type of textSwitcher ts.setInAnimation(in); ts.setOutAnimation(out); // Set the ViewFactory of the TextSwitcher that will create TextView object when asked ts.setFactory(new ViewSwitcher.ViewFactory() { public View makeView() { // create new textView and set the properties like clolr, size etc TextView myText = new TextView(getContext()); myText.setTextSize(TypedValue.COMPLEX_UNIT_SP, unit); myText.setTypeface(tf); myText.setLayoutParams(layoutParams); return myText; } }); }
52. SwipyRefreshLayout#startAlphaAnimation()
Project: SwipyRefreshLayout
File: SwipyRefreshLayout.java
File: SwipyRefreshLayout.java
private Animation startAlphaAnimation(final int startingAlpha, final int endingAlpha) { // show the trigger point. if (mScale && isAlphaUsedForScale()) { return null; } Animation alpha = new Animation() { @Override public void applyTransformation(float interpolatedTime, Transformation t) { mProgress.setAlpha((int) (startingAlpha + ((endingAlpha - startingAlpha) * interpolatedTime))); } }; alpha.setDuration(ALPHA_ANIMATION_DURATION); // Clear out the previous animation listeners. mCircleView.setAnimationListener(null); mCircleView.clearAnimation(); mCircleView.startAnimation(alpha); return alpha; }
53. ExpandAnimation#collapse()
Project: RxAndroidBootstrap
File: ExpandAnimation.java
File: ExpandAnimation.java
public static void collapse(final View v) { final int initialHeight = v.getMeasuredHeight(); Animation a = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { if (interpolatedTime == 1) { v.setVisibility(View.GONE); } else { v.getLayoutParams().height = initialHeight - (int) (initialHeight * interpolatedTime); v.requestLayout(); } } @Override public boolean willChangeBounds() { return true; } }; // 1dp/ms a.setDuration(500); v.startAnimation(a); }
54. DownExpandAnimation#collapse()
Project: RxAndroidBootstrap
File: DownExpandAnimation.java
File: DownExpandAnimation.java
public static void collapse(final View v) { final int initialHeight = v.getMeasuredHeight(); Animation a = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { if (interpolatedTime == 1) { v.setVisibility(View.GONE); } else { v.getLayoutParams().height = initialHeight - (int) (initialHeight * interpolatedTime); v.requestLayout(); } } @Override public boolean willChangeBounds() { return true; } }; // 1dp/ms a.setDuration(500); v.startAnimation(a); }
55. ViewTest#shouldStartAndClearAnimation()
Project: robolectric
File: ViewTest.java
File: ViewTest.java
@Test public void shouldStartAndClearAnimation() throws Exception { Animation anim = new TestAnimation(); TestAnimationListener listener = new TestAnimationListener(); anim.setAnimationListener(listener); assertThat(listener.wasStartCalled, equalTo(false)); assertThat(listener.wasRepeatCalled, equalTo(false)); assertThat(listener.wasEndCalled, equalTo(false)); view.startAnimation(anim); assertThat(listener.wasStartCalled, equalTo(true)); assertThat(listener.wasRepeatCalled, equalTo(false)); assertThat(listener.wasEndCalled, equalTo(false)); view.clearAnimation(); assertThat(listener.wasStartCalled, equalTo(true)); assertThat(listener.wasRepeatCalled, equalTo(false)); assertThat(listener.wasEndCalled, equalTo(true)); }
56. PickerUI#showPanelPickerUI()
Project: PickerUI
File: PickerUI.java
File: PickerUI.java
/** * Method to slide up the panel. Panel displays with an animation, and when it starts, the item * of the center is * selected. */ private void showPanelPickerUI() { mHiddenPanelPickerUI.setVisibility(View.VISIBLE); setBackgroundPanel(); setBackgroundLines(); Animation bottomUp = AnimationUtils.loadAnimation(mContext, R.anim.picker_panel_bottom_up); mHiddenPanelPickerUI.startAnimation(bottomUp); bottomUp.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { if (mPickerUIListView != null && mPickerUIListView.getPickerUIAdapter() != null) { mPickerUIListView.getPickerUIAdapter().handleSelectEvent(position + 2); mPickerUIListView.setSelection(position); } } @Override public void onAnimationEnd(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } }); }
57. ToolableViewAnimator#setDisplayedChild()
Project: open-keychain
File: ToolableViewAnimator.java
File: ToolableViewAnimator.java
public void setDisplayedChild(int whichChild, boolean animate) { if (animate) { setDisplayedChild(whichChild); return; } Animation savedInAnim = getInAnimation(); Animation savedOutAnim = getOutAnimation(); setInAnimation(null); setOutAnimation(null); setDisplayedChild(whichChild); setInAnimation(savedInAnim); setOutAnimation(savedOutAnim); }
58. ActionBarSherlockCompat#hideProgressBars()
Project: networklog
File: ActionBarSherlockCompat.java
File: ActionBarSherlockCompat.java
private void hideProgressBars(IcsProgressBar horizontalProgressBar, IcsProgressBar spinnyProgressBar) { //getLocalFeatures(); final int features = mFeatures; Animation anim = AnimationUtils.loadAnimation(mActivity, android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
59. ExpandAnimation#collapse()
Project: MVPAndroidBootstrap
File: ExpandAnimation.java
File: ExpandAnimation.java
public static void collapse(final View v) { final int initialHeight = v.getMeasuredHeight(); Animation a = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { if (interpolatedTime == 1) { v.setVisibility(View.GONE); } else { v.getLayoutParams().height = initialHeight - (int) (initialHeight * interpolatedTime); v.requestLayout(); } } @Override public boolean willChangeBounds() { return true; } }; // 1dp/ms a.setDuration(500); v.startAnimation(a); }
60. DownExpandAnimation#collapse()
Project: MVPAndroidBootstrap
File: DownExpandAnimation.java
File: DownExpandAnimation.java
public static void collapse(final View v) { final int initialHeight = v.getMeasuredHeight(); Animation a = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { if (interpolatedTime == 1) { v.setVisibility(View.GONE); } else { v.getLayoutParams().height = initialHeight - (int) (initialHeight * interpolatedTime); v.requestLayout(); } } @Override public boolean willChangeBounds() { return true; } }; // 1dp/ms a.setDuration(500); v.startAnimation(a); }
61. InOutAnimationUtils#animateOut()
Project: mr-mantou-android
File: InOutAnimationUtils.java
File: InOutAnimationUtils.java
public static void animateOut(View v, @AnimRes int anim) { if (v.getVisibility() != View.VISIBLE) { return; } v.clearAnimation(); Animation animation = AnimationUtils.loadAnimation(v.getContext(), anim); animation.setAnimationListener(new AnimationListenerAdapter() { @Override public void onAnimationEnd(Animation animation) { v.setVisibility(View.INVISIBLE); } }); v.startAnimation(animation); }
62. InOutAnimationUtils#animateIn()
Project: mr-mantou-android
File: InOutAnimationUtils.java
File: InOutAnimationUtils.java
public static void animateIn(View v, @AnimRes int anim) { if (v.getVisibility() == View.VISIBLE) { return; } v.clearAnimation(); Animation animation = AnimationUtils.loadAnimation(v.getContext(), anim); animation.setAnimationListener(new AnimationListenerAdapter() { @Override public void onAnimationStart(Animation animation) { v.setVisibility(View.VISIBLE); } }); v.startAnimation(animation); }
63. IapDialog#handleHide()
Project: mobile-android
File: IapDialog.java
File: IapDialog.java
private void handleHide() { Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.feather_iap_close_animation); AnimationListener listener = new AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { ViewGroup parent = (ViewGroup) getParent(); if (null != parent) { parent.removeView(IapDialog.this); } } }; animation.setAnimationListener(listener); startAnimation(animation); }
64. SnackBar#dismiss()
Project: meiShi
File: SnackBar.java
File: SnackBar.java
/** * @author Jack Tony */ @Override public void dismiss() { Animation anim = AnimationUtils.loadAnimation(activity, R.anim.snackbar_hide_animation); anim.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { SnackBar.super.dismiss(); } }); view.startAnimation(anim); }
65. SnackBar#dismiss()
Project: MaterialDesignLibrary
File: SnackBar.java
File: SnackBar.java
/** * @author Jack Tony */ @Override public void dismiss() { Animation anim = AnimationUtils.loadAnimation(activity, R.anim.snackbar_hide_animation); anim.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { SnackBar.super.dismiss(); } }); view.startAnimation(anim); }
66. SingleInputFormActivity#getAnimation()
Project: material-singleinputform
File: SingleInputFormActivity.java
File: SingleInputFormActivity.java
private Animation getAnimation(int animationResId, boolean isInAnimation) { final Interpolator interpolator; if (isInAnimation) { interpolator = new DecelerateInterpolator(1.0f); } else { interpolator = new AccelerateInterpolator(1.0f); } Animation animation = AnimationUtils.loadAnimation(this, animationResId); animation.setInterpolator(interpolator); return animation; }
67. ActionBarSherlockCompat#hideProgressBars()
Project: Libraries-for-Android-Developers
File: ActionBarSherlockCompat.java
File: ActionBarSherlockCompat.java
private void hideProgressBars(IcsProgressBar horizontalProgressBar, IcsProgressBar spinnyProgressBar) { //getLocalFeatures(); final int features = mFeatures; Animation anim = AnimationUtils.loadAnimation(mActivity, android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
68. AppStart#onCreate()
Project: KJMusic
File: AppStart.java
File: AppStart.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Animation animation = AnimationUtils.loadAnimation(this, R.anim.alpha); // ?????? animation.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { redirectTo(); } }); mImageView.setAnimation(animation); }
69. AppStart#setRootView()
Project: KJFrameForAndroid
File: AppStart.java
File: AppStart.java
@Override public void setRootView() { ImageView image = new ImageView(aty); image.setImageResource(R.drawable.splash_bg); Animation anim = AnimationUtils.loadAnimation(aty, R.anim.splash_start); anim.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { jumpTo(); } @Override public void onAnimationRepeat(Animation animation) { } }); image.setAnimation(anim); setContentView(image); AppContext.screenH = DensityUtils.getScreenH(aty); AppContext.screenW = DensityUtils.getScreenW(aty); }
70. AppStart#setRootView()
Project: KJBlog
File: AppStart.java
File: AppStart.java
@Override public void setRootView() { ImageView image = new ImageView(aty); image.setImageResource(R.drawable.splash_bg); Animation anim = AnimationUtils.loadAnimation(aty, R.anim.splash_start); anim.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { jumpTo(); } @Override public void onAnimationRepeat(Animation animation) { } }); image.setAnimation(anim); setContentView(image); AppContext.screenH = DensityUtils.getScreenH(aty); AppContext.screenW = DensityUtils.getScreenW(aty); }
71. ToolableViewAnimator#setDisplayedChild()
Project: k-9
File: ToolableViewAnimator.java
File: ToolableViewAnimator.java
public void setDisplayedChild(int whichChild, boolean animate) { if (animate) { setDisplayedChild(whichChild); return; } Animation savedInAnim = getInAnimation(); Animation savedOutAnim = getOutAnimation(); setInAnimation(null); setOutAnimation(null); setDisplayedChild(whichChild); setInAnimation(savedInAnim); setOutAnimation(savedOutAnim); }
72. TasksFragment#refresh()
Project: habitrpg-android
File: TasksFragment.java
File: TasksFragment.java
public void refresh() { /* Attach a rotating ImageView to the refresh item as an ActionView */ LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); ImageView iv = (ImageView) inflater.inflate(R.layout.refresh_actionview, null); Animation rotation = AnimationUtils.loadAnimation(getActivity(), R.anim.clockwise_rotate); rotation.setRepeatCount(Animation.INFINITE); iv.startAnimation(rotation); refreshItem.setActionView(iv); if (apiHelper != null) { apiHelper.retrieveUser(true).compose(apiHelper.configureApiCallObserver()).subscribe(new HabitRPGUserCallback(activity), throwable -> stopAnimatingRefreshItem()); } }
73. AnimationFactory#fadeOutAnimation()
Project: flip
File: AnimationFactory.java
File: AnimationFactory.java
/** * A fade animation that will ensure the View starts and ends with the correct visibility * @param view the View to be faded out * @param duration the animation duration in milliseconds * @return a fade animation that will set the visibility of the view at the start and end of animation */ public static Animation fadeOutAnimation(long duration, final View view) { Animation animation = fadeOutAnimation(500, 0); animation.setAnimationListener(new AnimationListener() { @Override public void onAnimationEnd(Animation animation) { view.setVisibility(View.GONE); } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationStart(Animation animation) { view.setVisibility(View.VISIBLE); } }); return animation; }
74. AnimationFactory#fadeInAnimation()
Project: flip
File: AnimationFactory.java
File: AnimationFactory.java
/** * A fade animation that will ensure the View starts and ends with the correct visibility * @param view the View to be faded in * @param duration the animation duration in milliseconds * @return a fade animation that will set the visibility of the view at the start and end of animation */ public static Animation fadeInAnimation(long duration, final View view) { Animation animation = fadeInAnimation(500, 0); animation.setAnimationListener(new AnimationListener() { @Override public void onAnimationEnd(Animation animation) { view.setVisibility(View.VISIBLE); } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationStart(Animation animation) { view.setVisibility(View.GONE); } }); return animation; }
75. FlexibleCalendarView#collapse()
Project: FlexibleCalendar
File: FlexibleCalendarView.java
File: FlexibleCalendarView.java
/** * Collapse the view with animation */ public void collapse() { final int initialHeight = this.getMeasuredHeight(); Animation a = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { if (interpolatedTime == 1) { setVisibility(View.GONE); } else { getLayoutParams().height = initialHeight - (int) (initialHeight * interpolatedTime); requestLayout(); } } @Override public boolean willChangeBounds() { return true; } }; a.setDuration(((int) (initialHeight / getContext().getResources().getDisplayMetrics().density))); startAnimation(a); }
76. FlexibleCalendarView#expand()
Project: FlexibleCalendar
File: FlexibleCalendarView.java
File: FlexibleCalendarView.java
/** * Expand the view with animation */ public void expand() { measure(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); final int targetHeight = getMeasuredHeight(); getLayoutParams().height = 0; setVisibility(View.VISIBLE); Animation a = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { getLayoutParams().height = interpolatedTime == 1 ? LayoutParams.WRAP_CONTENT : (int) (targetHeight * interpolatedTime); requestLayout(); } @Override public boolean willChangeBounds() { return true; } }; a.setDuration(((int) (targetHeight / getContext().getResources().getDisplayMetrics().density))); startAnimation(a); }
77. InOutAnimationUtils#animateOut()
Project: earth
File: InOutAnimationUtils.java
File: InOutAnimationUtils.java
public static void animateOut(View v, @AnimRes int anim) { Animation animation = AnimationUtils.loadAnimation(v.getContext(), anim); animation.setAnimationListener(new AnimationListenerAdapter() { @Override public void onAnimationEnd(Animation animation) { v.setVisibility(View.INVISIBLE); } }); v.startAnimation(animation); }
78. InOutAnimationUtils#animateIn()
Project: earth
File: InOutAnimationUtils.java
File: InOutAnimationUtils.java
public static void animateIn(View v, @AnimRes int anim) { Animation animation = AnimationUtils.loadAnimation(v.getContext(), anim); animation.setAnimationListener(new AnimationListenerAdapter() { @Override public void onAnimationStart(Animation animation) { v.setVisibility(View.VISIBLE); } }); v.startAnimation(animation); }
79. MainActivity#hideButtonBar()
Project: discreet-app-rate
File: MainActivity.java
File: MainActivity.java
private void hideButtonBar() { Animation hideAnimation = AnimationUtils.loadAnimation(this, android.R.anim.fade_out); buttonBar.startAnimation(hideAnimation); hideAnimation.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { buttonBar.setVisibility(View.GONE); } @Override public void onAnimationRepeat(Animation animation) { } }); }
80. MainActivity#showButtonBar()
Project: discreet-app-rate
File: MainActivity.java
File: MainActivity.java
private void showButtonBar() { Animation showAnimation = AnimationUtils.loadAnimation(this, android.R.anim.fade_in); buttonBar.startAnimation(showAnimation); showAnimation.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { buttonBar.setVisibility(View.VISIBLE); } @Override public void onAnimationEnd(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } }); }
81. InCallCard#setVisibleWithFade()
Project: CSipSimple
File: InCallCard.java
File: InCallCard.java
private void setVisibleWithFade(View v, boolean in) { if (v.getVisibility() == View.VISIBLE && in) { // Already visible and ask to show, ignore return; } if (v.getVisibility() == View.GONE && !in) { // Already gone and ask to hide, ignore return; } Animation anim = AnimationUtils.loadAnimation(getContext(), in ? android.R.anim.fade_in : android.R.anim.fade_out); anim.setDuration(1000); v.startAnimation(anim); v.setVisibility(in ? View.VISIBLE : View.GONE); }
82. TextSwitcher1#onCreate()
Project: codeexamples-android
File: TextSwitcher1.java
File: TextSwitcher1.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.text_switcher_1); mSwitcher = (TextSwitcher) findViewById(R.id.switcher); mSwitcher.setFactory(this); Animation in = AnimationUtils.loadAnimation(this, android.R.anim.fade_in); Animation out = AnimationUtils.loadAnimation(this, android.R.anim.fade_out); mSwitcher.setInAnimation(in); mSwitcher.setOutAnimation(out); Button nextButton = (Button) findViewById(R.id.next); nextButton.setOnClickListener(this); updateCounter(); }
83. ActionBarSherlockCompat#hideProgressBars()
Project: astrid
File: ActionBarSherlockCompat.java
File: ActionBarSherlockCompat.java
private void hideProgressBars(IcsProgressBar horizontalProgressBar, IcsProgressBar spinnyProgressBar) { //getLocalFeatures(); final int features = mFeatures; Animation anim = AnimationUtils.loadAnimation(mActivity, android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
84. TabsProvider#hideTabList()
Project: apps-android-wikipedia
File: TabsProvider.java
File: TabsProvider.java
private void hideTabList() { Animation anim = AnimationUtils.loadAnimation(parentActivity, R.anim.tab_list_items_exit); anim.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { tabContainerView.setVisibility(View.GONE); } @Override public void onAnimationRepeat(Animation animation) { } }); tabListView.startAnimation(anim); }
85. AndroidTreeView#collapse()
Project: AndroidTreeView
File: AndroidTreeView.java
File: AndroidTreeView.java
private static void collapse(final View v) { final int initialHeight = v.getMeasuredHeight(); Animation a = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { if (interpolatedTime == 1) { v.setVisibility(View.GONE); } else { v.getLayoutParams().height = initialHeight - (int) (initialHeight * interpolatedTime); v.requestLayout(); } } @Override public boolean willChangeBounds() { return true; } }; // 1dp/ms a.setDuration((int) (initialHeight / v.getContext().getResources().getDisplayMetrics().density)); v.startAnimation(a); }
86. AndroidTreeView#expand()
Project: AndroidTreeView
File: AndroidTreeView.java
File: AndroidTreeView.java
private static void expand(final View v) { v.measure(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); final int targetHeight = v.getMeasuredHeight(); v.getLayoutParams().height = 0; v.setVisibility(View.VISIBLE); Animation a = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { v.getLayoutParams().height = interpolatedTime == 1 ? LinearLayout.LayoutParams.WRAP_CONTENT : (int) (targetHeight * interpolatedTime); v.requestLayout(); } @Override public boolean willChangeBounds() { return true; } }; // 1dp/ms a.setDuration((int) (targetHeight / v.getContext().getResources().getDisplayMetrics().density)); v.startAnimation(a); }
87. SwipeRefreshLayout#startAlphaAnimation()
Project: AndroidStudyDemo
File: SwipeRefreshLayout.java
File: SwipeRefreshLayout.java
private Animation startAlphaAnimation(final int startingAlpha, final int endingAlpha) { // show the trigger point. if (mScale && isAlphaUsedForScale()) { return null; } Animation alpha = new Animation() { @Override public void applyTransformation(float interpolatedTime, Transformation t) { mProgress.setAlpha((int) (startingAlpha + ((endingAlpha - startingAlpha) * interpolatedTime))); } }; alpha.setDuration(ALPHA_ANIMATION_DURATION); // Clear out the previous animation listeners. mCircleView.setAnimationListener(null); mCircleView.clearAnimation(); mCircleView.startAnimation(alpha); return alpha; }
88. SwipyRefreshLayout#startAlphaAnimation()
Project: AndroidStudyDemo
File: SwipyRefreshLayout.java
File: SwipyRefreshLayout.java
private Animation startAlphaAnimation(final int startingAlpha, final int endingAlpha) { // show the trigger point. if (mScale && isAlphaUsedForScale()) { return null; } Animation alpha = new Animation() { @Override public void applyTransformation(float interpolatedTime, Transformation t) { mProgress.setAlpha((int) (startingAlpha + ((endingAlpha - startingAlpha) * interpolatedTime))); } }; alpha.setDuration(ALPHA_ANIMATION_DURATION); // Clear out the previous animation listeners. mCircleView.setAnimationListener(null); mCircleView.clearAnimation(); mCircleView.startAnimation(alpha); return alpha; }
89. MenuAnimationUtils#loadAnimation()
Project: Android-tv-widget
File: MenuAnimationUtils.java
File: MenuAnimationUtils.java
/** * ????. */ @SuppressWarnings("ResourceType") public static LayoutAnimationController loadAnimation(Context context) { /* * ??????? */ AnimationSet set = new AnimationSet(false); Animation animation; /* * ?????? */ animation = new RotateAnimation(180, 10); animation.setDuration(1000); set.addAnimation(animation); LayoutAnimationController controller = new LayoutAnimationController(set, 1); controller.setInterpolator(context, android.R.anim.accelerate_interpolator); controller.setAnimation(set); return controller; }
90. TextSwitcher1#onCreate()
Project: android-maven-plugin
File: TextSwitcher1.java
File: TextSwitcher1.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.text_switcher_1); mSwitcher = (TextSwitcher) findViewById(R.id.switcher); mSwitcher.setFactory(this); Animation in = AnimationUtils.loadAnimation(this, android.R.anim.fade_in); Animation out = AnimationUtils.loadAnimation(this, android.R.anim.fade_out); mSwitcher.setInAnimation(in); mSwitcher.setOutAnimation(out); Button nextButton = (Button) findViewById(R.id.next); nextButton.setOnClickListener(this); updateCounter(); }
91. ActionBarSherlockCompat#hideProgressBars()
Project: ActionBarSherlock
File: ActionBarSherlockCompat.java
File: ActionBarSherlockCompat.java
private void hideProgressBars(IcsProgressBar horizontalProgressBar, IcsProgressBar spinnyProgressBar) { //getLocalFeatures(); final int features = mFeatures; Animation anim = AnimationUtils.loadAnimation(mActivity, android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
92. CommentsActivity#showBar()
Project: AcFun-Area63
File: CommentsActivity.java
File: CommentsActivity.java
void showBar() { if (isBarShowing) return; isBarShowing = true; getSupportActionBar().show(); if (mAnim != null) mAnim.cancel(); Animation anim = AnimationUtils.loadAnimation(this, R.anim.slide_in); anim.setAnimationListener(mShowListener); mAnim = anim; mCommentBar.startAnimation(mAnim); }
93. CommentsActivity#hideBar()
Project: AcFun-Area63
File: CommentsActivity.java
File: CommentsActivity.java
void hideBar() { if (!isBarShowing) return; isBarShowing = false; getSupportActionBar().hide(); if (mAnim != null) mAnim.cancel(); Animation anim = AnimationUtils.loadAnimation(this, R.anim.slide_out); anim.setAnimationListener(mHideListener); mAnim = anim; mCommentBar.startAnimation(mAnim); }
94. BaseMessageActivity#showPlusBar()
Project: WifiChat
File: BaseMessageActivity.java
File: BaseMessageActivity.java
protected void showPlusBar() { mLayoutFullScreenMask.setEnabled(true); mLayoutMessagePlusBar.setEnabled(true); mLayoutMessagePlusPicture.setEnabled(true); mLayoutMessagePlusCamera.setEnabled(true); mLayoutMessagePlusFile.setEnabled(true); Animation animation = AnimationUtils.loadAnimation(BaseMessageActivity.this, R.anim.controller_enter); mLayoutMessagePlusBar.setAnimation(animation); mLayoutMessagePlusBar.setVisibility(View.VISIBLE); mLayoutFullScreenMask.setVisibility(View.VISIBLE); }
95. OAuthActivity#refresh()
Project: weiciyuan
File: OAuthActivity.java
File: OAuthActivity.java
public void refresh() { webView.clearView(); webView.loadUrl("about:blank"); LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); ImageView iv = (ImageView) inflater.inflate(R.layout.refresh_action_view, null); Animation rotation = AnimationUtils.loadAnimation(this, R.anim.refresh); iv.startAnimation(rotation); refreshItem.setActionView(iv); webView.loadUrl(getWeiboOAuthUrl()); }
96. SearchDrawableActivity#startUpAnimation()
Project: UltimateAndroid
File: SearchDrawableActivity.java
File: SearchDrawableActivity.java
private void startUpAnimation() { mStartAnimation = new Animation() { @Override public void applyTransformation(float interpolatedTime, Transformation t) { if (back) { searchDrawable.setPhase(1 - interpolatedTime); textView.setAlpha(0f); textView.setVisibility(View.GONE); } else { searchDrawable.setPhase(interpolatedTime); textView.animate().alpha(1f).setDuration(100).setInterpolator(new AccelerateDecelerateInterpolator()); textView.setVisibility(View.VISIBLE); } } }; mStartAnimation.setInterpolator(new AccelerateDecelerateInterpolator()); mStartAnimation.setDuration(START_ANIMATION_DURATION); }
97. RefreshView#setupAnimations()
Project: Taurus
File: RefreshView.java
File: RefreshView.java
private void setupAnimations() { mAnimation = new Animation() { @Override public void applyTransformation(float interpolatedTime, @NonNull Transformation t) { setLoadingAnimationTime(interpolatedTime); } }; mAnimation.setRepeatCount(Animation.INFINITE); mAnimation.setRepeatMode(Animation.REVERSE); mAnimation.setInterpolator(ACCELERATE_DECELERATE_INTERPOLATOR); mAnimation.setDuration(ANIMATION_DURATION); }
98. SwipyRefreshLayout#startScaleDownReturnToStartAnimation()
Project: SwipyRefreshLayout
File: SwipyRefreshLayout.java
File: SwipyRefreshLayout.java
private void startScaleDownReturnToStartAnimation(int from, AnimationListener listener) { mFrom = from; if (isAlphaUsedForScale()) { mStartingScale = mProgress.getAlpha(); } else { mStartingScale = ViewCompat.getScaleX(mCircleView); } mScaleDownToStartAnimation = new Animation() { @Override public void applyTransformation(float interpolatedTime, Transformation t) { float targetScale = (mStartingScale + (-mStartingScale * interpolatedTime)); setAnimationProgress(targetScale); moveToStart(interpolatedTime); } }; mScaleDownToStartAnimation.setDuration(SCALE_DOWN_DURATION); if (listener != null) { mCircleView.setAnimationListener(listener); } mCircleView.clearAnimation(); mCircleView.startAnimation(mScaleDownToStartAnimation); }
99. SwipyRefreshLayout#startScaleDownAnimation()
Project: SwipyRefreshLayout
File: SwipyRefreshLayout.java
File: SwipyRefreshLayout.java
private void startScaleDownAnimation(AnimationListener listener) { mScaleDownAnimation = new Animation() { @Override public void applyTransformation(float interpolatedTime, Transformation t) { setAnimationProgress(1 - interpolatedTime); } }; mScaleDownAnimation.setDuration(SCALE_DOWN_DURATION); mCircleView.setAnimationListener(listener); mCircleView.clearAnimation(); mCircleView.startAnimation(mScaleDownAnimation); }
100. SwipyRefreshLayout#startScaleUpAnimation()
Project: SwipyRefreshLayout
File: SwipyRefreshLayout.java
File: SwipyRefreshLayout.java
private void startScaleUpAnimation(AnimationListener listener) { mCircleView.setVisibility(View.VISIBLE); if (android.os.Build.VERSION.SDK_INT >= 11) { // Pre API 11, alpha is used in place of scale up to show the // progress circle appearing. // Don't adjust the alpha during appearance otherwise. mProgress.setAlpha(MAX_ALPHA); } mScaleAnimation = new Animation() { @Override public void applyTransformation(float interpolatedTime, Transformation t) { setAnimationProgress(interpolatedTime); } }; mScaleAnimation.setDuration(mMediumAnimationDuration); if (listener != null) { mCircleView.setAnimationListener(listener); } mCircleView.clearAnimation(); mCircleView.startAnimation(mScaleAnimation); }