Skip to content

Commit

Permalink
Add in and out
Browse files Browse the repository at this point in the history
  • Loading branch information
s-praveen-kumar committed Jan 13, 2018
1 parent 2bea014 commit 16f1cbf
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ protected void onCreate(Bundle savedInstanceState) {

public void startActivity(View v){
startActivity(new Intent(this,SecondActivity.class));
Bungee.card(this);
Bungee.inAndOut(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,8 @@ public static void shrink(Context context) {
public static void card(Context context) {
((Activity) context).overridePendingTransition(R.anim.card_enter, R.anim.card_exit);
}

public static void inAndOut(Context context) {
((Activity) context).overridePendingTransition(R.anim.in_out_enter, R.anim.in_out_exit);
}
}
17 changes: 17 additions & 0 deletions bungeelib/src/main/res/anim/in_out_enter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_mediumAnimTime">
<translate
android:fromXDelta="1000"
android:toXDelta="0" />
<scale
android:fromXScale="0.5"
android:fromYScale="0.5"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1"
android:toYScale="1" />
<alpha
android:fromAlpha="0.5"
android:toAlpha="1.0" />
</set>
17 changes: 17 additions & 0 deletions bungeelib/src/main/res/anim/in_out_exit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_mediumAnimTime">
<translate
android:fromXDelta="0"
android:toXDelta="-1000" />
<scale
android:fromXScale="1.0"
android:fromYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="0.5"
android:toYScale="0.5" />
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.5" />
</set>

0 comments on commit 16f1cbf

Please sign in to comment.