mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 20:56:49 +08:00
Fix DisplayMetrics KeyboardListener dependency
Summary: public KeyboardListener needs DisplayMetrics to be initialized when it is attached. At the moment, this breaks easily whenever we change these components, since DisplayMetrics are intialized in a module and KeyboardListener is created eagerly in ReactRootView, whereas ReactRootView can exist without the instance. This changes to create DisplayMetrics as soon as possible, when the react instance is built. The KeyboardListener is created and attached after the ReactRootView is attached to an existing instance, point at which DisplayMetrics have to be initialized. Reviewed By: dmmiller Differential Revision: D2911351 fb-gh-sync-id: 64d1805c5d5b2f6876adb694b565a2df059b381d
This commit is contained in:
committed by
facebook-github-bot-5
parent
6b74535e97
commit
4254e8a0a9
@@ -9,12 +9,9 @@
|
||||
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import android.util.DisplayMetrics;
|
||||
|
||||
import com.facebook.react.common.MapBuilder;
|
||||
|
||||
/**
|
||||
@@ -39,10 +36,8 @@ import com.facebook.react.common.MapBuilder;
|
||||
* {@link UIManagerModuleConstants}.
|
||||
* TODO(6845124): Create a test for this
|
||||
*/
|
||||
/* package */ static Map<String, Object> createConstants(
|
||||
DisplayMetrics displayMetrics,
|
||||
List<ViewManager> viewManagers) {
|
||||
Map<String, Object> constants = UIManagerModuleConstants.getConstants(displayMetrics);
|
||||
/* package */ static Map<String, Object> createConstants(List<ViewManager> viewManagers) {
|
||||
Map<String, Object> constants = UIManagerModuleConstants.getConstants();
|
||||
Map bubblingEventTypesConstants = UIManagerModuleConstants.getBubblingEventTypeConstants();
|
||||
Map directEventTypesConstants = UIManagerModuleConstants.getDirectEventTypeConstants();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user