Here are the examples of the java api class android.view.animation.AlphaAnimation taken from open source projects.
1. SpotlightView#startFadeout()
Project: Spotlight
File: SpotlightView.java
File: SpotlightView.java
private void startFadeout() { AlphaAnimation fadeIn = new AlphaAnimation(1.0f, 0.0f); fadeIn.setDuration(introAnimationDuration); fadeIn.setFillAfter(true); fadeIn.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { setVisibility(GONE); removeSpotlightView(); } @Override public void onAnimationRepeat(Animation animation) { } }); startAnimation(fadeIn); }
2. SpotlightView#startFadinAnimation()
Project: Spotlight
File: SpotlightView.java
File: SpotlightView.java
private void startFadinAnimation(final Activity activity) { AlphaAnimation fadeIn = new AlphaAnimation(0.0f, 1.0f); fadeIn.setDuration(introAnimationDuration); fadeIn.setFillAfter(true); fadeIn.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { addArcAnimation(activity); } @Override public void onAnimationRepeat(Animation animation) { } }); setVisibility(VISIBLE); startAnimation(fadeIn); }
3. FragmentManager#makeOpenCloseAnimation()
Project: CodenameOne
File: FragmentManager.java
File: FragmentManager.java
static Animation makeOpenCloseAnimation(Context context, float startScale, float endScale, float startAlpha, float endAlpha) { AnimationSet set = new AnimationSet(false); ScaleAnimation scale = new ScaleAnimation(startScale, endScale, startScale, endScale, Animation.RELATIVE_TO_SELF, .5f, Animation.RELATIVE_TO_SELF, .5f); scale.setInterpolator(DECELERATE_QUINT); scale.setDuration(ANIM_DUR); set.addAnimation(scale); AlphaAnimation alpha = new AlphaAnimation(startAlpha, endAlpha); alpha.setInterpolator(DECELERATE_CUBIC); alpha.setDuration(ANIM_DUR); set.addAnimation(alpha); return set; }
4. SimpleDisplayer#fadeInDisplay()
Project: volley
File: SimpleDisplayer.java
File: SimpleDisplayer.java
private void fadeInDisplay(View imageView, Drawable bitmapDrawable) { AlphaAnimation animation = new AlphaAnimation(0, 1); animation.setDuration(200); animationDisplay(imageView, bitmapDrawable, animation); // if (bitmapDrawable == null) { // return; // } // final TransitionDrawable td = // new TransitionDrawable(new Drawable[] { // new ColorDrawable(android.R.color.transparent), // bitmapDrawable // }); // if(imageView instanceof ImageView){ // ((ImageView)imageView).setImageDrawable(td); // }else{ // imageView.setBackgroundDrawable(td); // } // td.startTransition(200); }
5. SampleCallout#transitionIn()
Project: TileView
File: SampleCallout.java
File: SampleCallout.java
public void transitionIn() { ScaleAnimation scaleAnimation = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 1f); scaleAnimation.setInterpolator(new OvershootInterpolator(1.2f)); scaleAnimation.setDuration(250); AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1f); alphaAnimation.setDuration(200); AnimationSet animationSet = new AnimationSet(false); animationSet.addAnimation(scaleAnimation); animationSet.addAnimation(alphaAnimation); startAnimation(animationSet); }
6. SplashActivity#onCreate()
Project: sdkdemoapp3.0_android
File: SplashActivity.java
File: SplashActivity.java
@Override protected void onCreate(Bundle arg0) { setContentView(R.layout.em_activity_splash); super.onCreate(arg0); rootLayout = (RelativeLayout) findViewById(R.id.splash_root); versionText = (TextView) findViewById(R.id.tv_version); versionText.setText(getVersion()); AlphaAnimation animation = new AlphaAnimation(0.3f, 1.0f); animation.setDuration(1500); rootLayout.startAnimation(animation); }
7. FadeAnimationUtil#fadeOutAlpha()
Project: Munch
File: FadeAnimationUtil.java
File: FadeAnimationUtil.java
public void fadeOutAlpha(final View view, int durationInMillis) { view.setVisibility(View.VISIBLE); AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, 0f); alphaAnimation.setDuration(durationInMillis); view.startAnimation(alphaAnimation); view.setVisibility(View.INVISIBLE); /*new Handler().postDelayed(new Runnable() { @Override public void run() { view.setVisibility(View.GONE); } }, 1000);*/ }
8. GittyReporter#animateLoginPage()
Project: GittyReporter
File: GittyReporter.java
File: GittyReporter.java
private void animateLoginPage() { final View colorView = findViewById(R.id.gittyreporter_material_ripple); final View loginView = findViewById(R.id.gittyreporter_loginFrame); final View nextFab = findViewById(R.id.gittyreporter_fab_next); final View sendFab = findViewById(R.id.gittyreporter_fab_send); final AlphaAnimation fadeOutColorAnim = new AlphaAnimation(1.0f, 0.0f); fadeOutColorAnim.setDuration(400); fadeOutColorAnim.setInterpolator(new AccelerateInterpolator()); final AlphaAnimation fadeOutFabAnim = new AlphaAnimation(1.0f, 0.0f); fadeOutFabAnim.setDuration(400); fadeOutFabAnim.setInterpolator(new AccelerateInterpolator()); final AlphaAnimation fadeInAnim = new AlphaAnimation(0.0f, 1.0f); fadeInAnim.setDuration(400); fadeInAnim.setInterpolator(new AccelerateInterpolator()); fadeOutColorAnim.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { loginView.setVisibility(View.VISIBLE); } @Override public void onAnimationEnd(Animation animation) { colorView.setVisibility(View.GONE); } @Override public void onAnimationRepeat(Animation animation) { } }); fadeOutFabAnim.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { sendFab.setVisibility(View.VISIBLE); sendFab.startAnimation(fadeInAnim); } @Override public void onAnimationRepeat(Animation animation) { } }); int cx = (colorView.getRight()); int cy = (colorView.getBottom()); int finalRadius = Math.max(colorView.getWidth(), colorView.getHeight()); Animator rippleAnim = ViewAnimationUtils.createCircularReveal(colorView, cx, cy, 0, finalRadius); rippleAnim.setInterpolator(new AccelerateInterpolator()); rippleAnim.addListener(new android.animation.Animator.AnimatorListener() { @Override public void onAnimationStart(android.animation.Animator animation) { } @Override public void onAnimationRepeat(android.animation.Animator animation) { } @Override public void onAnimationEnd(android.animation.Animator animation) { colorView.startAnimation(fadeOutColorAnim); nextFab.startAnimation(fadeOutFabAnim); nextFab.setVisibility(View.INVISIBLE); } @Override public void onAnimationCancel(android.animation.Animator animation) { } }); colorView.setVisibility(View.VISIBLE); rippleAnim.start(); }
9. BubbleTypingIndicatorFactory#startAnimation()
Project: Atlas-Android
File: BubbleTypingIndicatorFactory.java
File: BubbleTypingIndicatorFactory.java
/** * Starts a repeating fade out / fade in with the given period and offset in milliseconds. * * @param view View to start animating. * @param period Length of time in milliseconds for the fade out / fade in period. * @param startOffset Length of time in milliseconds to delay the initial start. */ private void startAnimation(final View view, long period, long startOffset) { final AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f); fadeOut.setDuration(period / 2); fadeOut.setStartOffset(startOffset); fadeOut.setInterpolator(COSINE_INTERPOLATOR); final AlphaAnimation fadeIn = new AlphaAnimation(0.0f, 1.0f); fadeIn.setDuration(period / 2); fadeIn.setStartOffset(0); fadeIn.setInterpolator(COSINE_INTERPOLATOR); fadeOut.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { fadeIn.setStartOffset(0); fadeIn.reset(); view.startAnimation(fadeIn); } @Override public void onAnimationRepeat(Animation animation) { } }); fadeIn.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { fadeOut.setStartOffset(0); fadeOut.reset(); view.startAnimation(fadeOut); } @Override public void onAnimationRepeat(Animation animation) { } }); view.startAnimation(fadeOut); }
10. AvatarTypingIndicatorFactory#startAnimation()
Project: Atlas-Android
File: AvatarTypingIndicatorFactory.java
File: AvatarTypingIndicatorFactory.java
/** * Starts a repeating fade out / fade in with the given period and offset in milliseconds. * * @param view View to start animating. * @param period Length of time in milliseconds for the fade out / fade in period. * @param startOffset Length of time in milliseconds to delay the initial start. */ private void startAnimation(final View view, long period, long startOffset) { final AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f); fadeOut.setDuration(period / 2); fadeOut.setStartOffset(startOffset); fadeOut.setInterpolator(COSINE_INTERPOLATOR); final AlphaAnimation fadeIn = new AlphaAnimation(0.0f, 1.0f); fadeIn.setDuration(period / 2); fadeIn.setStartOffset(0); fadeIn.setInterpolator(COSINE_INTERPOLATOR); fadeOut.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { fadeIn.setStartOffset(0); fadeIn.reset(); view.startAnimation(fadeIn); } @Override public void onAnimationRepeat(Animation animation) { } }); fadeIn.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { fadeOut.setStartOffset(0); fadeOut.reset(); view.startAnimation(fadeOut); } @Override public void onAnimationRepeat(Animation animation) { } }); view.startAnimation(fadeOut); }
11. GittyReporter#showDoneAnimation()
Project: GittyReporter
File: GittyReporter.java
File: GittyReporter.java
public void showDoneAnimation() { final View doneView = findViewById(R.id.gittyreporter_doneFrame); final View doneImage = findViewById(R.id.gittyreporter_done_image); final View sendFab = findViewById(R.id.gittyreporter_fab_send); final AlphaAnimation fadeOutColorAnim = new AlphaAnimation(1.0f, 0.0f); fadeOutColorAnim.setDuration(1000); fadeOutColorAnim.setInterpolator(new AccelerateInterpolator()); final AlphaAnimation fadeOutFabAnim = new AlphaAnimation(1.0f, 0.0f); fadeOutFabAnim.setDuration(400); fadeOutFabAnim.setInterpolator(new AccelerateInterpolator()); fadeOutColorAnim.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { doneImage.setVisibility(View.INVISIBLE); finish(); } @Override public void onAnimationRepeat(Animation animation) { } }); fadeOutFabAnim.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { sendFab.setVisibility(View.INVISIBLE); } @Override public void onAnimationRepeat(Animation animation) { } }); int cx = (doneView.getRight()); int cy = (doneView.getBottom()); int finalRadius = Math.max(doneView.getWidth(), doneView.getHeight()); Animator rippleAnim = ViewAnimationUtils.createCircularReveal(doneView, cx, cy, 0, finalRadius); rippleAnim.setInterpolator(new AccelerateInterpolator()); rippleAnim.addListener(new android.animation.Animator.AnimatorListener() { @Override public void onAnimationStart(android.animation.Animator animation) { sendFab.startAnimation(fadeOutFabAnim); } @Override public void onAnimationRepeat(android.animation.Animator animation) { } @Override public void onAnimationEnd(android.animation.Animator animation) { doneImage.startAnimation(fadeOutColorAnim); } @Override public void onAnimationCancel(android.animation.Animator animation) { } }); doneView.setVisibility(View.VISIBLE); rippleAnim.start(); }
12. DatePickerDialog#onCreateView()
Project: Conquer
File: DatePickerDialog.java
File: DatePickerDialog.java
public View onCreateView(LayoutInflater layoutInflater, ViewGroup parent, Bundle bundle) { getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); View view = layoutInflater.inflate(R.layout.date_picker_dialog, null); mDayOfWeekView = ((TextView) view.findViewById(R.id.date_picker_header)); mMonthAndDayView = ((LinearLayout) view.findViewById(R.id.date_picker_month_and_day)); mMonthAndDayView.setOnClickListener(this); mSelectedMonthTextView = ((TextView) view.findViewById(R.id.date_picker_month)); mSelectedDayTextView = ((TextView) view.findViewById(R.id.date_picker_day)); mYearView = ((TextView) view.findViewById(R.id.date_picker_year)); mYearView.setOnClickListener(this); int listPosition = -1; int currentView = MONTH_AND_DAY_VIEW; int listPositionOffset = 0; if (bundle != null) { mWeekStart = bundle.getInt(KEY_WEEK_START); mMinYear = bundle.getInt(KEY_YEAR_START); mMaxYear = bundle.getInt(KEY_YEAR_END); currentView = bundle.getInt(KEY_CURRENT_VIEW); listPosition = bundle.getInt(KEY_LIST_POSITION); listPositionOffset = bundle.getInt(KEY_LIST_POSITION_OFFSET); } Activity activity = getActivity(); mDayPickerView = new DayPickerView(activity, this); mYearPickerView = new YearPickerView(activity, this); Resources resources = getResources(); mDayPickerDescription = resources.getString(R.string.day_picker_description); mSelectDay = resources.getString(R.string.select_day); mYearPickerDescription = resources.getString(R.string.year_picker_description); mSelectYear = resources.getString(R.string.select_year); mAnimator = ((AccessibleDateAnimator) view.findViewById(R.id.animator)); mAnimator.addView(mDayPickerView); mAnimator.addView(mYearPickerView); mAnimator.setDateMillis(mCalendar.getTimeInMillis()); AlphaAnimation inAlphaAnimation = new AlphaAnimation(0.0F, 1.0F); inAlphaAnimation.setDuration(300L); mAnimator.setInAnimation(inAlphaAnimation); AlphaAnimation outAlphaAnimation = new AlphaAnimation(1.0F, 0.0F); outAlphaAnimation.setDuration(300L); mAnimator.setOutAnimation(outAlphaAnimation); mDoneButton = ((Button) view.findViewById(R.id.done)); mDoneButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { onDoneButtonClick(); } }); updateDisplay(false); setCurrentView(currentView, true); if (listPosition != -1) { if (currentView == MONTH_AND_DAY_VIEW) { mDayPickerView.postSetSelection(listPosition); } if (currentView == YEAR_VIEW) { mYearPickerView.postSetSelectionFromTop(listPosition, listPositionOffset); } } return view; }
13. ChatActivity#showAudio()
Project: actor-platform
File: ChatActivity.java
File: ChatActivity.java
private void showAudio() { if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(this, Manifest.permission.VIBRATE) != PackageManager.PERMISSION_GRANTED) { Log.d("Permissions", "recordAudio - no permission :c"); ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.RECORD_AUDIO, Manifest.permission.VIBRATE }, PERMISSION_REQUEST_RECORD_AUDIO); return; } if (isAudioVisible) { return; } isAudioVisible = true; hideView(attachButton); hideView(messageEditText); hideView(emojiButton); hideView(sendContainer); audioFile = ActorSDK.sharedActor().getMessenger().getInternalTempFile("voice_msg", "opus"); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR); long id = VoiceCaptureActor.LAST_ID.incrementAndGet(); voiceRecordActor.send(new VoiceCaptureActor.Start(audioFile)); slideAudio(0); audioTimer.setText("00:00"); TranslateAnimation animation = new TranslateAnimation(Screen.getWidth(), 0, 0, 0); animation.setDuration(160); audioContainer.clearAnimation(); audioContainer.setAnimation(animation); audioContainer.animate(); audioContainer.setVisibility(View.VISIBLE); AlphaAnimation alphaAnimation = new AlphaAnimation(1f, 0.2f); alphaAnimation.setDuration(800); alphaAnimation.setRepeatMode(AlphaAnimation.REVERSE); alphaAnimation.setRepeatCount(AlphaAnimation.INFINITE); recordPoint.clearAnimation(); recordPoint.setAnimation(alphaAnimation); recordPoint.animate(); }
14. ShowImageActivity#animateImageView()
Project: TuentiTV
File: ShowImageActivity.java
File: ShowImageActivity.java
private void animateImageView() { AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1.0f); alphaAnimation.setDuration(ALPHA_ANIMATION_DURATION); alphaAnimation.setFillAfter(true); iv_media_element.startAnimation(alphaAnimation); iv_media_element.setVisibility(View.VISIBLE); }
15. PickerFragment#setAlpha()
Project: q-municate-android
File: PickerFragment.java
File: PickerFragment.java
private static void setAlpha(View view, float alpha) { // Set the alpha appropriately (setAlpha is API >= 11, this technique works on all API levels). AlphaAnimation alphaAnimation = new AlphaAnimation(alpha, alpha); alphaAnimation.setDuration(0); alphaAnimation.setFillAfter(true); view.startAnimation(alphaAnimation); }
16. KJAnimations#getAlphaAnimation()
Project: KJFrameForAndroid
File: KJAnimations.java
File: KJAnimations.java
/** * ??? Alpha */ public static Animation getAlphaAnimation(float fromAlpha, float toAlpha, long durationMillis) { AlphaAnimation alpha = new AlphaAnimation(fromAlpha, toAlpha); alpha.setDuration(durationMillis); alpha.setFillAfter(true); return alpha; }
17. KJAnimations#getAlphaAnimation()
Project: KJBlog
File: KJAnimations.java
File: KJAnimations.java
/** * ??? Alpha */ public static Animation getAlphaAnimation(float fromAlpha, float toAlpha, long durationMillis) { AlphaAnimation alpha = new AlphaAnimation(fromAlpha, toAlpha); alpha.setDuration(durationMillis); alpha.setFillAfter(true); return alpha; }
18. FadeInImageAnimator#animate()
Project: ImageLoader_Android
File: FadeInImageAnimator.java
File: FadeInImageAnimator.java
@Override public void animate(@NonNull ImageSettable settable) { AlphaAnimation fadeImage = new AlphaAnimation(0, 1); fadeImage.setDuration(getDuration()); fadeImage.setInterpolator(new DecelerateInterpolator()); settable.startAnimation(fadeImage); }
19. MainActivity#removeWhiteOverlay()
Project: glucosio-android
File: MainActivity.java
File: MainActivity.java
private void removeWhiteOverlay() { AlphaAnimation alpha = new AlphaAnimation(viewPager.getAlpha(), 1F); alpha.setDuration(0); alpha.setFillAfter(true); viewPager.startAnimation(alpha); }
20. FragmentManager#makeFadeAnimation()
Project: CodenameOne
File: FragmentManager.java
File: FragmentManager.java
static Animation makeFadeAnimation(Context context, float start, float end) { AlphaAnimation anim = new AlphaAnimation(start, end); anim.setInterpolator(DECELERATE_CUBIC); anim.setDuration(ANIM_DUR); return anim; }
21. AddAddressHotHDMFragment#finalAnimation()
Project: bither-android
File: AddAddressHotHDMFragment.java
File: AddAddressHotHDMFragment.java
private void finalAnimation() { final int fadeDuration = 400; final int zoomDuration = 500; AlphaAnimation fadeOut = new AlphaAnimation(1, 0); fadeOut.setDuration(fadeDuration); fadeOut.setFillAfter(true); vBg.startAnimation(fadeOut); tvHot.startAnimation(fadeOut); tvCold.startAnimation(fadeOut); tvServer.startAnimation(fadeOut); if (llSingularRunning.getVisibility() == View.VISIBLE) { llSingularRunning.startAnimation(fadeOut); } flContainer.postDelayed(new Runnable() { @Override public void run() { vBg.setVisibility(View.GONE); tvHot.setVisibility(View.INVISIBLE); tvCold.setVisibility(View.INVISIBLE); tvServer.setVisibility(View.INVISIBLE); int[] size = getCompactContainerSize(); WrapLayoutParamsForAnimator animWrapper = new WrapLayoutParamsForAnimator(flContainer); ObjectAnimator animatorWidth = ObjectAnimator.ofInt(animWrapper, "width", size[0]).setDuration(zoomDuration); ObjectAnimator animatorHeight = ObjectAnimator.ofInt(animWrapper, "height", size[1]).setDuration(zoomDuration); AnimatorSet animatorSet = new AnimatorSet(); animatorSet.playTogether(animatorWidth, animatorHeight); animatorSet.start(); flContainer.postDelayed(new Runnable() { @Override public void run() { Animation anim = AnimationUtils.loadAnimation(getActivity(), R.anim.hdm_keychain_add_spin); anim.setFillAfter(true); flContainer.startAnimation(anim); ArrayList<String> addresses = getAddresses(); Intent intent = new Intent(); intent.putExtra(BitherSetting.INTENT_REF.ADDRESS_POSITION_PASS_VALUE_TAG, addresses); getActivity().setResult(Activity.RESULT_OK, intent); flContainer.postDelayed(new Runnable() { @Override public void run() { if (getActivity() != null) { ((AddPrivateKeyActivity) getActivity()).save(); } } }, anim.getDuration()); } }, zoomDuration); } }, fadeDuration); }
22. StartActivity#onCreate()
Project: BeeFramework_Android
File: StartActivity.java
File: StartActivity.java
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final View startView = View.inflate(this, R.layout.splash, null); setContentView(startView); context = this; //?? AlphaAnimation aa = new AlphaAnimation(0.3f, 1.0f); aa.setDuration(2000); startView.setAnimation(aa); aa.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationEnd(Animation animation) { // TODO Auto-generated method stub redirectto(); } }); }
23. PickerFragment#setAlpha()
Project: astrid
File: PickerFragment.java
File: PickerFragment.java
private static void setAlpha(View view, float alpha) { // Set the alpha appropriately (setAlpha is API >= 11, this technique works on all API levels). AlphaAnimation alphaAnimation = new AlphaAnimation(alpha, alpha); alphaAnimation.setDuration(0); alphaAnimation.setFillAfter(true); view.startAnimation(alphaAnimation); }
24. RightCircleView#startSecondaryCircleAnimation()
Project: AnimatedCircleLoadingView
File: RightCircleView.java
File: RightCircleView.java
public void startSecondaryCircleAnimation() { int bottomMovementAddition = (260 * parentWidth) / 700; TranslateAnimation translateAnimation = new TranslateAnimation(getX(), getX(), getY(), getY() + bottomMovementAddition); translateAnimation.setStartOffset(200); translateAnimation.setDuration(1000); AlphaAnimation alphaAnimation = new AlphaAnimation(1, 0); alphaAnimation.setStartOffset(1300); alphaAnimation.setDuration(200); AnimationSet animationSet = new AnimationSet(true); animationSet.addAnimation(translateAnimation); animationSet.addAnimation(alphaAnimation); animationSet.setFillAfter(true); animationSet.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { // Empty } @Override public void onAnimationEnd(Animation animation) { setState(AnimationState.SECONDARY_CIRCLE_FINISHED); } @Override public void onAnimationRepeat(Animation animation) { // Empty } }); startAnimation(animationSet); }
25. PercentIndicatorView#startAlphaAnimation()
Project: AnimatedCircleLoadingView
File: PercentIndicatorView.java
File: PercentIndicatorView.java
public void startAlphaAnimation() { AlphaAnimation alphaAnimation = new AlphaAnimation(1, 0); alphaAnimation.setDuration(700); alphaAnimation.setFillAfter(true); startAnimation(alphaAnimation); }
26. PickerFragment#setAlpha()
Project: ANE-Facebook
File: PickerFragment.java
File: PickerFragment.java
private static void setAlpha(View view, float alpha) { // Set the alpha appropriately (setAlpha is API >= 11, this technique works on all API levels). AlphaAnimation alphaAnimation = new AlphaAnimation(alpha, alpha); alphaAnimation.setDuration(0); alphaAnimation.setFillAfter(true); view.startAnimation(alphaAnimation); }
27. SamplePeopleFragment#showAvatar()
Project: android-DecoView-charting
File: SamplePeopleFragment.java
File: SamplePeopleFragment.java
private void showAvatar(boolean show, View view) { AlphaAnimation animation = new AlphaAnimation(show ? 0.0f : 1.0f, show ? 1.0f : 0.0f); animation.setDuration(1000); animation.setFillAfter(true); view.startAnimation(animation); }
28. SampleFit2Fragment#showAvatar()
Project: android-DecoView-charting
File: SampleFit2Fragment.java
File: SampleFit2Fragment.java
private void showAvatar(boolean show, View view) { AlphaAnimation animation = new AlphaAnimation(show ? 0.0f : 1.0f, show ? 1.0f : 0.0f); animation.setDuration(2000); animation.setFillAfter(true); view.startAnimation(animation); }
29. SearchFileFragment#onCreateView()
Project: actor-platform
File: SearchFileFragment.java
File: SearchFileFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.inflate(R.layout.picker_fragment_file_search, container, false); root = getArguments().getString("root"); // ViewGroup searchContainer = (ViewGroup) rootView.findViewById(R.id.search_container); View contentContainer = rootView.findViewById(R.id.content_container); status = (TextView) rootView.findViewById(R.id.status); // progress = new IndeterminateWrapper(pickerActivity); // progress.show(); listView = (ListView) contentContainer.findViewById(R.id.list); listView.setOnScrollListener(this); adapter = new ExplorerAdapter(pickerActivity, items); listView.setAdapter(adapter); listView.setOnItemClickListener(pickerActivity); AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1); alphaAnimation.setDuration(300); alphaAnimation.setInterpolator(new MaterialInterpolator()); TranslateAnimation translateAnimation = new TranslateAnimation(0, 0, -150, 0); translateAnimation.setDuration(450); translateAnimation.setInterpolator(new MaterialInterpolator()); // searchContainer.startAnimation(translateAnimation); contentContainer.startAnimation(alphaAnimation); /**/ pickerActivity.getSupportActionBar().setTitle(R.string.picker_file_search_activity_title); if (index.isEmpty()) { indexingTask = new IndexTask(new File(root)) { @Override public void onIndexingEnded(ArrayList<File> indexedItems) { index.clear(); index.addAll(indexedItems); indexingTask = null; if (searchingTask != null) { searchingTask.execute(); } else { // progress.hide(); } } }; //searchingProgressBar.progressiveStart(); indexingTask.execute(); } else { } return rootView; }
30. SplashActivity#startAnim()
Project: zhsz
File: SplashActivity.java
File: SplashActivity.java
private void startAnim() { AnimationSet set = new AnimationSet(false); //???? RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); //?????? rotateAnimation.setDuration(1000); // ?????? rotateAnimation.setFillAfter(true); //???? ScaleAnimation scaleAnimation = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); scaleAnimation.setDuration(1000); scaleAnimation.setFillAfter(true); //???? AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1); alphaAnimation.setDuration(2000); alphaAnimation.setFillAfter(true); set.addAnimation(rotateAnimation); set.addAnimation(scaleAnimation); set.addAnimation(alphaAnimation); // ?????? set.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } // ?????? @Override public void onAnimationEnd(Animation animation) { jumpNextPage(); } @Override public void onAnimationRepeat(Animation animation) { } }); rl_root.startAnimation(set); }
31. OverlaySequenceTourActivity#onCreate()
Project: TourGuide
File: OverlaySequenceTourActivity.java
File: OverlaySequenceTourActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); mChosenContinueMethod = intent.getIntExtra(CONTINUE_METHOD, OVERLAY_METHOD); mActivity = this; setContentView(R.layout.activity_in_sequence); /* Get 3 buttons from layout */ mButton1 = (Button) findViewById(R.id.button); mButton2 = (Button) findViewById(R.id.button2); mButton3 = (Button) findViewById(R.id.button3); /* setup enter and exit animation */ mEnterAnimation = new AlphaAnimation(0f, 1f); mEnterAnimation.setDuration(600); mEnterAnimation.setFillAfter(true); mExitAnimation = new AlphaAnimation(1f, 0f); mExitAnimation.setDuration(600); mExitAnimation.setFillAfter(true); if (mChosenContinueMethod == OVERLAY_METHOD) { runOverlay_ContinueMethod(); } else if (mChosenContinueMethod == OVERLAY_LISTENER_METHOD) { runOverlayListener_ContinueMethod(); } }
32. SequenceTestActivity#onCreate()
Project: TourGuide
File: SequenceTestActivity.java
File: SequenceTestActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mActivity = this; setContentView(R.layout.activity_in_sequence); /* Get 3 buttons from layout */ button = (Button) findViewById(R.id.button); button2 = (Button) findViewById(R.id.button2); button3 = (Button) findViewById(R.id.button3); /* setup enter and exit animation */ enterAnimation = new AlphaAnimation(0f, 1f); enterAnimation.setDuration(600); enterAnimation.setFillAfter(true); exitAnimation = new AlphaAnimation(1f, 0f); exitAnimation.setDuration(600); exitAnimation.setFillAfter(true); if (CHOSEN_CONTINUE_METHOD == OVERLAY_METHOD) { runOverlayContinueMethod(); } else if (CHOSEN_CONTINUE_METHOD == OVERLAY_LISTENER_METHOD) { runOverlayListenerContinueMethod(); } /* setup 1st button, when clicked, cleanUp() and re-run ChainTourGuide on button2 */ button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mTutorialHandler.next(); } }); /* setup 2nd button, when clicked, cleanUp() and re-run ChainTourGuide on button3 */ button2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mTutorialHandler.next(); } }); /* setup 3rd button, when clicked, run cleanUp() */ button3.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mTutorialHandler.cleanUp(); } }); }
33. SequenceOverlayCMTestActivity#onCreate()
Project: TourGuide
File: SequenceOverlayCMTestActivity.java
File: SequenceOverlayCMTestActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); mIsTestException = intent.getBooleanExtra(TEST_EXCEPTION, false); Log.d("ddw", "mIsTestException: " + mIsTestException); mActivity = this; setContentView(R.layout.activity_in_sequence); /* Get 3 buttons from layout */ mButton1 = (Button) findViewById(R.id.button); mButton2 = (Button) findViewById(R.id.button2); mButton3 = (Button) findViewById(R.id.button3); /* setup enter and exit animation */ mEnterAnimation = new AlphaAnimation(0f, 1f); mEnterAnimation.setDuration(600); mEnterAnimation.setFillAfter(true); mExitAnimation = new AlphaAnimation(1f, 0f); mExitAnimation.setDuration(600); mExitAnimation.setFillAfter(true); runOverlay_ContinueMethod(); }
34. MasterLayout#setAnimation()
Project: TH-ProgressButton
File: MasterLayout.java
File: MasterLayout.java
private void setAnimation() { // Setting up and defining view animations. arcRotation = new RotateAnimation(0.0f, 360.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); arcRotation.setDuration(1000); in = new AnimationSet(true); out = new AnimationSet(true); out.setInterpolator(new AccelerateDecelerateInterpolator()); in.setInterpolator(new AccelerateDecelerateInterpolator()); scale_in = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); scale_out = new ScaleAnimation(1.0f, 3.0f, 1.0f, 3.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); new_scale_in = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); new_scale_in.setDuration(200); fade_in = new AlphaAnimation(0.0f, 1.0f); fade_out = new AlphaAnimation(1.0f, 0.0f); scale_in.setDuration(150); scale_out.setDuration(150); fade_in.setDuration(150); fade_out.setDuration(150); in.addAnimation(scale_in); in.addAnimation(fade_in); out.addAnimation(fade_out); out.addAnimation(scale_out); arcRotation.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation arg0) { // TODO Auto-generated method stub } @Override public void onAnimationRepeat(Animation arg0) { // TODO Auto-generated method stub } @Override public void onAnimationEnd(Animation arg0) { // TODO Auto-generated method stub first_click = false; buttonimage.startAnimation(out); } }); out.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub System.out.println("print this"); } @Override public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationEnd(Animation animation) { // TODO Auto-generated method stub buttonimage.setVisibility(View.GONE); buttonimage.setImageBitmap(second_icon_bmp); buttonimage.setVisibility(View.VISIBLE); buttonimage.startAnimation(in); arc_image.setVisibility(View.GONE); full_circle_image.setVisibility(View.VISIBLE); cusview.setVisibility(View.VISIBLE); flg_frmwrk_mode = 2; System.out.println("flg_frmwrk_mode" + flg_frmwrk_mode); } }); new_scale_in.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationEnd(Animation animation) { // TODO Auto-generated method stub cusview.setVisibility(View.GONE); buttonimage.setVisibility(View.VISIBLE); buttonimage.setImageBitmap(third_icon_bmp); flg_frmwrk_mode = 3; buttonimage.startAnimation(in); } }); }
35. RotatingFadeViewAnimator#initAnimations()
Project: socialize-sdk-android
File: RotatingFadeViewAnimator.java
File: RotatingFadeViewAnimator.java
protected void initAnimations() { fadeIn = new AlphaAnimation(0, 1); fadeIn.setDuration(fadeInTime); fadeOut = new AlphaAnimation(1, 0); fadeOut.setStartOffset(stickTime); fadeOut.setDuration(fadeOutTime); fadeIn.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { View view = getCurrentView(); view.setVisibility(View.VISIBLE); } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { View view = getCurrentView(); view.startAnimation(fadeOut); } }); fadeOut.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { View current = getCurrentView(); View next = getNextView(); current.setVisibility(View.GONE); next.setVisibility(View.VISIBLE); next.startAnimation(fadeIn); } }); }
36. HintView#getAlphaAnimation()
Project: Sketch
File: HintView.java
File: HintView.java
/** * ??????????? * @param fromAlpha ??????? * @param toAlpha ???????? * @param durationMillis ???? * @param animationListener ????? * @return ????????? */ public static AlphaAnimation getAlphaAnimation(float fromAlpha, float toAlpha, long durationMillis, AnimationListener animationListener) { AlphaAnimation alphaAnimation = new AlphaAnimation(fromAlpha, toAlpha); alphaAnimation.setDuration(durationMillis); if (animationListener != null) { alphaAnimation.setAnimationListener(animationListener); } return alphaAnimation; }
37. AnimationUtils#getAlphaAnimation()
Project: Sketch
File: AnimationUtils.java
File: AnimationUtils.java
/** * ??????????? * @param fromAlpha ??????? * @param toAlpha ???????? * @param durationMillis ???? * @param animationListener ????? * @return ????????? */ public static AlphaAnimation getAlphaAnimation(float fromAlpha, float toAlpha, long durationMillis, Animation.AnimationListener animationListener) { AlphaAnimation alphaAnimation = new AlphaAnimation(fromAlpha, toAlpha); alphaAnimation.setDuration(durationMillis); if (animationListener != null) { alphaAnimation.setAnimationListener(animationListener); } return alphaAnimation; }
38. BadgeView#init()
Project: serenity-android
File: BadgeView.java
File: BadgeView.java
private void init(Context context, View target, int tabIndex) { this.context = context; this.target = target; this.targetTabIndex = tabIndex; // apply defaults badgePosition = DEFAULT_POSITION; badgeMarginH = dipToPixels(DEFAULT_MARGIN_DIP); badgeMarginV = badgeMarginH; badgeColor = DEFAULT_BADGE_COLOR; setTypeface(Typeface.DEFAULT_BOLD); int paddingPixels = dipToPixels(DEFAULT_LR_PADDING_DIP); setPadding(paddingPixels, 0, paddingPixels, 0); setTextColor(DEFAULT_TEXT_COLOR); fadeIn = new AlphaAnimation(0, 1); fadeIn.setInterpolator(new DecelerateInterpolator()); fadeIn.setDuration(200); fadeOut = new AlphaAnimation(1, 0); fadeOut.setInterpolator(new AccelerateInterpolator()); fadeOut.setDuration(200); isShown = false; if (this.target != null) { applyTo(this.target); } else { show(); } }
39. BadgeView#init()
Project: RefreshActionItem
File: BadgeView.java
File: BadgeView.java
private void init(Context context, View target, int tabIndex) { this.context = context; this.target = target; this.targetTabIndex = tabIndex; // apply defaults badgePosition = DEFAULT_POSITION; badgeMarginH = dipToPixels(DEFAULT_MARGIN_DIP); badgeMarginV = badgeMarginH; badgeColor = DEFAULT_BADGE_COLOR; setTypeface(Typeface.DEFAULT_BOLD); int paddingPixels = dipToPixels(DEFAULT_LR_PADDING_DIP); setPadding(paddingPixels, 0, paddingPixels, 0); setTextColor(DEFAULT_TEXT_COLOR); fadeIn = new AlphaAnimation(0, 1); fadeIn.setInterpolator(new DecelerateInterpolator()); fadeIn.setDuration(200); fadeOut = new AlphaAnimation(1, 0); fadeOut.setInterpolator(new AccelerateInterpolator()); fadeOut.setDuration(200); isShown = false; if (this.target != null) { applyTo(this.target); } else { show(); } }
40. BadgeView#init()
Project: RefreshActionItem
File: BadgeView.java
File: BadgeView.java
private void init(Context context, View target, int tabIndex) { this.context = context; this.target = target; this.targetTabIndex = tabIndex; // apply defaults badgePosition = DEFAULT_POSITION; badgeMarginH = dipToPixels(DEFAULT_MARGIN_DIP); badgeMarginV = badgeMarginH; badgeColor = DEFAULT_BADGE_COLOR; setTypeface(Typeface.DEFAULT_BOLD); int paddingPixels = dipToPixels(DEFAULT_LR_PADDING_DIP); setPadding(paddingPixels, 0, paddingPixels, 0); setTextColor(DEFAULT_TEXT_COLOR); fadeIn = new AlphaAnimation(0, 1); fadeIn.setInterpolator(new DecelerateInterpolator()); fadeIn.setDuration(200); fadeOut = new AlphaAnimation(1, 0); fadeOut.setInterpolator(new AccelerateInterpolator()); fadeOut.setDuration(200); isShown = false; if (this.target != null) { applyTo(this.target); } else { show(); } }
41. FadeAnimationUtil#fadeInAlpha()
Project: Munch
File: FadeAnimationUtil.java
File: FadeAnimationUtil.java
public void fadeInAlpha(View view, int durationInMillis) { view.setVisibility(View.INVISIBLE); AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1.0f); alphaAnimation.setDuration(durationInMillis); view.startAnimation(alphaAnimation); view.setVisibility(View.VISIBLE); }
42. MessageBar#init()
Project: MessageBar
File: MessageBar.java
File: MessageBar.java
private void init(View v) { mContainer = v.findViewById(R.id.mbContainer); mContainer.setVisibility(View.GONE); mTextView = (TextView) v.findViewById(R.id.mbMessage); mButton = (TextView) v.findViewById(R.id.mbButton); mButton.setOnClickListener(mButtonListener); mFadeInAnimation = new AlphaAnimation(0.0f, 1.0f); mFadeOutAnimation = new AlphaAnimation(1.0f, 0.0f); mFadeOutAnimation.setDuration(ANIMATION_DURATION); mFadeOutAnimation.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { Message nextMessage = mMessages.poll(); if (nextMessage != null) { show(nextMessage); } else { mCurrentMessage = null; mContainer.setVisibility(View.GONE); mShowing = false; } } @Override public void onAnimationRepeat(Animation animation) { } }); mHandler = new Handler(); }
43. MapZoomControls#fade()
Project: mapsforge
File: MapZoomControls.java
File: MapZoomControls.java
private void fade(int visibility, float startAlpha, float endAlpha) { AlphaAnimation anim = new AlphaAnimation(startAlpha, endAlpha); anim.setDuration(500); startAnimation(anim); setVisibility(visibility); }
44. Helper#animate()
Project: Blurry
File: Helper.java
File: Helper.java
public static void animate(View v, int duration) { AlphaAnimation alpha = new AlphaAnimation(0f, 1f); alpha.setDuration(duration); v.startAnimation(alpha); }
45. ShowFullScreenQrView#showPicFromPosition()
Project: bither-android
File: ShowFullScreenQrView.java
File: ShowFullScreenQrView.java
public void showPicFromPosition(final String content, final Bitmap placeHolder, final int x, final int y, final int width) { initView(); setVisibility(View.VISIBLE); iv.setVisibility(View.INVISIBLE); ivPlaceHolder.setImageBitmap(placeHolder); final int size = Math.min(screenHeight, screenWidth); new Thread() { public void run() { final Bitmap bmp = Qr.bitmap(content, size); post(new Runnable() { @Override public void run() { iv.setImageBitmap(bmp); iv.setVisibility(View.VISIBLE); } }); } ; }.start(); AlphaAnimation animAlpha = new AlphaAnimation(0, 1); animAlpha.setDuration(AnimationDuration); vMask.startAnimation(animAlpha); int toX = 0; int toY = (screenHeight - statusBarHeight - screenWidth) / 2 + statusBarHeight; int toWidth = UIUtil.getScreenWidth(); float scale = (float) width / (float) toWidth; ScaleAnimation animScale = new ScaleAnimation(scale, 1, scale, 1); animScale.setDuration(AnimationDuration); TranslateAnimation animTrans = new TranslateAnimation(x - toX, 0, y - toY, 0); animTrans.setDuration(AnimationDuration); AnimationSet animSet = new AnimationSet(true); animSet.setFillBefore(true); animSet.setDuration(AnimationDuration); animSet.addAnimation(animScale); animSet.addAnimation(animTrans); flImages.startAnimation(animSet); }
46. AnimationUtil#getAlphaAnimation()
Project: AndroidStudyDemo
File: AnimationUtil.java
File: AnimationUtil.java
/** * ??????????? * * @param fromAlpha ??????? * @param toAlpha ???????? * @param durationMillis ???? * @param animationListener ????? * @return ????????? */ public static AlphaAnimation getAlphaAnimation(float fromAlpha, float toAlpha, long durationMillis, AnimationListener animationListener) { AlphaAnimation alphaAnimation = new AlphaAnimation(fromAlpha, toAlpha); alphaAnimation.setDuration(durationMillis); if (animationListener != null) { alphaAnimation.setAnimationListener(animationListener); } return alphaAnimation; }
47. QuoteView#initAnimation()
Project: AndroidDemoProjects
File: QuoteView.java
File: QuoteView.java
private void initAnimation() { mFadeIn = new AlphaAnimation(0.0f, 1.0f); mFadeIn.setDuration(mFadeInTime); mFadeIn.setFillAfter(true); mFadeOut = new AlphaAnimation(1.0f, 0.0f); mFadeOut.setDuration(mFadeOutTime); mFadeOut.setFillAfter(true); mFadeOut.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { //Do nothing. } @Override public void onAnimationEnd(Animation animation) { displayQuote(); } @Override public void onAnimationRepeat(Animation animation) { //Do nothing. } }); }
48. BadgeView#init()
Project: android-viewbadger
File: BadgeView.java
File: BadgeView.java
private void init(Context context, View target, int tabIndex) { this.context = context; this.target = target; this.targetTabIndex = tabIndex; // apply defaults badgePosition = DEFAULT_POSITION; badgeMarginH = dipToPixels(DEFAULT_MARGIN_DIP); badgeMarginV = badgeMarginH; badgeColor = DEFAULT_BADGE_COLOR; setTypeface(Typeface.DEFAULT_BOLD); int paddingPixels = dipToPixels(DEFAULT_LR_PADDING_DIP); setPadding(paddingPixels, 0, paddingPixels, 0); setTextColor(DEFAULT_TEXT_COLOR); fadeIn = new AlphaAnimation(0, 1); fadeIn.setInterpolator(new DecelerateInterpolator()); fadeIn.setDuration(200); fadeOut = new AlphaAnimation(1, 0); fadeOut.setInterpolator(new AccelerateInterpolator()); fadeOut.setDuration(200); isShown = false; if (this.target != null) { applyTo(this.target); } else { show(); } }
49. PlayerPageFragment#onCreateView()
Project: Android-Remote
File: PlayerPageFragment.java
File: PlayerPageFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_player_control, container, false); // Get the Views mTvArtist = (TextView) view.findViewById(R.id.tvArtist); mTvTitle = (TextView) view.findViewById(R.id.tvTitle); mTvAlbum = (TextView) view.findViewById(R.id.tvAlbum); mTvGenre = (TextView) view.findViewById(R.id.tvGenre); mTvYear = (TextView) view.findViewById(R.id.tvYear); mTvLength = (TextView) view.findViewById(R.id.tvLength); mSbPosition = (SeekBar) view.findViewById(R.id.sbPosition); mImgArt = (ImageView) view.findViewById(R.id.imgArt); mImgArt.setOnClickListener(oclControl); mSbPosition.setOnSeekBarChangeListener(onSeekBarChanged); // Animation for track change mAlphaDown = new AlphaAnimation(1.0f, 0.0f); mAlphaUp = new AlphaAnimation(0.0f, 1.0f); mAlphaDown.setDuration(ANIMATION_DURATION); mAlphaUp.setDuration(ANIMATION_DURATION); mAlphaDown.setFillAfter(true); mAlphaUp.setFillAfter(true); mAlphaUp.setAnimationListener(mAnimationListener); mAlphaDown.setAnimationListener(mAnimationListener); mAlphaDown.setInterpolator(new AccelerateInterpolator()); mAlphaUp.setInterpolator(new AccelerateInterpolator()); // Initialize interface updateTrackMetadata(); updateTrackPosition(); return view; }
50. ConnectActivity#initializeUi()
Project: Android-Remote
File: ConnectActivity.java
File: ConnectActivity.java
private void initializeUi() { setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); // Get the Layoutelements mBtnConnect = (Button) findViewById(R.id.btnConnect); mBtnConnect.setOnClickListener(oclConnect); mBtnConnect.requestFocus(); mBtnClementine = (ImageButton) findViewById(R.id.btnClementineIcon); mBtnClementine.setOnClickListener(oclClementine); // Setup the animation for the Clementine icon mAlphaDown = new AlphaAnimation(1.0f, 0.3f); mAlphaUp = new AlphaAnimation(0.3f, 1.0f); mAlphaDown.setDuration(ANIMATION_DURATION); mAlphaUp.setDuration(ANIMATION_DURATION); mAlphaDown.setFillAfter(true); mAlphaUp.setFillAfter(true); mAlphaUp.setAnimationListener(mAnimationListener); mAlphaDown.setAnimationListener(mAnimationListener); mAnimationCancel = false; // Ip and Autoconnect mEtIp = (AutoCompleteTextView) findViewById(R.id.etIp); mEtIp.setRawInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); mEtIp.setThreshold(3); // Get old ip and auto-connect from shared prefences mEtIp.setText(mSharedPref.getString(SharedPreferencesKeys.SP_KEY_IP, "")); mEtIp.setSelection(mEtIp.length()); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.select_dialog_item, mKnownIps.toArray(new String[0])); mEtIp.setAdapter(adapter); // Get the last auth code mAuthCode = mSharedPref.getInt(SharedPreferencesKeys.SP_LAST_AUTH_CODE, 0); }
51. BootstrapAlert#setupAnimations()
Project: Android-Bootstrap
File: BootstrapAlert.java
File: BootstrapAlert.java
private void setupAnimations() { fadeInAnimation = new AlphaAnimation(0.0f, 1.0f); fadeInAnimation.setDuration(300); fadeInAnimation.setInterpolator(new AccelerateInterpolator()); fadeInAnimation.setAnimationListener(this); fadeOutAnimation = new AlphaAnimation(1.0f, 0.0f); fadeOutAnimation.setDuration(300); fadeOutAnimation.setInterpolator(new AccelerateInterpolator()); fadeOutAnimation.setAnimationListener(this); }
52. AnimationActivity#onFadeOut()
Project: kstyle
File: AnimationActivity.java
File: AnimationActivity.java
public void onFadeOut(View view) { AlphaAnimation animation = (AlphaAnimation) AnimationUtils.loadAnimation(this, R.anim.fade_out); view.startAnimation(animation); }
53. AnimationActivity#onFadeIn()
Project: kstyle
File: AnimationActivity.java
File: AnimationActivity.java
public void onFadeIn(View view) { AlphaAnimation animation = (AlphaAnimation) AnimationUtils.loadAnimation(this, R.anim.fade_in); view.startAnimation(animation); }