|
@@ -22,13 +22,15 @@ import java.util.ArrayList;
|
22
|
22
|
public class OptionsPresenter {
|
23
|
23
|
private static final int DEFAULT_TITLE_COLOR = Color.BLACK;
|
24
|
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);
|
|
25
|
+ private final float defaultTitleFontSize;
|
|
26
|
+ private final float defaultSubtitleFontSize;
|
27
|
27
|
|
28
|
28
|
private TopBar topBar;
|
29
|
29
|
|
30
|
30
|
public OptionsPresenter(TopBar topBar) {
|
31
|
31
|
this.topBar = topBar;
|
|
32
|
+ defaultTitleFontSize = UiUtils.dpToSp(topBar.getContext(), 18);
|
|
33
|
+ defaultSubtitleFontSize = UiUtils.dpToSp(topBar.getContext(), 14);
|
32
|
34
|
}
|
33
|
35
|
|
34
|
36
|
public void applyChildOptions(Options options, Component child) {
|
|
@@ -46,12 +48,12 @@ public class OptionsPresenter {
|
46
|
48
|
private void applyTopBarOptions(TopBarOptions options, AnimationsOptions animationOptions, Component component) {
|
47
|
49
|
topBar.setTitle(options.title.text.get(""));
|
48
|
50
|
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));
|
|
51
|
+ topBar.setTitleFontSize(options.title.fontSize.get(defaultTitleFontSize));
|
50
|
52
|
topBar.setTitleTextColor(options.title.color.get(DEFAULT_TITLE_COLOR));
|
51
|
53
|
topBar.setTitleTypeface(options.title.fontFamily);
|
52
|
54
|
|
53
|
55
|
topBar.setSubtitle(options.subtitle.text.get(""));
|
54
|
|
- topBar.setSubtitleFontSize(options.subtitle.fontSize.get(DEFAULT_SUBTITLE_FONT_SIZE));
|
|
56
|
+ topBar.setSubtitleFontSize(options.subtitle.fontSize.get(defaultSubtitleFontSize));
|
55
|
57
|
topBar.setSubtitleColor(options.subtitle.color.get(DEFAULT_SUBTITLE_COLOR));
|
56
|
58
|
topBar.setSubtitleFontFamily(options.subtitle.fontFamily);
|
57
|
59
|
|