@Override public void onTextChanged(CharSequence s, int start, int before, int count) { AutoCompleteEditTextBatchListener listener = getEdittext() .getBatchListener(); if (listener != null && count == 1) { listener.addNewChar(getEdittext()); } }
public AutoCompleteEditText(Context context, AttributeSet attrs) { super(context, attrs); editTextVersion(); setDisableCopyAndPaste(context, attrs); setCancelClipboard(context, attrs); setAutoFocus(context, attrs); if (isOldDeviceTextAllCaps()) { setAllCaps(context, attrs); } }
public CustomInputConnection(InputConnection target, boolean mutable, AutoCompleteEditText editText) { super(target, mutable); setEdittext(editText); }
/** * Define what version of code we need to use */ private void editTextVersion() { if (android.os.Build.VERSION.SDK_INT < 14) { setOldDeviceKeyboard(true); setOldDeviceTextAllCaps(true); } else { setOldDeviceKeyboard(true); setOldDeviceTextAllCaps(false); } //Custom internal listener setListenerTextWatcherInternal(new CustomTextWatcher(this)); addTextChangedListener(getListenerTextWatcherInternal()); //System service mImm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); //Autofocus disabled by default mAutoFocus = false; mCustomPassWordTransformation = false; }
/** * Return if cellphone use a lg keyboard * * @return */ public boolean isALGKeyboard() { if (getKeyboardName().equals(EDITTEXT_KEYBOARD_LG)) { return true; } else { return false; } }
/** * XML methods * * @param ctx * @param attrs */ private void setDisableCopyAndPaste(Context ctx, AttributeSet attrs) { boolean disableCopyAndPaste = attrs.getAttributeBooleanValue( PixlUIContants.SCHEMA_URL, EDITTEXT_ATTRIBUTE_COPY_AND_PASTE, true); if (!disableCopyAndPaste && !isInEditMode()) { disableCopyAndPaste(); } }
/** * XML methods * * @param ctx * @param attrs */ private void setCancelClipboard(Context ctx, AttributeSet attrs) { boolean cancelClipboard = attrs.getAttributeBooleanValue( PixlUIContants.SCHEMA_URL, EDITTEXT_ATTRIBUTE_CANCEL_CLIPBOARD_CONTENT, false); if (cancelClipboard && !isInEditMode()) { cancelClipBoardContent(); } }
public AutoCompleteEditText(Context context) { super(context); editTextVersion(); }
public CustomTextWatcher(AutoCompleteEditText editText) { super(); setEdittext(editText); }
public void setCustomPassWordTransformation( boolean mCustomPassWordTransformation) { this.mCustomPassWordTransformation = mCustomPassWordTransformation; if (this.mCustomPassWordTransformation) { this.setTransformationMethod(new CustomPasswordTransformationMethod()); } } }
@Override public boolean beginBatchEdit() { mLastLength = length(); mKeyEvent = null; return super.beginBatchEdit(); }
@Override public InputConnection onCreateInputConnection(EditorInfo outAttrs) { return new CustomInputConnection( super.onCreateInputConnection(outAttrs), true, this); }
@Override public InputConnection onCreateInputConnection(EditorInfo outAttrs) { InputConnection connection = super.onCreateInputConnection(outAttrs); // By default setting android:inputType="textMultiLine" will remove any imeAction like NEXT, DONE... // So here is where this behaviour is changed if ((outAttrs.imeOptions & EditorInfo.IME_FLAG_NO_ENTER_ACTION) != 0) { outAttrs.imeOptions &= ~EditorInfo.IME_FLAG_NO_ENTER_ACTION; } return new DelCatcherInputConnection(connection, true); }
public AutoCompleteEditText(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); editTextVersion(); setDisableCopyAndPaste(context, attrs); setCancelClipboard(context, attrs); setAutoFocus(context, attrs); if (isOldDeviceTextAllCaps()) { setAllCaps(context, attrs); } PixlUIfaceManager.applyFont(this, attrs, defStyle, context); }
/** * Return if cellphone use a old samsung keyboard * * @return */ public boolean isAOldSamsungKeyboard() { if (getKeyboardName().equals(EDITTEXT_KEYBOARD_OLD_SAMSUNG)) { return true; } else { return false; } }
/** * Return if cellphone use a SwiftKey * * @return */ public boolean isASwiftKeyKeyboard() { if (getKeyboardName().equals(EDITTEXT_KEYBOARD_SWIFTKEY)) { return true; } else { return false; } }
/** * Return if cellphone use a Swype + Dragon * * @return */ public boolean isASwypeDragonKeyboard() { if (getKeyboardName().equals(EDITTEXT_KEYBOARD_SWYPE_DRAGON)) { return true; } else { return false; } }
/** * Return if cellphone use a samsung keyboard * * @return */ public boolean isASamsungKeyboard() { if (getKeyboardName().equals(EDITTEXT_KEYBOARD_SAMSUNG)) { return true; } else { return false; } }
/** * Return if cellphone use a sense keyboard (HTC) * * @return */ public boolean isASenseKeyboard() { if (getKeyboardName().equals(EDITTEXT_KEYBOARD_SENSE)) { return true; } else { return false; } }
/** * Return if cellphone use a SwiftKeyTrial * * @return */ public boolean isASwiftKeyTrialKeyboard() { if (getKeyboardName().equals(EDITTEXT_KEYBOARD_SWIFTKEY_TRIAL)) { return true; } else { return false; } }