|
@@ -8,7 +8,7 @@ import android.os.Build;
|
8
|
8
|
import android.util.Log;
|
9
|
9
|
import android.view.View;
|
10
|
10
|
import android.view.Window;
|
11
|
|
-import android.widget.LinearLayout;
|
|
11
|
+import android.widget.RelativeLayout;
|
12
|
12
|
|
13
|
13
|
import com.reactnativenavigation.animation.OnScrollAnimator;
|
14
|
14
|
import com.reactnativenavigation.params.ScreenParams;
|
|
@@ -21,7 +21,7 @@ import com.reactnativenavigation.views.TopBar;
|
21
|
21
|
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
22
|
22
|
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
|
23
|
23
|
|
24
|
|
-public class ScreenImpl extends LinearLayout implements Screen, ScrollDirectionListener.OnScrollChanged {
|
|
24
|
+public class ScreenImpl extends RelativeLayout implements Screen, ScrollDirectionListener.OnScrollChanged {
|
25
|
25
|
|
26
|
26
|
private final ScreenParams screenParams;
|
27
|
27
|
private ContentView contentView;
|
|
@@ -31,7 +31,6 @@ public class ScreenImpl extends LinearLayout implements Screen, ScrollDirectionL
|
31
|
31
|
public ScreenImpl(Context context, ScreenParams screenParams) {
|
32
|
32
|
super(context);
|
33
|
33
|
this.screenParams = screenParams;
|
34
|
|
- setOrientation(VERTICAL);
|
35
|
34
|
|
36
|
35
|
createViews();
|
37
|
36
|
setStyle(screenParams.styleParams);
|
|
@@ -50,12 +49,14 @@ public class ScreenImpl extends LinearLayout implements Screen, ScrollDirectionL
|
50
|
49
|
|
51
|
50
|
private void addTopBar() {
|
52
|
51
|
topBar = new TopBar(getContext());
|
53
|
|
- addView(topBar, new LinearLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
|
|
52
|
+ addView(topBar, new LayoutParams(MATCH_PARENT, WRAP_CONTENT));
|
54
|
53
|
}
|
55
|
54
|
|
56
|
55
|
private void addContentView() {
|
57
|
56
|
contentView = new ContentView(getContext(), screenParams, this);
|
58
|
|
- addView(contentView, new LayoutParams(MATCH_PARENT, MATCH_PARENT));
|
|
57
|
+ RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT);
|
|
58
|
+ params.addRule(RelativeLayout.BELOW, topBar.getId());
|
|
59
|
+ addView(contentView, params);
|
59
|
60
|
contentView.init();
|
60
|
61
|
}
|
61
|
62
|
|