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