Java 类android.view.animation.AlphaAnimation 实例源码

项目:Pocket-Plays-for-Twitch    文件:AnimationService.java   
public static void setAdapterInsertAnimation(final View aCard, int row, int height) {
    final int ANIMATION_DURATION = 650;
    final int BASE_DELAY = 50;

    TranslateAnimation translationAnimation = new TranslateAnimation(0,0, height,0);

    AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f);

    final AnimationSet animationSet = new AnimationSet(true);
    animationSet.addAnimation(translationAnimation);
    animationSet.addAnimation(alphaAnimation);
    animationSet.setInterpolator(new AccelerateDecelerateInterpolator());
    animationSet.setFillAfter(true);
    animationSet.setFillBefore(true);
    animationSet.setDuration(ANIMATION_DURATION + row * BASE_DELAY);

    aCard.setAnimation(animationSet);
}
项目:YMenuView    文件:Circle8YMenu.java   
@Override
public Animation createOptionShowAnimation(OptionButton optionButton, int index) {
    AnimationSet animationSet = new AnimationSet(true);
    TranslateAnimation translateAnimation= new TranslateAnimation(
            getYMenuButton().getX() - optionButton.getX()
            ,0
            ,getYMenuButton().getY() - optionButton.getY()
            ,0);
    translateAnimation.setDuration(getOptionSD_AnimationDuration());
    AlphaAnimation alphaAnimation = new AlphaAnimation(0,1);
    alphaAnimation.setDuration(getOptionSD_AnimationDuration());
    animationSet.addAnimation(alphaAnimation);
    animationSet.addAnimation(translateAnimation);
    //为不同的Option设置延时
    if (index % 2 == 1) {
        animationSet.setStartOffset(getOptionSD_AnimationDuration()/2);
    }
    return animationSet;
}
项目:GitHub    文件:ViewHolder.java   
@SuppressLint("NewApi")
public ViewHolder setAlpha(int viewId, float value)
{
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
    {
        getView(viewId).setAlpha(value);
    } else
    {
        // Pre-honeycomb hack to set Alpha value
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
项目:GitHub    文件:ViewHolder.java   
@SuppressLint("NewApi")
public ViewHolder setAlpha(int viewId, float value)
{
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
    {
        getView(viewId).setAlpha(value);
    } else
    {
        // Pre-honeycomb hack to set Alpha value
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
项目:YMenuView    文件:TreeYMenu.java   
@Override
public Animation createOptionDisappearAnimation(OptionButton optionButton, int index) {

    AnimationSet animationSet = new AnimationSet(true);
    TranslateAnimation translateAnimation= new TranslateAnimation(
            0
            ,getYMenuButton().getX() - optionButton.getX()
            ,0
            ,getYMenuButton().getY() - optionButton.getY()
    );
    translateAnimation.setDuration(getOptionSD_AnimationDuration());
    AlphaAnimation alphaAnimation = new AlphaAnimation(1,0);
    alphaAnimation.setDuration(getOptionSD_AnimationDuration());

    animationSet.addAnimation(translateAnimation);
    animationSet.addAnimation(alphaAnimation);
    //设置动画延时
    animationSet.setStartOffset(60*(getOptionPositionCount() - index));
    return animationSet;
}
项目:letv    文件:BottomRedPointView.java   
private void init(Context context, View target) {
    this.context = context;
    this.target = target;
    fadeIn = new AlphaAnimation(0.0f, 1.0f);
    fadeIn.setInterpolator(new DecelerateInterpolator());
    fadeIn.setDuration(200);
    fadeOut = new AlphaAnimation(1.0f, 0.0f);
    fadeOut.setInterpolator(new AccelerateInterpolator());
    fadeOut.setDuration(200);
    this.isShown = false;
    if (this.target != null) {
        applyTo(this.target);
    } else {
        show();
    }
}
项目:RLibrary    文件:UIIDialogImpl.java   
/**
 * 对话框结束时的动画
 */
@Override
public Animation loadFinishAnimation() {
    TranslateAnimation translateAnimation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0f,
            Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 1f);
    AlphaAnimation alphaAnimation = new AlphaAnimation(1, 0);
    setDefaultConfig(translateAnimation, true);
    setDefaultConfig(alphaAnimation, true);

    translateAnimation.setDuration(DEFAULT_DIALOG_FINISH_ANIM_TIME);
    alphaAnimation.setDuration(DEFAULT_DIALOG_FINISH_ANIM_TIME);

    AnimationSet animationSet = new AnimationSet(false);
    animationSet.addAnimation(alphaAnimation);
    animationSet.addAnimation(translateAnimation);
    return animationSet;
}
项目:BottomMenu    文件:BottomMenu.java   
private Animation scaleSmallAnim(int duration, final View child) {

        AnimationSet animationSet = new AnimationSet(true);

        ScaleAnimation scaleAnim = new ScaleAnimation(1.0f, 0.0f, 1.0f, 0.0f,
                Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
                0.5f);
        AlphaAnimation alphaAnim = new AlphaAnimation(1f, 0.0f);
        alphaAnim.setFillAfter(true);
        animationSet.addAnimation(scaleAnim);
        animationSet.addAnimation(alphaAnim);
        animationSet.setDuration(duration);

        return animationSet;

    }
项目:AndroidBasicLibs    文件:DrawerToast.java   
/**
 * 获得离场动画
 *
 * @return
 */
protected Animation getEndAnimation() {
    AlphaAnimation animAlpha = new AlphaAnimation(1, 0);
    animAlpha.setDuration(TIME_END_ANIM);
    animAlpha.setFillAfter(true);

    TranslateAnimation animTrans = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0f,
            Animation.RELATIVE_TO_PARENT, -1.5f,
            Animation.RELATIVE_TO_PARENT, 0f,
            Animation.RELATIVE_TO_PARENT, 0f);
    animTrans.setDuration(TIME_END_ANIM);
    animTrans.setFillAfter(true);
    animTrans.setInterpolator(new AccelerateInterpolator());

    AnimationSet sets = new AnimationSet(true);
    sets.addAnimation(animAlpha);
    sets.addAnimation(animTrans);

    return sets;
}
项目:QMUI_Android    文件:QMUIBottomSheet.java   
/**
 * BottomSheet升起动画
 */
private void animateUp() {
    if (mContentView == null) {
        return;
    }
    TranslateAnimation translate = new TranslateAnimation(
            Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f,
            Animation.RELATIVE_TO_SELF, 1f, Animation.RELATIVE_TO_SELF, 0f
    );
    AlphaAnimation alpha = new AlphaAnimation(0, 1);
    AnimationSet set = new AnimationSet(true);
    set.addAnimation(translate);
    set.addAnimation(alpha);
    set.setInterpolator(new DecelerateInterpolator());
    set.setDuration(mAnimationDuration);
    set.setFillAfter(true);
    mContentView.startAnimation(set);
}
项目:Nimbus    文件:CoreTeamEventActivity.java   
public static void startAlphaAnimation(View v, long duration, int visibility) {
    AlphaAnimation alphaAnimation = (visibility == View.VISIBLE)
            ? new AlphaAnimation(0f, 1f)
            : new AlphaAnimation(1f, 0f);

    alphaAnimation.setDuration(duration);
    alphaAnimation.setFillAfter(true);
    v.startAnimation(alphaAnimation);
}
项目:buildAPKsSamples    文件:ListViewItemAnimations.java   
/**
 * Sets the horizontal position and translucency of the view being swiped.
 */
@SuppressLint("NewApi")
private void setSwipePosition(View view, float deltaX) {
    float fraction = Math.abs(deltaX) / view.getWidth();
    if (isRuntimePostGingerbread()) {
        view.setTranslationX(deltaX);
        view.setAlpha(1 - fraction);
    } else {
        // Hello, Gingerbread!
        TranslateAnimation swipeAnim = new TranslateAnimation(deltaX, deltaX, 0, 0);
        mCurrentX = deltaX;
        mCurrentAlpha = (1 - fraction);
        AlphaAnimation alphaAnim = new AlphaAnimation(mCurrentAlpha, mCurrentAlpha);
        AnimationSet set = new AnimationSet(true);
        set.addAnimation(swipeAnim);
        set.addAnimation(alphaAnim);
        set.setFillAfter(true);
        set.setFillEnabled(true);
        view.startAnimation(set);
    }
}
项目:RealmTasks    文件:ItemViewHolder.java   
void setHintPanelVisible(boolean visible)
{
    final int visibility = hintPanel.getVisibility();
    boolean previousVisible = visibility == View.VISIBLE;
    if (previousVisible == visible)
    {
        return;
    }
    if (visible)
    {
        hintPanel.setVisibility(View.VISIBLE);
        final AlphaAnimation alphaAnimation = new AlphaAnimation(0.2f, 1.0f);
        alphaAnimation.setDuration(150);
        hintPanel.setAnimation(alphaAnimation);
        final RotateAnimation rotateAnimation = new RotateAnimation(
                -90, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
        rotateAnimation.setDuration(500);
        arrow.startAnimation(rotateAnimation);
    }
    else
    {
        hintPanel.setVisibility(View.GONE);
    }
}
项目:showroom-android    文件:ItemsCountView.java   
private Animation createPositionAnimation(int fromY, int toY, float fromAlpha, float toAlpha, int duration) {
    TranslateAnimation translate = new TranslateAnimation(0, 0, fromY, toY);
    translate.setDuration(duration);

    AlphaAnimation alpha = new AlphaAnimation(fromAlpha, toAlpha);
    alpha.setDuration(duration);

    AnimationSet set = new AnimationSet(true);
    set.setInterpolator(new DecelerateInterpolator());
    set.addAnimation(translate);
    set.addAnimation(alpha);
    return set;
}
项目:GitHub    文件:BaseAdapterHelper.java   
/**
 * Add an action to set the alpha of a view. Can be called multiple times.
 * Alpha between 0-1.
 * 设置控件的显示的透明度
 */
public BaseAdapterHelper setAlpha(int viewId, float value) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        retrieveView(viewId).setAlpha(value);
    } else {
        // Pre-honeycomb hack to set Alpha value
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        retrieveView(viewId).startAnimation(alpha);
    }
    return this;
}
项目:RLibrary    文件:UIIDialogImpl.java   
/**
 * 对话框启动时的动画
 */
@Override
public Animation loadStartAnimation() {
    TranslateAnimation translateAnimation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0,
            Animation.RELATIVE_TO_SELF, 1f, Animation.RELATIVE_TO_SELF, 0f);
    AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1);
    setDefaultConfig(translateAnimation, false);
    setDefaultConfig(alphaAnimation, false);

    AnimationSet animationSet = new AnimationSet(false);
    animationSet.addAnimation(alphaAnimation);
    animationSet.addAnimation(translateAnimation);
    return animationSet;
}
项目:GitHub    文件:SimpleActivity.java   
@Override public void apply(@NonNull View view, int index) {
  AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1);
  alphaAnimation.setFillBefore(true);
  alphaAnimation.setDuration(500);
  alphaAnimation.setStartOffset(index * 100);
  view.startAnimation(alphaAnimation);
}
项目:GitHub    文件:FlashActivity.java   
@Bus(EventTags.FLASH_INIT_UI)
public void initUI() {
    AlphaAnimation anim = new AlphaAnimation(0.8f, 0.1f);
    anim.setDuration(5000);
    mViewBinding.view.startAnimation(anim);
    AnimationUtil.setAnimationListener(anim, () -> OkBus.getInstance().onEvent(EventTags.JUMP_TO_MAIN));
}
项目:GitHub    文件:BaseViewHolder.java   
/**
 * Add an action to set the alpha of a view. Can be called multiple times.
 * Alpha between 0-1.
 */
public BaseViewHolder setAlpha(int viewId, float value) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getView(viewId).setAlpha(value);
    } else {
        // Pre-honeycomb hack to set Alpha value
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
项目:GitHub    文件:EasyRVHolder.java   
@Override
public EasyRVHolder setAlpha(int viewId, float value) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getView(viewId).setAlpha(value);
    } else {
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
项目:JueDiQiuSheng    文件:SplashActivity.java   
private void btnAlpha(View view,long duration) {
    //透明度动画 public AlphaAnimation(float fromAlpha, float toAlpha){}
    AlphaAnimation aa = new AlphaAnimation(0, 1);
    //持续时间
    aa.setDuration(duration);
    view.startAnimation(aa);
}
项目:SDCardCleaner    文件:MainActivity.java   
private AnimationSet createQuitAnimation(View _view, long _offSet) {
    AnimationSet _set = new AnimationSet(true);

    _set.addAnimation(new AlphaAnimation(1, 0));
    _set.addAnimation(new ScaleAnimation(1, 2, 1, 2));
    _set.addAnimation(new TranslateAnimation(0, -_view.getWidth() / 2, 0, -_view.getHeight() / 2));

    _set.setDuration(150);
    _set.setStartOffset(_offSet);
    _set.setFillAfter(true);
    return _set;
}
项目:GitHub    文件:BaseViewHolder.java   
/**
 * Add an action to set the alpha of a view. Can be called multiple times.
 * Alpha between 0-1.
 */
public BaseViewHolder setAlpha(int viewId, float value) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getView(viewId).setAlpha(value);
    } else {
        // Pre-honeycomb hack to set Alpha value
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
项目:WelcomeView    文件:WelcomeUtil.java   
public static void open(final Activity activity, String imageUrl, final OnWelcomeDone onWelcomeDone) {
    activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
    final View welcome = LayoutInflater.from(activity).inflate(R.layout.welcome, null);
    final AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
    alphaAnimation.setDuration(1000);
    welcome.startAnimation(alphaAnimation);
    Glide.with(activity).load(imageUrl).into(((ImageView) welcome.findViewById(R.id.iv_welcome)));
    activity.setContentView(welcome);
    final TextView skipView = (TextView) welcome.findViewById(R.id.tv_skip);

    final CountDownTimer start = new CountDownTimer(5000, 1000) {
        @Override
        public void onTick(long millisUntilFinished) {
            skipView.setText("跳过" + ((millisUntilFinished / 1000) - 1));
        }

        @Override
        public void onFinish() {
            AlphaAnimation alphaAnimation1 = new AlphaAnimation(1.0f, 0.0f);
            alphaAnimation1.setDuration(1000);
            welcome.startAnimation(alphaAnimation1);
            if (onWelcomeDone != null) {
                onWelcomeDone.onDone();
            }
        }
    }.start();
    skipView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            start.onFinish();
        }
    });

}
项目:letv    文件:FragmentManagerImpl.java   
static boolean modifiesAlpha(Animation anim) {
    if (anim instanceof AlphaAnimation) {
        return true;
    }
    if (anim instanceof AnimationSet) {
        List<Animation> anims = ((AnimationSet) anim).getAnimations();
        for (int i = 0; i < anims.size(); i++) {
            if (anims.get(i) instanceof AlphaAnimation) {
                return true;
            }
        }
    }
    return false;
}
项目:GitHub    文件:BaseViewHolder.java   
/**
 * Add an action to set the alpha of a view. Can be called multiple times.
 * Alpha between 0-1.
 */
public BaseViewHolder setAlpha(@IdRes int viewId, float value) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getView(viewId).setAlpha(value);
    } else {
        // Pre-honeycomb hack to set Alpha value
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
项目:MVPtemplate    文件:ViewHolderHelper.java   
@SuppressLint("NewApi")
public ViewHolderHelper setAlpha(int viewId, float value) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getView(viewId).setAlpha(value);
    } else {
        // Pre-honeycomb hack to set Alpha value
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
项目:Pocket-Plays-for-Twitch    文件:AnimationService.java   
/**
 * For the Card Views
 */
public static AnimationSet startAlphaRevealAnimation(int delay, final View VIEW, boolean includeTransition) {
    final int ANIMATION_DURATION = 300;

    final Animation mAlphaAnimation = new AlphaAnimation(0f, 1f);
    mAlphaAnimation.setDuration(ANIMATION_DURATION);
    mAlphaAnimation.setFillAfter(true);

    final AnimationSet mRevealAnimations = new AnimationSet(true);
    mRevealAnimations.setInterpolator(new AccelerateDecelerateInterpolator());
    mRevealAnimations.addAnimation(mAlphaAnimation);
    mRevealAnimations.setFillAfter(true);

    if (includeTransition) {
        final Animation mTransitionAnimation = new TranslateAnimation(0, 0, VIEW.getHeight()/2, 0);
        mTransitionAnimation.setDuration(ANIMATION_DURATION);
        mTransitionAnimation.setFillAfter(false);

        mRevealAnimations.addAnimation(mTransitionAnimation);
    }

    new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
               if(VIEW != null)
                VIEW.startAnimation(mRevealAnimations);
        }
    }, delay);

    return mRevealAnimations;
}
项目:QMark    文件:WelcomeSnowActy.java   
private AlphaAnimation startAlpha() {
    AlphaAnimation alpha = new AlphaAnimation(0, 1);
    alpha.setInterpolator(this, android.R.anim.accelerate_interpolator);
    alpha.setStartOffset(0);
    alpha.setDuration(1500);
    return alpha;
}
项目:QActionSheet    文件:QActionSheet.java   
@Override
public void show() {
    super.show();
    getWindow().setContentView(mParent);

    AlphaAnimation anim = new AlphaAnimation(0, 1);
    anim.setDuration(ANIMATION_DURATION);
    mMaskView.setAnimation(anim);

    int type = TranslateAnimation.RELATIVE_TO_SELF;
    TranslateAnimation anim2 = new TranslateAnimation(type, 0, type, 0, type, 1, type, 0);
    anim2.setDuration(ANIMATION_DURATION);
    mPanel.setAnimation(anim2);
}
项目:Nimbus    文件:TeamEventActivity.java   
public static void startAlphaAnimation(View v, long duration, int visibility) {
    AlphaAnimation alphaAnimation = (visibility == View.VISIBLE)
            ? new AlphaAnimation(0f, 1f)
            : new AlphaAnimation(1f, 0f);

    alphaAnimation.setDuration(duration);
    alphaAnimation.setFillAfter(true);
    v.startAnimation(alphaAnimation);
}
项目:mapbox-navigation-android    文件:AlertView.java   
private void initAnimations() {
  fadeOut = new AlphaAnimation(1, 0);
  fadeOut.setInterpolator(new AccelerateInterpolator());
  fadeOut.setDuration(300);
  slideDownTop = AnimationUtils.loadAnimation(getContext(), R.anim.slide_down_top);
  slideDownTop.setInterpolator(new OvershootInterpolator(2.0f));
}
项目:OSchina_resources_android    文件: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;
}
项目:aftercare-app-android    文件:DCWelcomeFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstance) {
    View view = inflater.inflate(R.layout.fragment_welcome, container, false);
    sdvWelcomeAvatar = (SimpleDraweeView) view.findViewById(R.id.sdv_welcome_avatar);
    tvWelcome = (DCTextView) view.findViewById(R.id.tv_welcome);
    tvWelcomeName = (DCTextView) view.findViewById(R.id.tv_welcome_name);

    Resources r = getResources();
    float translationPx = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 100, r.getDisplayMetrics());

    AlphaAnimation avatarAnimation = new AlphaAnimation(0, 1);
    avatarAnimation.setDuration(2500);
    sdvWelcomeAvatar.startAnimation(avatarAnimation);

    TranslateAnimation welcomeAnimationTranslate = new TranslateAnimation(0, 0, translationPx, 0);
    welcomeAnimationTranslate.setDuration(1500);
    AlphaAnimation welcomeAnimationAlpha = new AlphaAnimation(0, 1);
    welcomeAnimationAlpha.setDuration(1500);

    AnimationSet welcomeAnimation = new AnimationSet(true);
    welcomeAnimation.addAnimation(welcomeAnimationAlpha);
    welcomeAnimation.addAnimation(welcomeAnimationTranslate);
    tvWelcome.startAnimation(welcomeAnimation);

    AlphaAnimation welcomeAnimationName = new AlphaAnimation(0, 1);
    welcomeAnimationName.setDuration(3000);
    tvWelcomeName.startAnimation(welcomeAnimationName);

    loadUser();

    DCSharedPreferences.saveBoolean(DCSharedPreferences.DCSharedKey.WELCOME_SCREEN, true);
    return view;
}
项目:aftercare-app-android    文件:DCLoginFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstance) {
    View view = inflater.inflate(R.layout.fragment_login, container, false);

    ivLoginLogo = (ImageView) view.findViewById(R.id.iv_login_logo);

    Resources r = getResources();
    float translationPx = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 100, r.getDisplayMetrics());

    AlphaAnimation logoAlphaAnimation = new AlphaAnimation(0, 1);
    logoAlphaAnimation.setDuration(500);

    TranslateAnimation logoTranslateAnimation = new TranslateAnimation(0, 0, translationPx, 0);
    logoTranslateAnimation.setDuration(500);

    AnimationSet logoAnimationSet = new AnimationSet(true);
    logoAnimationSet.addAnimation(logoAlphaAnimation);
    logoAnimationSet.addAnimation(logoTranslateAnimation);

    ivLoginLogo.startAnimation(logoAnimationSet);

    btnLoginFacebook = (DCButton) view.findViewById(R.id.btn_login_facebook);
    btnLoginFacebook.setOnClickListener(this);

    btnLoginGoogle = (DCButton) view.findViewById(R.id.btn_login_google);
    btnLoginGoogle.setOnClickListener(this);

    btnLoginTwitter = (DCButton) view.findViewById(R.id.btn_login_twitter);
    btnLoginTwitter.setOnClickListener(this);

    btnLogin = (DCButton) view.findViewById(R.id.btn_login_login);
    btnLogin.setOnClickListener(this);

    tilLoginEmail = (DCTextInputLayout) view.findViewById(R.id.til_login_email);
    tietLoginEmail = (DCTextInputEditText) view.findViewById(R.id.tiet_login_email);
    tietLoginEmail.setOnFocusChangeListener(this);

    tilLoginPassword = (DCTextInputLayout) view.findViewById(R.id.til_login_password);
    tietLoginPassword = (DCTextInputEditText) view.findViewById(R.id.tiet_login_password);

    tvLoginForgotPassword = (DCTextView) view.findViewById(R.id.tv_login_forgot_password);
    tvLoginForgotPassword.setOnClickListener(this);

    return view;
}
项目:aftercare-app-android    文件:DCRoutineCompletedFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.fragment_routine_completed, container);
    fbShare = (ShareButton) view.findViewById(R.id.fb_share);
    tvMessage = (DCTextView) view.findViewById(R.id.tv_message);
    tvCompleted = (DCTextView) view.findViewById(R.id.tv_completed);
    ivTooth = (ImageView) view.findViewById(R.id.iv_tooth);

    if (getArguments() != null) {
        final Routine.Type routineType = (Routine.Type)getArguments().getSerializable(KEY_ROUTINE_TYPE);

        if (routineType != null) {
            AudibleMessage audibleMessage;
            String shareLinkMessage;

            switch (routineType) {
                case MORNING:
                    shareLinkMessage = getString(R.string.fb_share_morning_routine_completed);
                    audibleMessage = AudibleMessage.MORNING_ROUTINE_END;
                    break;
                default:
                    shareLinkMessage = getString(R.string.fb_share_evening_routine_completed);
                    audibleMessage = AudibleMessage.EVENING_ROUTINE_END;
                    break;
            }

            tvMessage.setText(audibleMessage.getMessage(getActivity()));

            ShareLinkContent shareLinkContent = new ShareLinkContent.Builder()
                    .setContentUrl(Uri.parse(DCConstants.DENTACARE_GOOGLE_PLAY))
                    .setShareHashtag(new ShareHashtag.Builder()
                            .setHashtag("#dentacoin")
                            .build())
                    .setQuote(shareLinkMessage)
                    .build();

            fbShare.setShareContent(shareLinkContent);

            if (audibleMessage.getVoices() != null && audibleMessage.getVoices().length > 0) {
                DCSoundManager.getInstance().playVoice(getActivity(), audibleMessage.getVoices()[0]);
            }
        }
    }

    AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f);
    alphaAnimation.setDuration(1000);
    ivTooth.startAnimation(alphaAnimation);

    AlphaAnimation dayAlphaAnimation = new AlphaAnimation(0f, 1f);
    dayAlphaAnimation.setDuration(2000);
    tvCompleted.startAnimation(dayAlphaAnimation);

    AlphaAnimation alphaAnimationMessage = new AlphaAnimation(0f, 1f);
    alphaAnimationMessage.setDuration(1000);
    tvMessage.startAnimation(alphaAnimationMessage);

    return view;
}
项目:letv    文件:AlbumBaseControllerFragment.java   
protected void startBreath() {
    if (this.mVideoShotButton != null) {
        Animation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);
        alphaAnimation.setDuration(500);
        alphaAnimation.setInterpolator(new LinearInterpolator());
        alphaAnimation.setRepeatCount(-1);
        alphaAnimation.setRepeatMode(2);
        this.mVideoShotButton.startAnimation(alphaAnimation);
        this.mHandler.sendEmptyMessageDelayed(258, 10000);
    }
}
项目:social-app-android    文件:ExpandableTextView.java   
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private static void applyAlphaAnimation(View view, float alpha) {
    if (isPostHoneycomb()) {
        view.setAlpha(alpha);
    } else {
        AlphaAnimation alphaAnimation = new AlphaAnimation(alpha, alpha);
        // make it instant
        alphaAnimation.setDuration(0);
        alphaAnimation.setFillAfter(true);
        view.startAnimation(alphaAnimation);
    }
}
项目:MaterialChipsInput    文件:DetailedChipView.java   
/**
 * Fade out
 */
public void fadeOut() {
    AlphaAnimation anim = new AlphaAnimation(1.0f, 0.0f);
    anim.setDuration(200);
    startAnimation(anim);
    setVisibility(GONE);
    // fix onclick issue
    clearFocus();
    setClickable(false);
}
项目:UiLib    文件:ArcMenu.java   
private static Animation createItemDisapperAnimation(final long duration, final boolean isClicked) {
    AnimationSet animationSet = new AnimationSet(true);
    animationSet.addAnimation(new ScaleAnimation(1.0f, isClicked ? 2.0f : 0.0f, 1.0f, isClicked ? 2.0f : 0.0f,
            Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f));
    animationSet.addAnimation(new AlphaAnimation(1.0f, 0.0f));

    animationSet.setDuration(duration);
    animationSet.setInterpolator(new DecelerateInterpolator());
    animationSet.setFillAfter(true);

    return animationSet;
}