|
@@ -16,7 +16,6 @@ import com.reactnativenavigation.controllers.ScreenStyleParams;
|
16
|
16
|
import com.reactnativenavigation.utils.SdkSupports;
|
17
|
17
|
import com.reactnativenavigation.views.ContentView;
|
18
|
18
|
import com.reactnativenavigation.views.ScrollDirectionListener;
|
19
|
|
-import com.reactnativenavigation.views.TitleBar;
|
20
|
19
|
import com.reactnativenavigation.views.TitleBarButton;
|
21
|
20
|
|
22
|
21
|
import java.util.List;
|
|
@@ -47,16 +46,10 @@ public class ScreenLayout extends LinearLayout implements ScrollDirectionListene
|
47
|
46
|
|
48
|
47
|
private void createViews() {
|
49
|
48
|
addTopBar();
|
50
|
|
- addTitleBarAndSetButtons();
|
|
49
|
+ topBar.addTitleBarAndSetButtons(buttons);
|
51
|
50
|
addContentView();
|
52
|
51
|
}
|
53
|
52
|
|
54
|
|
- private void addTitleBarAndSetButtons() {
|
55
|
|
- TitleBar titleBar = new TitleBar(getContext());
|
56
|
|
- titleBar.setButtons(buttons);
|
57
|
|
- topBar.addView(titleBar);
|
58
|
|
- }
|
59
|
|
-
|
60
|
53
|
private void addTopBar() {
|
61
|
54
|
topBar = new TopBar(getContext());
|
62
|
55
|
addView(topBar, new LinearLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
|
|
@@ -71,7 +64,9 @@ public class ScreenLayout extends LinearLayout implements ScrollDirectionListene
|
71
|
64
|
setStatusBarColor(styleParams.statusBarColor);
|
72
|
65
|
setTopBarColor(styleParams.topBarColor);
|
73
|
66
|
setNavigationBarColor(styleParams.navigationBarColor);
|
74
|
|
- setTitleBarHidden(styleParams.titleBarHidden);
|
|
67
|
+ topBar.setTitleBarVisibility(styleParams.titleBarHidden);
|
|
68
|
+ topBar.setVisibility(styleParams.topBarHidden ? GONE : VISIBLE);
|
|
69
|
+
|
75
|
70
|
}
|
76
|
71
|
|
77
|
72
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
|
@@ -110,12 +105,6 @@ public class ScreenLayout extends LinearLayout implements ScrollDirectionListene
|
110
|
105
|
}
|
111
|
106
|
}
|
112
|
107
|
|
113
|
|
- private void setTitleBarHidden(boolean titleBarHidden) {
|
114
|
|
- if (titleBarHidden) {
|
115
|
|
-
|
116
|
|
- }
|
117
|
|
- }
|
118
|
|
-
|
119
|
108
|
@Override
|
120
|
109
|
public void onScrollChanged(ScrollDirectionListener.Direction direction) {
|
121
|
110
|
|