|
@@ -14,8 +14,8 @@ public abstract class SplashActivity extends AppCompatActivity {
|
14
|
14
|
@Override
|
15
|
15
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
16
|
16
|
super.onCreate(savedInstanceState);
|
17
|
|
- NavigationApplication.instance.startReactContext();
|
18
|
17
|
setSplashLayout();
|
|
18
|
+ NavigationApplication.instance.startReactContext();
|
19
|
19
|
}
|
20
|
20
|
|
21
|
21
|
private void setSplashLayout() {
|
|
@@ -23,19 +23,24 @@ public abstract class SplashActivity extends AppCompatActivity {
|
23
|
23
|
if (splashLayout > 0) {
|
24
|
24
|
setContentView(splashLayout);
|
25
|
25
|
} else {
|
26
|
|
- setDefaultSplashLayout();
|
|
26
|
+ setContentView(createSplashLayout());
|
27
|
27
|
}
|
28
|
28
|
}
|
29
|
29
|
|
30
|
|
- private void setDefaultSplashLayout() {
|
31
|
|
- View view = new View(this);
|
32
|
|
- view.setBackgroundColor(Color.WHITE);
|
33
|
|
- setContentView(view);
|
|
30
|
+ /**
|
|
31
|
+ * @return xml layout res id
|
|
32
|
+ */
|
|
33
|
+ @LayoutRes
|
|
34
|
+ public int getSplashLayout() {
|
|
35
|
+ return 0;
|
34
|
36
|
}
|
35
|
37
|
|
36
|
38
|
/**
|
37
|
|
- *
|
38
|
|
- * @return -1 if you don't need a splash layout
|
|
39
|
+ * @return the layout you would like to show while react's js context loads
|
39
|
40
|
*/
|
40
|
|
- public abstract @LayoutRes int getSplashLayout();
|
|
41
|
+ public View createSplashLayout() {
|
|
42
|
+ View view = new View(this);
|
|
43
|
+ view.setBackgroundColor(Color.WHITE);
|
|
44
|
+ return view;
|
|
45
|
+ }
|
41
|
46
|
}
|