|
@@ -1,6 +1,8 @@
|
1
|
1
|
package com.reactnativenavigation.parse;
|
2
|
2
|
|
3
|
3
|
import android.app.Activity;
|
|
4
|
+import android.support.annotation.NonNull;
|
|
5
|
+import android.support.annotation.RestrictTo;
|
4
|
6
|
|
5
|
7
|
import com.facebook.react.ReactInstanceManager;
|
6
|
8
|
import com.reactnativenavigation.presentation.BottomTabPresenter;
|
|
@@ -11,6 +13,7 @@ import com.reactnativenavigation.presentation.RenderChecker;
|
11
|
13
|
import com.reactnativenavigation.presentation.SideMenuPresenter;
|
12
|
14
|
import com.reactnativenavigation.presentation.StackPresenter;
|
13
|
15
|
import com.reactnativenavigation.react.EventEmitter;
|
|
16
|
+import com.reactnativenavigation.utils.Assertions;
|
14
|
17
|
import com.reactnativenavigation.utils.ImageLoader;
|
15
|
18
|
import com.reactnativenavigation.utils.TypefaceLoader;
|
16
|
19
|
import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
|
|
@@ -37,16 +40,16 @@ import java.util.Map;
|
37
|
40
|
import static com.reactnativenavigation.parse.Options.parse;
|
38
|
41
|
|
39
|
42
|
public class LayoutFactory {
|
40
|
|
-
|
41
|
43
|
private Activity activity;
|
42
|
44
|
private ChildControllersRegistry childRegistry;
|
43
|
45
|
private final ReactInstanceManager reactInstanceManager;
|
44
|
46
|
private EventEmitter eventEmitter;
|
45
|
47
|
private Map<String, ExternalComponentCreator> externalComponentCreators;
|
46
|
|
- private Options defaultOptions;
|
|
48
|
+ private @NonNull Options defaultOptions = new Options();
|
47
|
49
|
private TypefaceLoader typefaceManager;
|
48
|
50
|
|
49
|
|
- public void setDefaultOptions(Options defaultOptions) {
|
|
51
|
+ public void setDefaultOptions(@NonNull Options defaultOptions) {
|
|
52
|
+ Assertions.assertNotNull(defaultOptions);
|
50
|
53
|
this.defaultOptions = defaultOptions;
|
51
|
54
|
}
|
52
|
55
|
|
|
@@ -225,4 +228,10 @@ public class LayoutFactory {
|
225
|
228
|
}
|
226
|
229
|
return new TopTabsController(activity, childRegistry, node.id, tabs, new TopTabsLayoutCreator(activity, tabs), parse(typefaceManager, node.getOptions()), new Presenter(activity, defaultOptions));
|
227
|
230
|
}
|
|
231
|
+
|
|
232
|
+ @NonNull
|
|
233
|
+ @RestrictTo(RestrictTo.Scope.TESTS)
|
|
234
|
+ public Options getDefaultOptions() {
|
|
235
|
+ return defaultOptions;
|
|
236
|
+ }
|
228
|
237
|
}
|