|
|
|
|
16
|
import com.reactnativenavigation.views.touch.OverlayTouchDelegate;
|
16
|
import com.reactnativenavigation.views.touch.OverlayTouchDelegate;
|
17
|
|
17
|
|
18
|
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
18
|
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
19
|
-import static android.widget.RelativeLayout.BELOW;
|
|
|
20
|
|
19
|
|
21
|
@SuppressLint("ViewConstructor")
|
20
|
@SuppressLint("ViewConstructor")
|
22
|
public class ComponentLayout extends FrameLayout implements ReactComponent, TopBarButtonController.OnClickListener {
|
21
|
public class ComponentLayout extends FrameLayout implements ReactComponent, TopBarButtonController.OnClickListener {
|
|
|
|
|
84
|
public void drawBehindTopBar() {
|
83
|
public void drawBehindTopBar() {
|
85
|
if (getParent() instanceof RelativeLayout) {
|
84
|
if (getParent() instanceof RelativeLayout) {
|
86
|
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) getLayoutParams();
|
85
|
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) getLayoutParams();
|
87
|
- layoutParams.removeRule(BELOW);
|
|
|
|
|
86
|
+ layoutParams.topMargin = 0;
|
88
|
setLayoutParams(layoutParams);
|
87
|
setLayoutParams(layoutParams);
|
89
|
}
|
88
|
}
|
90
|
}
|
89
|
}
|
|
|
|
|
93
|
public void drawBelowTopBar(TopBar topBar) {
|
92
|
public void drawBelowTopBar(TopBar topBar) {
|
94
|
if (getParent() instanceof RelativeLayout) {
|
93
|
if (getParent() instanceof RelativeLayout) {
|
95
|
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) getLayoutParams();
|
94
|
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) getLayoutParams();
|
96
|
- layoutParams.addRule(BELOW, topBar.getId());
|
|
|
|
|
95
|
+ layoutParams.topMargin = topBar.getHeight();
|
97
|
setLayoutParams(layoutParams);
|
96
|
setLayoutParams(layoutParams);
|
98
|
}
|
97
|
}
|
99
|
}
|
98
|
}
|