You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
implement EditText.setOnEditorActionListener()
This makes the NewPipe search work again
This commit is contained in:
@@ -19,6 +19,7 @@ public class EditText extends TextView {
|
||||
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);
|
||||
protected native void native_setOnEditorActionListener(long widget, OnEditorActionListener l);
|
||||
|
||||
public Editable getText() {
|
||||
return new SpannableStringBuilder(native_getText(widget));
|
||||
@@ -37,4 +38,9 @@ public class EditText extends TextView {
|
||||
public void addTextChangedListener(TextWatcher watcher) {
|
||||
native_addTextChangedListener(widget, watcher);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnEditorActionListener(OnEditorActionListener l) {
|
||||
native_setOnEditorActionListener(widget, l);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import android.text.method.TransformationMethod;
|
||||
import android.text.style.URLSpan;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.Gravity;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
|
||||
public class TextView extends View {
|
||||
@@ -186,6 +187,7 @@ public class TextView extends View {
|
||||
public CharSequence getHint() {return "HINT";}
|
||||
|
||||
public static interface OnEditorActionListener {
|
||||
public abstract boolean onEditorAction(TextView v, int actionId, KeyEvent event);
|
||||
}
|
||||
|
||||
public static enum BufferType {
|
||||
|
||||
Reference in New Issue
Block a user