|
@@ -8,6 +8,7 @@ import android.view.View;
|
8
|
8
|
import android.view.ViewGroup;
|
9
|
9
|
import android.widget.RelativeLayout;
|
10
|
10
|
|
|
11
|
+import com.facebook.react.bridge.Callback;
|
11
|
12
|
import com.reactnativenavigation.NavigationApplication;
|
12
|
13
|
import com.reactnativenavigation.params.BaseScreenParams;
|
13
|
14
|
import com.reactnativenavigation.params.SideMenuParams;
|
|
@@ -130,15 +131,19 @@ public class SideMenu extends DrawerLayout {
|
130
|
131
|
sideMenuView.setOnDisplayListener(new Screen.OnDisplayListener() {
|
131
|
132
|
@Override
|
132
|
133
|
public void onDisplay() {
|
133
|
|
- ViewGroup.LayoutParams lp = sideMenuView.getLayoutParams();
|
134
|
|
- if (params != null
|
135
|
|
- && params.fixedWidth > 0) {
|
|
134
|
+ final ViewGroup.LayoutParams lp = sideMenuView.getLayoutParams();
|
|
135
|
+ if (params != null && params.fixedWidth > 0) {
|
136
|
136
|
lp.width = params.fixedWidth;
|
|
137
|
+ sideMenuView.setLayoutParams(lp);
|
137
|
138
|
} else {
|
138
|
|
- lp.width = sideMenuView.getChildAt(0).getWidth();
|
|
139
|
+ NavigationApplication.instance.getUiManagerModule().measure(sideMenuView.getId(), new Callback() {
|
|
140
|
+ @Override
|
|
141
|
+ public void invoke(Object... args) {
|
|
142
|
+ lp.width = sideMenuView.getChildAt(0).getWidth();
|
|
143
|
+ sideMenuView.setLayoutParams(lp);
|
|
144
|
+ }
|
|
145
|
+ });
|
139
|
146
|
}
|
140
|
|
-
|
141
|
|
- sideMenuView.setLayoutParams(lp);
|
142
|
147
|
}
|
143
|
148
|
});
|
144
|
149
|
}
|
|
@@ -176,4 +181,4 @@ public class SideMenu extends DrawerLayout {
|
176
|
181
|
setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, params.side.gravity);
|
177
|
182
|
}
|
178
|
183
|
}
|
179
|
|
-}
|
|
184
|
+}
|