|
@@ -12,6 +12,7 @@ import com.reactnativenavigation.parse.TopBarOptions;
|
12
|
12
|
import com.reactnativenavigation.parse.TopTabOptions;
|
13
|
13
|
import com.reactnativenavigation.parse.TopTabsOptions;
|
14
|
14
|
import com.reactnativenavigation.parse.params.Button;
|
|
15
|
+import com.reactnativenavigation.utils.UiUtils;
|
15
|
16
|
import com.reactnativenavigation.viewcontrollers.IReactView;
|
16
|
17
|
import com.reactnativenavigation.views.Component;
|
17
|
18
|
import com.reactnativenavigation.views.topbar.TopBar;
|
|
@@ -21,6 +22,8 @@ import java.util.ArrayList;
|
21
|
22
|
public class OptionsPresenter {
|
22
|
23
|
private static final int DEFAULT_TITLE_COLOR = Color.BLACK;
|
23
|
24
|
private static final int DEFAULT_SUBTITLE_COLOR = Color.GRAY;
|
|
25
|
+ private static final float DEFAULT_TITLE_FONT_SIZE = UiUtils.dpToSp(18);
|
|
26
|
+ private static final float DEFAULT_SUBTITLE_FONT_SIZE = UiUtils.dpToSp(14);
|
24
|
27
|
|
25
|
28
|
private TopBar topBar;
|
26
|
29
|
|
|
@@ -41,14 +44,14 @@ public class OptionsPresenter {
|
41
|
44
|
}
|
42
|
45
|
|
43
|
46
|
private void applyTopBarOptions(TopBarOptions options, AnimationsOptions animationOptions, Component component) {
|
44
|
|
- if (options.title.text.hasValue()) topBar.setTitle(options.title.text.get());
|
|
47
|
+ topBar.setTitle(options.title.text.get(""));
|
45
|
48
|
if (options.title.component.hasValue()) topBar.setTitleComponent(options.title.component.get(), options.title.alignment);
|
46
|
|
- if (options.title.fontSize.hasValue()) topBar.setTitleFontSize(options.title.fontSize.get());
|
|
49
|
+ topBar.setTitleFontSize(options.title.fontSize.get(DEFAULT_TITLE_FONT_SIZE));
|
47
|
50
|
topBar.setTitleTextColor(options.title.color.get(DEFAULT_TITLE_COLOR));
|
48
|
51
|
topBar.setTitleTypeface(options.title.fontFamily);
|
49
|
52
|
|
50
|
|
- if (options.subtitle.text.hasValue()) topBar.setSubtitle(options.subtitle.text.get());
|
51
|
|
- if (options.subtitle.fontSize.hasValue()) topBar.setSubtitleFontSize(options.subtitle.fontSize.get());
|
|
53
|
+ topBar.setSubtitle(options.subtitle.text.get(""));
|
|
54
|
+ topBar.setSubtitleFontSize(options.subtitle.fontSize.get(DEFAULT_SUBTITLE_FONT_SIZE));
|
52
|
55
|
topBar.setSubtitleColor(options.subtitle.color.get(DEFAULT_SUBTITLE_COLOR));
|
53
|
56
|
topBar.setSubtitleFontFamily(options.subtitle.fontFamily);
|
54
|
57
|
|