Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.facebook.react.bridge.ReadableMapKeySetIterator;
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.uimanager.IllegalViewOperationException;
import com.facebook.react.uimanager.RootView;
import com.facebook.react.uimanager.UIManagerModule;
import com.facebook.react.uimanager.UIViewOperationQueue;
Expand All @@ -43,8 +44,20 @@ public RNCustomKeyboardModule(ReactApplicationContext reactContext) {
Handler handle = new Handler(Looper.getMainLooper());

private ReactEditText getEditById(int id) {
UIViewOperationQueue uii = this.getReactApplicationContext().getNativeModule(UIManagerModule.class).getUIImplementation().getUIViewOperationQueue();
return (ReactEditText) uii.getNativeViewHierarchyManager().resolveView(id);
UIViewOperationQueue uii = null;
ReactEditText edit = null;
while (edit == null) {
// we assume the native component will be instantiated at some point, so just
// loop until it appears. Most of the time, the first pass will pick it up.
uii = this.getReactApplicationContext().getNativeModule(UIManagerModule.class).getUIImplementation().getUIViewOperationQueue();
try {
edit = (ReactEditText) uii.getNativeViewHierarchyManager().resolveView(id);
}
catch (IllegalViewOperationException e) {
// do nothing
}
}
return edit;
}

@ReactMethod
Expand Down Expand Up @@ -278,4 +291,4 @@ public void run() {
public String getName() {
return "CustomKeyboard";
}
}
}