EditText: implement addTextChangedListener()

This commit is contained in:
Julian Winkler
2023-09-01 13:03:40 +02:00
parent 071538de02
commit 30b990f60a
3 changed files with 43 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ package android.widget;
import android.content.Context;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet;
public class EditText extends TextView {
@@ -16,6 +17,7 @@ public class EditText extends TextView {
@Override
protected native long native_constructor(Context context, AttributeSet attrs);
protected native String native_getText(long widget);
protected native void native_addTextChangedListener(long widget, TextWatcher watcher);
public Editable getText() {
return new FIXME_Editable(native_getText(widget));
@@ -58,4 +60,9 @@ public class EditText extends TextView {
}
}
@Override
public void addTextChangedListener(TextWatcher watcher) {
native_addTextChangedListener(widget, watcher);
}
}