Skip to content

Commit

Permalink
添加转场动画
Browse files Browse the repository at this point in the history
  • Loading branch information
cleven1 committed Apr 28, 2019
1 parent 6cc0517 commit d351994
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ public void onAnimationEnd(Animation animation) {
if (CLUserManager.getInstence().getUserInfo() == null){
Intent intent = new Intent(SplashActivity.this,CLLoginActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.cl_fade_in,R.anim.cl_fade_out);
}else {
Intent intent = new Intent(SplashActivity.this,MainActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.cl_fade_in,R.anim.cl_fade_out);
}
finish();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public void onSuccess(Map response) {

Activity activity = (Activity) CLProfileFragment.this.mContext;
activity.finish();
activity.overridePendingTransition(R.anim.cl_fade_in,R.anim.cl_fade_out);

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public void onSuccess(Response<String> response) {
CLUserManager.getInstence().setUserInfo(userBean);
Intent intent = new Intent(CLLoginActivity.this,MainActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.cl_fade_in,R.anim.cl_fade_out);
CLHUDUtil.hideHUD();
finish();
}else {
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/anim/cl_fade_in.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:duration="300"
android:fromAlpha="0.0"
android:toAlpha="1.0"/>
</set>
6 changes: 6 additions & 0 deletions app/src/main/res/anim/cl_fade_out.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:fromAlpha="1.0"
android:toAlpha="0.0"
android:duration="300"/>
</set>

0 comments on commit d351994

Please sign in to comment.