Search in sources :

Example 61 with InputMethodManager

use of android.view.inputmethod.InputMethodManager in project cw-omnibus by commonsguy.

the class RichTextSearchActivity method onEditorAction.

@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (event == null || event.getAction() == KeyEvent.ACTION_UP) {
        searchFor(search.getText().toString());
        InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
    }
    return (true);
}
Also used : InputMethodManager(android.view.inputmethod.InputMethodManager)

Example 62 with InputMethodManager

use of android.view.inputmethod.InputMethodManager in project Launcher3 by chislon.

the class LauncherTransitionable method onNewIntent.

@Override
protected void onNewIntent(Intent intent) {
    long startTime = 0;
    if (DEBUG_RESUME_TIME) {
        startTime = System.currentTimeMillis();
    }
    super.onNewIntent(intent);
    // Close the menu
    if (Intent.ACTION_MAIN.equals(intent.getAction())) {
        // also will cancel mWaitingForResult.
        closeSystemDialogs();
        final boolean alreadyOnHome = mHasFocus && ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
        if (mWorkspace == null) {
            // Can be cases where mWorkspace is null, this prevents a NPE
            return;
        }
        Folder openFolder = mWorkspace.getOpenFolder();
        // In all these cases, only animate if we're already on home
        mWorkspace.exitWidgetResizeMode();
        if (alreadyOnHome && mState == State.WORKSPACE && !mWorkspace.isTouchActive() && openFolder == null) {
            mWorkspace.moveToDefaultScreen(true);
        }
        closeFolder();
        exitSpringLoadedDragMode();
        // otherwise, just wait until onResume to set the state back to Workspace
        if (alreadyOnHome) {
            showWorkspace(true);
        } else {
            mOnResumeState = State.WORKSPACE;
        }
        final View v = getWindow().peekDecorView();
        if (v != null && v.getWindowToken() != null) {
            InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
        }
        // Reset the apps customize page
        if (mAppsCustomizeTabHost != null) {
            mAppsCustomizeTabHost.reset();
        }
    }
    if (DEBUG_RESUME_TIME) {
        Log.d(TAG, "Time spent in onNewIntent: " + (System.currentTimeMillis() - startTime));
    }
}
Also used : InputMethodManager(android.view.inputmethod.InputMethodManager) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) AppWidgetHostView(android.appwidget.AppWidgetHostView)

Example 63 with InputMethodManager

use of android.view.inputmethod.InputMethodManager in project cw-omnibus by commonsguy.

the class ActionBarFragment method onEditorAction.

@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (event == null || event.getAction() == KeyEvent.ACTION_UP) {
        adapter.add(v.getText().toString());
        v.setText("");
        InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
    }
    return (true);
}
Also used : InputMethodManager(android.view.inputmethod.InputMethodManager)

Example 64 with InputMethodManager

use of android.view.inputmethod.InputMethodManager in project cw-omnibus by commonsguy.

the class SearchView method setImeVisibility.

private void setImeVisibility(final boolean visible) {
    if (visible) {
        post(mShowImeRunnable);
    } else {
        removeCallbacks(mShowImeRunnable);
        InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
        if (imm != null) {
            imm.hideSoftInputFromWindow(getWindowToken(), 0);
        }
    }
}
Also used : InputMethodManager(android.view.inputmethod.InputMethodManager)

Example 65 with InputMethodManager

use of android.view.inputmethod.InputMethodManager in project android-app by eoecn.

the class BaseActivity method hideKeyboard.

protected void hideKeyboard(View view) {
    InputMethodManager imm = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
Also used : InputMethodManager(android.view.inputmethod.InputMethodManager)

Aggregations

InputMethodManager (android.view.inputmethod.InputMethodManager)631 View (android.view.View)120 TextView (android.widget.TextView)67 Paint (android.graphics.Paint)43 Spannable (android.text.Spannable)34 Editable (android.text.Editable)33 EditText (android.widget.EditText)33 ImageView (android.widget.ImageView)31 Intent (android.content.Intent)29 RemoteException (android.os.RemoteException)23 KeyEvent (android.view.KeyEvent)22 TextPaint (android.text.TextPaint)21 Point (android.graphics.Point)18 InputMethodInfo (android.view.inputmethod.InputMethodInfo)18 AdapterView (android.widget.AdapterView)18 Button (android.widget.Button)16 RemoteView (android.widget.RemoteViews.RemoteView)16 Resources (android.content.res.Resources)15 ListView (android.widget.ListView)15 InputMethodSubtype (android.view.inputmethod.InputMethodSubtype)14