use of android.view.inputmethod.EditorInfo in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class TestsDvorakUrl method createKeyboardLayoutSet.
@Override
protected KeyboardLayoutSet createKeyboardLayoutSet(final InputMethodSubtype subtype, final EditorInfo editorInfo, final boolean voiceInputKeyEnabled, final boolean languageSwitchKeyEnabled, final boolean splitLayoutEnabled) {
final EditorInfo emailField = new EditorInfo();
emailField.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI;
return super.createKeyboardLayoutSet(subtype, emailField, voiceInputKeyEnabled, languageSwitchKeyEnabled, splitLayoutEnabled);
}
use of android.view.inputmethod.EditorInfo in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class TestsQwertyEmail method createKeyboardLayoutSet.
@Override
protected KeyboardLayoutSet createKeyboardLayoutSet(final InputMethodSubtype subtype, final EditorInfo editorInfo, final boolean voiceInputKeyEnabled, final boolean languageSwitchKeyEnabled, final boolean splitLayoutEnabled) {
final EditorInfo emailField = new EditorInfo();
emailField.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
return super.createKeyboardLayoutSet(subtype, emailField, voiceInputKeyEnabled, languageSwitchKeyEnabled, splitLayoutEnabled);
}
use of android.view.inputmethod.EditorInfo in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class TestsQwertyUrl method createKeyboardLayoutSet.
@Override
protected KeyboardLayoutSet createKeyboardLayoutSet(final InputMethodSubtype subtype, final EditorInfo editorInfo, final boolean voiceInputKeyEnabled, final boolean languageSwitchKeyEnabled, final boolean splitLayoutEnabled) {
final EditorInfo emailField = new EditorInfo();
emailField.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI;
return super.createKeyboardLayoutSet(subtype, emailField, voiceInputKeyEnabled, languageSwitchKeyEnabled, splitLayoutEnabled);
}
use of android.view.inputmethod.EditorInfo in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class InputTestsBase method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
mEditText = new MyEditText(getContext());
final int inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT | InputType.TYPE_TEXT_FLAG_MULTI_LINE;
mEditText.setInputType(inputType);
mEditText.setEnabled(true);
mLastCursorPos = 0;
if (null == Looper.myLooper()) {
Looper.prepare();
}
setupService();
mLatinIME = getService();
setDebugMode(true);
mPreviousBigramPredictionSettings = setBooleanPreference(Settings.PREF_BIGRAM_PREDICTIONS, true, true);
mPreviousAutoCorrectSetting = setBooleanPreference(Settings.PREF_AUTO_CORRECTION, DEFAULT_AUTO_CORRECTION, DEFAULT_AUTO_CORRECTION);
mLatinIME.onCreate();
EditorInfo ei = new EditorInfo();
final InputConnection ic = mEditText.onCreateInputConnection(ei);
final LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final ViewGroup vg = new FrameLayout(getContext());
mInputView = inflater.inflate(R.layout.input_view, vg);
ei = enrichEditorInfo(ei);
mLatinIME.onCreateInputMethodInterface().startInput(ic, ei);
mLatinIME.setInputView(mInputView);
mLatinIME.onBindInput();
mLatinIME.onCreateInputView();
mLatinIME.onStartInputView(ei, false);
mInputConnection = ic;
changeLanguage("en_US");
// Run messages to avoid the messages enqueued by startInputView() and its friends
// to run on a later call and ruin things. We need to wait first because some of them
// can be posted with a delay (notably, MSG_RESUME_SUGGESTIONS)
sleep(DELAY_TO_WAIT_FOR_PREDICTIONS_MILLIS);
runMessages();
}
use of android.view.inputmethod.EditorInfo in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class LatinIME method onEvaluateFullscreenMode.
@Override
public boolean onEvaluateFullscreenMode() {
final SettingsValues settingsValues = mSettings.getCurrent();
if (isImeSuppressedByHardwareKeyboard()) {
// If there is a hardware keyboard, disable full screen mode.
return false;
}
// Reread resource value here, because this method is called by the framework as needed.
final boolean isFullscreenModeAllowed = Settings.readUseFullscreenMode(getResources());
if (super.onEvaluateFullscreenMode() && isFullscreenModeAllowed) {
// TODO: Remove this hack. Actually we should not really assume NO_EXTRACT_UI
// implies NO_FULLSCREEN. However, the framework mistakenly does. i.e. NO_EXTRACT_UI
// without NO_FULLSCREEN doesn't work as expected. Because of this we need this
// hack for now. Let's get rid of this once the framework gets fixed.
final EditorInfo ei = getCurrentInputEditorInfo();
return !(ei != null && ((ei.imeOptions & EditorInfo.IME_FLAG_NO_EXTRACT_UI) != 0));
}
return false;
}
Aggregations