diff --git a/android/Application/src/main/java/com/example/android/ReactAztec/ReactAztecManager.java b/android/Application/src/main/java/com/example/android/ReactAztec/ReactAztecManager.java index 6caf9c08d66ac4..79080e42674645 100644 --- a/android/Application/src/main/java/com/example/android/ReactAztec/ReactAztecManager.java +++ b/android/Application/src/main/java/com/example/android/ReactAztec/ReactAztecManager.java @@ -156,23 +156,23 @@ public void setOnScroll(final ReactAztecView view, boolean onScroll) { @Override protected void addEventEmitters(final ThemedReactContext reactContext, final ReactAztecView aztecView) { - final ReactAztecText editText = aztecView.getAztecText(); - editText.addTextChangedListener(new AztecTextWatcher(reactContext, aztecView)); - editText.setOnFocusChangeListener( + aztecView.getAztecText().addTextChangedListener(new AztecTextWatcher(reactContext, aztecView)); + aztecView.getAztecText().setOnFocusChangeListener( new View.OnFocusChangeListener() { public void onFocusChange(View v, boolean hasFocus) { EventDispatcher eventDispatcher = reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher(); + final ReactAztecText editText = (ReactAztecText)v; if (hasFocus) { eventDispatcher.dispatchEvent( new ReactAztecFocusEvent( - aztecView.getId())); // TODO is the correct ID? + aztecView.getId())); } else { eventDispatcher.dispatchEvent( new ReactAztecBlurEvent( aztecView.getId())); eventDispatcher.dispatchEvent( - new ReactaztecEndEditingEvent( + new ReactAztecEndEditingEvent( aztecView.getId(), editText.getText().toString())); } diff --git a/android/Application/src/main/java/com/example/android/ReactAztec/ReactaztecEndEditingEvent.java b/android/Application/src/main/java/com/example/android/ReactAztec/ReactaztecEndEditingEvent.java index 3b06876444bdfa..cb7be979c0c806 100644 --- a/android/Application/src/main/java/com/example/android/ReactAztec/ReactaztecEndEditingEvent.java +++ b/android/Application/src/main/java/com/example/android/ReactAztec/ReactaztecEndEditingEvent.java @@ -9,13 +9,13 @@ * Event emitted by Aztec native view when text editing ends, * because of the user leaving the text input. */ -class ReactaztecEndEditingEvent extends Event { +class ReactAztecEndEditingEvent extends Event { private static final String EVENT_NAME = "topEndEditing"; private String mText; - public ReactaztecEndEditingEvent( + public ReactAztecEndEditingEvent( int viewId, String text) { super(viewId);