Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 0bfde78

Browse files
Sam1301kunall17
authored andcommitted
Add default activity transition class ActivityTransitionAnim.
1 parent 0b729ef commit 0bfde78

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.zulip.android.util;
2+
3+
import android.app.Activity;
4+
import android.content.Context;
5+
6+
/**
7+
* Default Activity transition animation.
8+
*/
9+
10+
public class ActivityTransitionAnim {
11+
/**
12+
* All usages must pass an activity context to execute a transition.
13+
*
14+
* @param activityContext {@link Context}
15+
*/
16+
public static void transition(Context activityContext) {
17+
// avoid invalid class cast exception
18+
if (activityContext instanceof Activity) {
19+
((Activity) activityContext).overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)