|
@@ -1,6 +1,7 @@
|
1
|
1
|
package com.reactnativenavigation.presentation;
|
2
|
2
|
|
3
|
3
|
import android.app.Activity;
|
|
4
|
+import android.graphics.Color;
|
4
|
5
|
import android.support.annotation.NonNull;
|
5
|
6
|
|
6
|
7
|
import com.reactnativenavigation.interfaces.ChildDisappearListener;
|
|
@@ -18,6 +19,9 @@ import com.reactnativenavigation.views.topbar.TopBar;
|
18
|
19
|
import java.util.ArrayList;
|
19
|
20
|
|
20
|
21
|
public class OptionsPresenter {
|
|
22
|
+ private static final int DEFAULT_TITLE_COLOR = Color.BLACK;
|
|
23
|
+ private static final int DEFAULT_SUBTITLE_COLOR = Color.GRAY;
|
|
24
|
+
|
21
|
25
|
private TopBar topBar;
|
22
|
26
|
|
23
|
27
|
public OptionsPresenter(TopBar topBar) {
|
|
@@ -39,13 +43,13 @@ public class OptionsPresenter {
|
39
|
43
|
private void applyTopBarOptions(TopBarOptions options, AnimationsOptions animationOptions, Component component) {
|
40
|
44
|
if (options.title.text.hasValue()) topBar.setTitle(options.title.text.get());
|
41
|
45
|
if (options.title.component.hasValue()) topBar.setTitleComponent(options.title.component.get(), options.title.alignment);
|
42
|
|
- if (options.title.color.hasValue()) topBar.setTitleTextColor(options.title.color.get());
|
43
|
46
|
if (options.title.fontSize.hasValue()) topBar.setTitleFontSize(options.title.fontSize.get());
|
|
47
|
+ topBar.setTitleTextColor(options.title.color.get(DEFAULT_TITLE_COLOR));
|
44
|
48
|
topBar.setTitleTypeface(options.title.fontFamily);
|
45
|
49
|
|
46
|
50
|
if (options.subtitle.text.hasValue()) topBar.setSubtitle(options.subtitle.text.get());
|
47
|
|
- if (options.subtitle.color.hasValue()) topBar.setSubtitleColor(options.subtitle.color.get());
|
48
|
51
|
if (options.subtitle.fontSize.hasValue()) topBar.setSubtitleFontSize(options.subtitle.fontSize.get());
|
|
52
|
+ topBar.setSubtitleColor(options.subtitle.color.get(DEFAULT_SUBTITLE_COLOR));
|
49
|
53
|
topBar.setSubtitleFontFamily(options.subtitle.fontFamily);
|
50
|
54
|
|
51
|
55
|
topBar.setBackgroundColor(options.background.color);
|