View startAnimation - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for View startAnimation method.

This code example shows how to use the following methods:clearAnimation, getAnimation, getContext, getTag, setTag
 
    ImageView view = getView();
    if (view == null)
      return; 
 
    if (!equals(view.getTag()))
      return; 
 
    view.setTag(null);
    if (result != null) {
      if (fadeIn && view.getAnimation() == null)
        view.startAnimation(AnimationUtils.loadAnimation(view.getContext(),
            android.R.anim.fade_in));
      view.setImageBitmap(result);
    } else { 
      view.setImageDrawable(null);
      view.clearAnimation();
    } 
  } 
} 

8
CodeRank
This code example shows how to use the following methods:setVisibility, startAnimation
            return; 
        } 
        mListShown = shown;
        if (shown) {
            if (animate) {
                mList.startAnimation(AnimationUtils.loadAnimation(
                        getActivity(), android.R.anim.fade_in));
            } 
            mList.setVisibility(View.VISIBLE);
        } else { 
            if (animate) {
                mList.startAnimation(AnimationUtils.loadAnimation(
                        getActivity(), android.R.anim.fade_out));
            } 
            mList.setVisibility(View.GONE);
        } 
    } 
 
    /** 
     * Get the ListAdapter associated with this activity's ListView. 
8
CodeRank
This code example shows how to use the following methods:getAnimation, startAnimation, setImageBitmap
	public Context getContext() {
		return imageView.getContext();
	} 
 
	public void setBitmap(Bitmap bitmap) {
		imageView.setImageBitmap(bitmap);
 
        stopExistingAnimation(); 
        if (animation != null) {
            imageView.startAnimation(animation);
        } 
	} 
 
    private void stopExistingAnimation() { 
        Animation old = imageView.getAnimation();
        if (old != null && !old.hasEnded()) {
            old.cancel();
        } 
    } 
 
8
CodeRank
This code example shows how to use the following methods:getVisibility, setVisibility, startAnimation
		if (!(mCurrentVisibleFragment instanceof RefreshScrollTopInterface)) return;
		((RefreshScrollTopInterface) mCurrentVisibleFragment).scrollToTop();
	} 
 
	public void showIndicator() { 
		if (mIndicator.getVisibility() == View.VISIBLE) return;
		mIndicator.setVisibility(View.VISIBLE);
		mIndicator.startAnimation(AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_in));
	} 
 
	@Override 
	public void triggerRefresh() { 
		if (!(mCurrentVisibleFragment instanceof RefreshScrollTopInterface)) return;
		((RefreshScrollTopInterface) mCurrentVisibleFragment).triggerRefresh();
	} 
 
} 
7
CodeRank
This code example shows how to use the following methods:getVisibility, setEnabled, setVisibility, startAnimation
     * @param startAlpha 
     * @param endAlpha 
     * @param duration 
     */ 
    public static void fadeIn(View view, float startAlpha, float endAlpha, long duration) {
        if (view.getVisibility() == View.VISIBLE) return;
 
        view.setVisibility(View.VISIBLE);
        Animation animation = new AlphaAnimation(startAlpha, endAlpha);
        animation.setDuration(duration);
        view.startAnimation(animation);
    } 
 
    /** 
     * Fade in a view with the default time 
     * @param view 
     */ 
    public static void fadeIn(View view) {
        fadeIn(view, 0F, 1F, 400);
 

7
CodeRank
This code example shows how to use the following methods:getVisibility, setVisibility, startAnimation
        mRotateDialogButton2.setVisibility(View.GONE);
        mRotateDialogButtonLayout.setVisibility(View.GONE);
    } 
 
    private void fadeOutDialog() { 
        mDialogRootLayout.startAnimation(mFadeOutAnim);
        mDialogRootLayout.setVisibility(View.GONE);
    } 
 
    private void fadeInDialog() { 
        mDialogRootLayout.startAnimation(mFadeInAnim);
        mDialogRootLayout.setVisibility(View.VISIBLE);
    } 
 
    public void dismissDialog() { 
        if (mDialogRootLayout != null && mDialogRootLayout.getVisibility() != View.GONE) {
            fadeOutDialog(); 
        } 
    } 
 
    public void showAlertDialog(String title, String msg, String button1Text,
7
CodeRank
This code example shows how to use the following methods:startAnimation
This code example shows how to use the following methods:getHeight, getWidth, startAnimation
This code example shows how to use the following methods:getAnimation, getHeight, getWidth, startAnimation
		m_icon = (ImageView)this.findViewById(R.id.refreshBtn);
		 
	} 
 
	public void startRefresh() { 
		if (m_icon.getAnimation() != null && !m_icon.getAnimation().hasEnded()) {
			return; 
		} 
		float centerX = m_icon.getWidth()/2.0f;
		float centerY = m_icon.getHeight()/2.0f;
 
		RotateAnimation ra = new RotateAnimation(0, 360, centerX, centerY);
		ra.setDuration(1000);
		ra.setRepeatCount(-1);
		ra.setInterpolator(new LinearInterpolator());
		this.m_icon.startAnimation(ra);
	} 
	 
	public void endRefresh() { 
		this.m_icon.clearAnimation();
	} 
7
CodeRank
This code example shows how to use the following methods:startAnimation
 
    public static void startFadeOverToImage(final ImageView view, final int toImageRes, final long durationMillis,
        final Activity activity) {
        Animation fadeOut = AnimationUtils.loadAnimation(activity, android.R.anim.fade_out);
        fadeOut.setDuration(durationMillis);
        fadeOut.setAnimationListener(new AnimationListener() {
            public void onAnimationStart(Animation animation) {
            } 
 
            public void onAnimationRepeat(Animation animation) {
            } 
 
            public void onAnimationEnd(Animation animation) {
                view.setImageResource(toImageRes);
                Animation fadeIn = AnimationUtils.loadAnimation(activity, android.R.anim.fade_in);
                fadeIn.setDuration(durationMillis);
                view.startAnimation(fadeIn);
            } 
        }); 
        view.startAnimation(fadeOut);

7
CodeRank

Related View startAnimation Questions & Answers:

Other View startAnimation Examples

42:					
43:					// start the animation
44:					txtMessage.startAnimation(animFadein);
45:				}
46:			});

Read More

startAnimation Method Overview
Start the specified animation now.
See Code Examples for other Android View Methods: