use of android.text.method.KeyListener in project android_frameworks_base by AOSPA.
the class EditableInputConnection method clearMetaKeyStates.
@Override
public boolean clearMetaKeyStates(int states) {
final Editable content = getEditable();
if (content == null)
return false;
KeyListener kl = mTextView.getKeyListener();
if (kl != null) {
try {
kl.clearMetaKeyState(mTextView, content, states);
} catch (AbstractMethodError e) {
// This is an old listener that doesn't implement the
// new method.
}
}
return true;
}
use of android.text.method.KeyListener in project android_frameworks_base by AOSPA.
the class DialerFilter method swapPrimaryAndHint.
private void swapPrimaryAndHint(boolean makeLettersPrimary) {
Editable lettersText = mLetters.getText();
Editable digitsText = mDigits.getText();
KeyListener lettersInput = mLetters.getKeyListener();
KeyListener digitsInput = mDigits.getKeyListener();
if (makeLettersPrimary) {
mLetters = mPrimary;
mDigits = mHint;
} else {
mLetters = mHint;
mDigits = mPrimary;
}
mLetters.setKeyListener(lettersInput);
mLetters.setText(lettersText);
lettersText = mLetters.getText();
Selection.setSelection(lettersText, lettersText.length());
mDigits.setKeyListener(digitsInput);
mDigits.setText(digitsText);
digitsText = mDigits.getText();
Selection.setSelection(digitsText, digitsText.length());
// Reset the filters
mPrimary.setFilters(mInputFilters);
mHint.setFilters(mInputFilters);
}
use of android.text.method.KeyListener in project android_frameworks_base by ResurrectionRemix.
the class DialerFilter method swapPrimaryAndHint.
private void swapPrimaryAndHint(boolean makeLettersPrimary) {
Editable lettersText = mLetters.getText();
Editable digitsText = mDigits.getText();
KeyListener lettersInput = mLetters.getKeyListener();
KeyListener digitsInput = mDigits.getKeyListener();
if (makeLettersPrimary) {
mLetters = mPrimary;
mDigits = mHint;
} else {
mLetters = mHint;
mDigits = mPrimary;
}
mLetters.setKeyListener(lettersInput);
mLetters.setText(lettersText);
lettersText = mLetters.getText();
Selection.setSelection(lettersText, lettersText.length());
mDigits.setKeyListener(digitsInput);
mDigits.setText(digitsText);
digitsText = mDigits.getText();
Selection.setSelection(digitsText, digitsText.length());
// Reset the filters
mPrimary.setFilters(mInputFilters);
mHint.setFilters(mInputFilters);
}
Aggregations