|
@@ -104,10 +104,11 @@ public class TopBar extends AppBarLayout {
|
104
|
104
|
}
|
105
|
105
|
unmountReactView();
|
106
|
106
|
reactView = new Pair<>(styleParams.topBarReactView, createReactView(styleParams));
|
|
107
|
+ int height = styleParams.hasCustomTitleBarHeight() ? (int) ViewUtils.convertDpToPixel(styleParams.titleBarHeight) : ViewUtils.getToolBarHeight();
|
107
|
108
|
if ("fill".equals(styleParams.topBarReactViewAlignment)) {
|
108
|
|
- addReactViewFill(reactView.second);
|
|
109
|
+ addReactViewFill(reactView.second, height);
|
109
|
110
|
} else {
|
110
|
|
- addCenteredReactView(reactView.second);
|
|
111
|
+ addCenteredReactView(reactView.second, height);
|
111
|
112
|
}
|
112
|
113
|
} else {
|
113
|
114
|
unmountReactView();
|
|
@@ -133,13 +134,13 @@ public class TopBar extends AppBarLayout {
|
133
|
134
|
);
|
134
|
135
|
}
|
135
|
136
|
|
136
|
|
- private void addReactViewFill(ContentView view) {
|
137
|
|
- view.setLayoutParams(new LayoutParams(MATCH_PARENT, ViewUtils.getToolBarHeight()));
|
|
137
|
+ private void addReactViewFill(ContentView view, int height) {
|
|
138
|
+ view.setLayoutParams(new LayoutParams(MATCH_PARENT, height));
|
138
|
139
|
titleBar.addView(view);
|
139
|
140
|
}
|
140
|
141
|
|
141
|
|
- private void addCenteredReactView(final ContentView view) {
|
142
|
|
- titleBar.addView(view, new LayoutParams(WRAP_CONTENT, ViewUtils.getToolBarHeight()));
|
|
142
|
+ private void addCenteredReactView(final ContentView view, int height) {
|
|
143
|
+ titleBar.addView(view, new LayoutParams(WRAP_CONTENT, height));
|
143
|
144
|
view.setOnDisplayListener(new Screen.OnDisplayListener() {
|
144
|
145
|
@Override
|
145
|
146
|
public void onDisplay() {
|