ui-philip / InputView secret
Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View InputView
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
public class InputView extends EditText
{
private Context context;
 
public InputView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context);
}
 
public InputView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
 
public InputView(Context context) {
super(context);
init(context);
}
 
private void init(Context context) {
this.context = context;
}
 
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
MyInputConnection ic = new MyInputConnection(this, false);
return ic;
}
 
public class MyInputConnection extends BaseInputConnection {
public MyInputConnection(View targetView, boolean fullEditor) {
super(targetView, fullEditor);
}
 
@Override
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
// Never gets called...
return super.deleteSurroundingText(beforeLength, afterLength);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.