|
@@ -1,8 +1,11 @@
|
1
|
1
|
package com.reactnativenavigation;
|
2
|
2
|
|
3
|
3
|
import android.app.Application;
|
|
4
|
+import android.content.Intent;
|
|
5
|
+import android.os.Bundle;
|
4
|
6
|
import android.os.Handler;
|
5
|
7
|
import android.support.annotation.Nullable;
|
|
8
|
+import android.support.v4.app.ActivityOptionsCompat;
|
6
|
9
|
|
7
|
10
|
import com.facebook.react.ReactApplication;
|
8
|
11
|
import com.facebook.react.ReactNativeHost;
|
|
@@ -34,6 +37,20 @@ public abstract class NavigationApplication extends Application implements React
|
34
|
37
|
activityCallbacks = new ActivityCallbacks();
|
35
|
38
|
}
|
36
|
39
|
|
|
40
|
+ @Override
|
|
41
|
+ public void startActivity(Intent intent) {
|
|
42
|
+ String animationType = intent.getStringExtra("animationType");
|
|
43
|
+ if (animationType != null && animationType.equals("fade")) {
|
|
44
|
+ Bundle bundle = ActivityOptionsCompat.makeCustomAnimation(getApplicationContext(),
|
|
45
|
+ android.R.anim.fade_in,
|
|
46
|
+ android.R.anim.fade_out
|
|
47
|
+ ).toBundle();
|
|
48
|
+ super.startActivity(intent, bundle);
|
|
49
|
+ } else {
|
|
50
|
+ super.startActivity(intent);
|
|
51
|
+ }
|
|
52
|
+ }
|
|
53
|
+
|
37
|
54
|
public void startReactContextOnceInBackgroundAndExecuteJS() {
|
38
|
55
|
reactGateway.startReactContextOnceInBackgroundAndExecuteJS();
|
39
|
56
|
}
|