DCWelcomeFragment.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:aftercare-app-android 作者:
@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;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号