Example usage for android.view.inputmethod EditorInfo IME_FLAG_NO_FULLSCREEN

List of usage examples for android.view.inputmethod EditorInfo IME_FLAG_NO_FULLSCREEN

Introduction

In this page you can find the example usage for android.view.inputmethod EditorInfo IME_FLAG_NO_FULLSCREEN.

Prototype

int IME_FLAG_NO_FULLSCREEN

To view the source code for android.view.inputmethod EditorInfo IME_FLAG_NO_FULLSCREEN.

Click Source Link

Document

Flag of #imeOptions : used to request that the IME never go into fullscreen mode.

Usage

From source file:org.chromium.chrome.browser.preferences.website.UsbChooserPreferences.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    menu.clear();//from  w  ww .j  a  v a 2s.co m
    inflater.inflate(R.menu.website_preferences_menu, menu);

    MenuItem searchItem = menu.findItem(R.id.search);
    mSearchView = (SearchView) MenuItemCompat.getActionView(searchItem);
    mSearchView.setImeOptions(EditorInfo.IME_FLAG_NO_FULLSCREEN);
    SearchView.OnQueryTextListener queryTextListener = new SearchView.OnQueryTextListener() {
        @Override
        public boolean onQueryTextSubmit(String query) {
            return true;
        }

        @Override
        public boolean onQueryTextChange(String query) {
            // Make search case-insensitive.
            query = query.toLowerCase();

            if (query.equals(mSearch))
                return true;

            mSearch = query;
            getInfo();
            return true;
        }
    };
    mSearchView.setOnQueryTextListener(queryTextListener);

    MenuItem help = menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
    help.setIcon(R.drawable.ic_help_and_feedback);
}

From source file:org.chromium.chrome.browser.ntp.cards.NewTabPageRecyclerView.java

@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    // Fixes landscape transitions when unfocusing the URL bar: crbug.com/288546
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
    return super.onCreateInputConnection(outAttrs);
}

From source file:com.gm.goldencity.activity.search.SearchActivity.java

public void setupSearchView() {
    SearchManager searchManager = (SearchManager) getSystemService(SEARCH_SERVICE);
    searchview.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
    // hint, inputType & ime options seem to be ignored from XML! Set in code
    searchview.setQueryHint(getString(R.string.search_hint));
    searchview.setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS);
    searchview.setImeOptions(searchview.getImeOptions() | EditorInfo.IME_ACTION_SEARCH
            | EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_FLAG_NO_FULLSCREEN);

}

From source file:us.phyxsi.gameshelf.ui.SearchActivity.java

private void setupSearchView() {
    SearchManager searchManager = (SearchManager) getSystemService(SEARCH_SERVICE);
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
    // hint, inputType & ime options seem to be ignored from XML! Set in code
    searchView.setQueryHint(getString(R.string.search_hint));
    searchView.setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS);
    searchView.setImeOptions(searchView.getImeOptions() | EditorInfo.IME_ACTION_SEARCH
            | EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_FLAG_NO_FULLSCREEN);
    searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
        @Override// ww  w .  j  a v a  2  s .com
        public boolean onQueryTextSubmit(String query) {
            getByTitle(query);
            return true;
        }

        @Override
        public boolean onQueryTextChange(String query) {
            if (TextUtils.isEmpty(query)) {
                clearResults();
            }
            return true;
        }
    });
}

From source file:org.goodev.material.SearchActivity.java

private void setupSearchView() {
    SearchManager searchManager = (SearchManager) getSystemService(SEARCH_SERVICE);
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
    // hint, inputType & ime options seem to be ignored from XML! Set in code
    searchView.setQueryHint(getString(R.string.search_hint));
    searchView.setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS);
    searchView.setImeOptions(searchView.getImeOptions() | EditorInfo.IME_ACTION_SEARCH
            | EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_FLAG_NO_FULLSCREEN);
    searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
        @Override//from   w  w w.  ja v a 2s  . c o m
        public boolean onQueryTextSubmit(String query) {
            searchFor(query);
            return true;
        }

        @Override
        public boolean onQueryTextChange(String query) {
            if (TextUtils.isEmpty(query)) {
                clearResults();
            }
            return true;
        }
    });

}

From source file:org.chromium.chrome.browser.preferences.website.SingleCategoryPreferences.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    menu.clear();//  w w  w  .  ja  v a 2s  . c o m
    inflater.inflate(R.menu.website_preferences_menu, menu);

    MenuItem searchItem = menu.findItem(R.id.search);
    mSearchView = (SearchView) MenuItemCompat.getActionView(searchItem);
    mSearchView.setImeOptions(EditorInfo.IME_FLAG_NO_FULLSCREEN);
    SearchView.OnQueryTextListener queryTextListener = new SearchView.OnQueryTextListener() {
        @Override
        public boolean onQueryTextSubmit(String query) {
            return true;
        }

        @Override
        public boolean onQueryTextChange(String query) {
            if (query.equals(mSearch))
                return true;

            mSearch = query;
            getInfoForOrigins();
            return true;
        }
    };
    mSearchView.setOnQueryTextListener(queryTextListener);

    if (mCategory.showProtectedMediaSites()) {
        // Add a menu item to reset protected media identifier device credentials.
        MenuItem resetMenu = menu.add(Menu.NONE, Menu.NONE, Menu.NONE, R.string.reset_device_credentials);
        resetMenu.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
            @Override
            public boolean onMenuItemClick(MenuItem menuItem) {
                ProtectedContentResetCredentialConfirmDialogFragment.newInstance(SingleCategoryPreferences.this)
                        .show(getFragmentManager(), null);
                return true;
            }
        });
    }

    MenuItem help = menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
    help.setIcon(R.drawable.ic_help_and_feedback);
}

From source file:im.ene.lab.attiq.ui.activities.SearchActivity.java

private void setupSearchView() {
      SearchManager searchManager = (SearchManager) getSystemService(SEARCH_SERVICE);
      mSearchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
      // hint, inputType & ime options seem to be ignored from XML! Set in code
      mSearchView.setQueryHint(getString(R.string.search_hint));
      mSearchView.setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS);
      mSearchView.setImeOptions(mSearchView.getImeOptions() | EditorInfo.IME_ACTION_SEARCH
              | EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_FLAG_NO_FULLSCREEN);
      mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
          @Override//  w ww.jav a 2  s  . co m
          public boolean onQueryTextSubmit(String query) {
              searchFor(query);
              return true;
          }

          @Override
          public boolean onQueryTextChange(String query) {
              if (TextUtils.isEmpty(query)) {
                  clearResults();
              }
              return true;
          }
      });
      mSearchView.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() {
          @Override
          public void onFocusChange(View v, boolean hasFocus) {

          }
      });
  }

From source file:org.akop.crosswords.view.CrosswordView.java

@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    outAttrs.actionLabel = null;// w w w  .  j  av  a2s. c om
    outAttrs.inputType = InputType.TYPE_NULL; //InputType.TYPE_CLASS_TEXT;
    outAttrs.imeOptions &= ~EditorInfo.IME_FLAG_NO_FULLSCREEN;
    outAttrs.imeOptions |= EditorInfo.IME_FLAG_NO_EXTRACT_UI;
    outAttrs.imeOptions &= ~EditorInfo.IME_MASK_ACTION;
    outAttrs.imeOptions |= EditorInfo.IME_ACTION_NEXT;
    outAttrs.packageName = getContext().getPackageName();

    CrosswordInputConnection inputConnection = new CrosswordInputConnection(this);
    inputConnection.setOnInputEventListener(mInputEventListener);

    return inputConnection;
}

From source file:org.telegram.ui.ActionBar.ActionBarMenuItem.java

public ActionBarMenuItem setIsSearchField(boolean value) {
    if (parentMenu == null) {
        return this;
    }//from w  ww  .ja v a2  s  . c o m
    if (value && searchContainer == null) {
        searchContainer = new FrameLayout(getContext());
        parentMenu.addView(searchContainer, 0);
        LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) searchContainer.getLayoutParams();
        layoutParams.weight = 1;
        layoutParams.width = 0;
        layoutParams.height = LayoutHelper.MATCH_PARENT;
        layoutParams.leftMargin = AndroidUtilities.dp(6);
        searchContainer.setLayoutParams(layoutParams);
        searchContainer.setVisibility(GONE);

        searchField = new EditText(getContext());
        searchField.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
        searchField.setHintTextColor(0x88ffffff);
        searchField.setTextColor(0xffffffff);
        searchField.setSingleLine(true);
        searchField.setBackgroundResource(0);
        searchField.setPadding(0, 0, 0, 0);
        int inputType = searchField.getInputType() | EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
        searchField.setInputType(inputType);
        searchField.setCustomSelectionActionModeCallback(new ActionMode.Callback() {
            public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
                return false;
            }

            public void onDestroyActionMode(ActionMode mode) {

            }

            public boolean onCreateActionMode(ActionMode mode, Menu menu) {
                return false;
            }

            public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
                return false;
            }
        });
        searchField.setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                if (/*actionId == EditorInfo.IME_ACTION_SEARCH || */event != null
                        && (event.getAction() == KeyEvent.ACTION_UP
                                && event.getKeyCode() == KeyEvent.KEYCODE_SEARCH
                                || event.getAction() == KeyEvent.ACTION_DOWN
                                        && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
                    AndroidUtilities.hideKeyboard(searchField);
                    if (listener != null) {
                        listener.onSearchPressed(searchField);
                    }
                }
                return false;
            }
        });
        searchField.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                if (listener != null) {
                    listener.onTextChanged(searchField);
                }
                if (clearButton != null) {
                    clearButton.setAlpha(s == null || s.length() == 0 ? 0.6f : 1.0f);
                }
            }

            @Override
            public void afterTextChanged(Editable s) {

            }
        });

        try {
            Field mCursorDrawableRes = TextView.class.getDeclaredField("mCursorDrawableRes");
            mCursorDrawableRes.setAccessible(true);
            mCursorDrawableRes.set(searchField, R.drawable.search_carret);
        } catch (Exception e) {
            //nothing to do
        }
        searchField.setImeOptions(EditorInfo.IME_FLAG_NO_FULLSCREEN | EditorInfo.IME_ACTION_SEARCH);
        searchField.setTextIsSelectable(false);
        searchContainer.addView(searchField);
        FrameLayout.LayoutParams layoutParams2 = (FrameLayout.LayoutParams) searchField.getLayoutParams();
        layoutParams2.width = LayoutHelper.MATCH_PARENT;
        layoutParams2.gravity = Gravity.CENTER_VERTICAL;
        layoutParams2.height = AndroidUtilities.dp(36);
        layoutParams2.rightMargin = AndroidUtilities.dp(48);
        searchField.setLayoutParams(layoutParams2);

        clearButton = new ImageView(getContext());
        clearButton.setImageResource(R.drawable.ic_close_white);
        clearButton.setScaleType(ImageView.ScaleType.CENTER);
        clearButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                searchField.setText("");
                searchField.requestFocus();
                AndroidUtilities.showKeyboard(searchField);
            }
        });
        searchContainer.addView(clearButton);
        layoutParams2 = (FrameLayout.LayoutParams) clearButton.getLayoutParams();
        layoutParams2.width = AndroidUtilities.dp(48);
        layoutParams2.gravity = Gravity.CENTER_VERTICAL | Gravity.RIGHT;
        layoutParams2.height = LayoutHelper.MATCH_PARENT;
        clearButton.setLayoutParams(layoutParams2);
    }
    isSearchField = value;
    return this;
}

From source file:io.plaidapp.ui.SearchActivity.java

private void setupSearchView() {
    SearchManager searchManager = (SearchManager) getSystemService(SEARCH_SERVICE);
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
    // hint, inputType & ime options seem to be ignored from XML! Set in code
    searchView.setQueryHint(getString(R.string.search_hint));
    searchView.setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS);
    searchView.setImeOptions(searchView.getImeOptions() | EditorInfo.IME_ACTION_SEARCH
            | EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_FLAG_NO_FULLSCREEN);
    searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
        @Override//  www .  j a v a  2  s . co  m
        public boolean onQueryTextSubmit(String query) {
            searchFor(query);
            return true;
        }

        @Override
        public boolean onQueryTextChange(String query) {
            if (TextUtils.isEmpty(query)) {
                clearResults();
            }
            return true;
        }
    });
    searchView.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() {
        @Override
        public void onFocusChange(View v, boolean hasFocus) {
            if (hasFocus && confirmSaveContainer.getVisibility() == View.VISIBLE) {
                hideSaveConfimation();
            }
        }
    });
}