Browse Source

Set layout params on views pushed to stack (#2749)

Closes #2685
Guy Carmeli 7 years ago
parent
commit
f72b38e84d
No account linked to committer's email address

+ 4
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/StackController.java View File

17
 import java.util.Collection;
17
 import java.util.Collection;
18
 import java.util.Iterator;
18
 import java.util.Iterator;
19
 
19
 
20
+import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
21
+
20
 public class StackController extends ParentController <StackLayout> {
22
 public class StackController extends ParentController <StackLayout> {
21
 
23
 
22
     private static final NoOpPromise NO_OP = new NoOpPromise();
24
     private static final NoOpPromise NO_OP = new NoOpPromise();
55
         child.setParentController(this);
57
         child.setParentController(this);
56
         stack.push(child.getId(), child);
58
         stack.push(child.getId(), child);
57
         View enteringView = child.getView();
59
         View enteringView = child.getView();
58
-        getView().addView(enteringView);
60
+        getView().addView(enteringView, MATCH_PARENT, MATCH_PARENT);
59
 
61
 
60
         if (toRemove != null) {
62
         if (toRemove != null) {
61
             getView().removeView(toRemove.getView());
63
             getView().removeView(toRemove.getView());
69
 		child.setParentController(this);
71
 		child.setParentController(this);
70
 		stack.push(child.getId(), child);
72
 		stack.push(child.getId(), child);
71
 		View enteringView = child.getView();
73
 		View enteringView = child.getView();
72
-		getView().addView(enteringView);
74
+		getView().addView(enteringView, MATCH_PARENT, MATCH_PARENT);
73
 
75
 
74
 		if (toRemove != null) {
76
 		if (toRemove != null) {
75
             animator.animatePush(enteringView, () -> {
77
             animator.animatePush(enteringView, () -> {