Example usage for android.view.inputmethod EditorInfo IME_FLAG_NO_EXTRACT_UI

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

Introduction

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

Prototype

int IME_FLAG_NO_EXTRACT_UI

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

Click Source Link

Document

Flag of #imeOptions : used to specify that the IME does not need to show its extracted text UI.

Usage

From source file:com.android.deskclock.actionbarmenu.SearchMenuItemController.java

@Override
public void setInitialState(Menu menu) {
    super.setInitialState(menu);
    final MenuItem search = menu.findItem(SEARCH_MENU_RES_ID);
    final SearchView searchView = (SearchView) MenuItemCompat.getActionView(search);
    searchView.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
    searchView.setQuery(mQuery, false);//from   w  w w .j  a v a2 s  .  c o  m
    searchView.setOnCloseListener(mSearchModeChangeListener);
    searchView.setOnSearchClickListener(mSearchModeChangeListener);
    searchView.setOnQueryTextListener(mQueryListener);
    if (mSearchMode) {
        searchView.requestFocus();
        searchView.setIconified(false);
    }
}

From source file:com.maxwen.wallpaper.board.fragments.WallpaperSearchFragment.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    inflater.inflate(R.menu.menu_wallpaper_search, menu);
    MenuItem search = menu.findItem(R.id.menu_search);
    int color = ColorHelper.getAttributeColor(getActivity(), R.attr.toolbar_icon);
    search.setIcon(DrawableHelper.getTintedDrawable(getActivity(), R.drawable.ic_toolbar_search, color));

    mSearchView = (SearchView) MenuItemCompat.getActionView(search);
    mSearchView.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_ACTION_SEARCH);
    mSearchView.setQueryHint(getActivity().getResources().getString(R.string.menu_search));
    mSearchView.setMaxWidth(Integer.MAX_VALUE);

    MenuItemCompat.expandActionView(search);
    mSearchView.setIconifiedByDefault(false);
    mSearchView.clearFocus();// www. ja v a2 s  .  co  m

    ViewHelper.changeSearchViewTextColor(mSearchView, color, ColorHelper.setColorAlpha(color, 0.6f));
    View view = mSearchView.findViewById(android.support.v7.appcompat.R.id.search_plate);
    if (view != null)
        view.setBackgroundColor(Color.TRANSPARENT);

    ImageView closeIcon = (ImageView) mSearchView
            .findViewById(android.support.v7.appcompat.R.id.search_close_btn);
    if (closeIcon != null)
        closeIcon.setImageResource(R.drawable.ic_toolbar_close);

    ImageView searchIcon = (ImageView) mSearchView
            .findViewById(android.support.v7.appcompat.R.id.search_mag_icon);
    ViewHelper.removeSearchViewSearchIcon(searchIcon);

    mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

        @Override
        public boolean onQueryTextChange(String string) {
            filterSearch(string);
            return true;
        }

        @Override
        public boolean onQueryTextSubmit(String string) {
            mSearchView.clearFocus();
            return true;
        }
    });
}

From source file:com.dm.material.dashboard.candybar.fragments.FAQsFragment.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    inflater.inflate(R.menu.menu_search, menu);
    MenuItem search = menu.findItem(R.id.menu_search);
    int color = ColorHelper.getAttributeColor(getActivity(), R.attr.toolbar_icon);

    SearchView searchView = (SearchView) MenuItemCompat.getActionView(search);
    searchView.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
    searchView.setQueryHint(getActivity().getResources().getString(R.string.search_faqs));
    searchView.setMaxWidth(Integer.MAX_VALUE);

    ViewHelper.changeSearchViewTextColor(searchView, color, ColorHelper.setColorAlpha(color, 0.6f));
    View view = searchView.findViewById(android.support.v7.appcompat.R.id.search_plate);
    if (view != null)
        view.setBackgroundColor(Color.TRANSPARENT);

    searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

        @Override/*from  www  . j a  va  2  s.  co m*/
        public boolean onQueryTextChange(String string) {
            filterSearch(string);
            return true;
        }

        @Override
        public boolean onQueryTextSubmit(String string) {
            searchView.clearFocus();
            return true;
        }
    });
    super.onCreateOptionsMenu(menu, inflater);
}

From source file:com.dm.material.dashboard.candybar.fragments.IconsSearchFragment.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.menu_icons_search, menu);
    MenuItem search = menu.findItem(R.id.menu_search);

    mSearchView = (SearchView) MenuItemCompat.getActionView(search);
    mSearchView.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_ACTION_SEARCH);
    mSearchView.setQueryHint(getActivity().getResources().getString(R.string.search_icon));
    mSearchView.setMaxWidth(Integer.MAX_VALUE);

    MenuItemCompat.expandActionView(search);
    mSearchView.setIconifiedByDefault(false);
    mSearchView.clearFocus();//www  .  ja va 2s.  co  m

    int color = ColorHelper.getAttributeColor(getActivity(), R.attr.toolbar_icon);
    ViewHelper.changeSearchViewTextColor(mSearchView, color, ColorHelper.setColorAlpha(color, 0.6f));
    View view = mSearchView.findViewById(android.support.v7.appcompat.R.id.search_plate);
    if (view != null)
        view.setBackgroundColor(Color.TRANSPARENT);

    ImageView closeIcon = (ImageView) mSearchView
            .findViewById(android.support.v7.appcompat.R.id.search_close_btn);
    if (closeIcon != null)
        closeIcon.setImageResource(R.drawable.ic_toolbar_close);

    ImageView searchIcon = (ImageView) mSearchView
            .findViewById(android.support.v7.appcompat.R.id.search_mag_icon);
    ViewHelper.removeSearchViewSearchIcon(searchIcon);

    mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

        @Override
        public boolean onQueryTextChange(String string) {
            filterSearch(string);
            return true;
        }

        @Override
        public boolean onQueryTextSubmit(String string) {
            mSearchView.clearFocus();
            return true;
        }
    });
}

From source file:org.tanrabad.team.ChatFragment.java

private void initUiComponents(View rootView) {
    mListView = (ListView) rootView.findViewById(R.id.list);
    turnOffListViewDecoration(mListView);
    mListView.setAdapter(mAdapter);//from   www  .j a  v  a 2  s  .com

    mBtnChannel = (ImageButton) rootView.findViewById(R.id.btn_channel);
    mBtnSend = (Button) rootView.findViewById(R.id.btn_send);
    mBtnUpload = (ImageButton) rootView.findViewById(R.id.btn_upload);
    mProgressBtnUpload = (ProgressBar) rootView.findViewById(R.id.progress_btn_upload);
    mEtxtMessage = (EditText) rootView.findViewById(R.id.etxt_message);

    mBtnSend.setEnabled(false);
    mBtnSend.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            send();
        }
    });

    mBtnChannel.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (mHandler != null) {
                mHandler.onChannelListClicked();
            }
        }
    });

    mBtnUpload.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent();
            intent.setType("image/*");
            intent.setAction(Intent.ACTION_GET_CONTENT);
            startActivityForResult(Intent.createChooser(intent, "Select Picture"), REQUEST_PICK_IMAGE);
        }
    });

    mEtxtMessage.setOnKeyListener(new View.OnKeyListener() {
        @Override
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_ENTER) {
                if (event.getAction() == KeyEvent.ACTION_DOWN) {
                    send();
                }
                return true; // Do not hide keyboard.
            }
            return false;
        }
    });
    mEtxtMessage.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
    mEtxtMessage.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) {

        }

        @Override
        public void afterTextChanged(Editable s) {
            mBtnSend.setEnabled(s.length() > 0);
        }
    });
    mListView.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            SoftKeyboard.hide(getActivity());
            return false;
        }
    });
    mListView.setOnScrollListener(new AbsListView.OnScrollListener() {
        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {
            if (scrollState == SCROLL_STATE_IDLE) {
                if (view.getFirstVisiblePosition() == 0 && view.getChildCount() > 0
                        && view.getChildAt(0).getTop() == 0) {
                    resultHandler = new MessageListQuery.MessageListQueryResult() {
                        @Override
                        public void onResult(List<MessageModel> messageModels) {
                            for (MessageModel model : messageModels) {
                                mAdapter.addMessageModel(model);
                            }

                            mAdapter.notifyDataSetChanged();
                            mListView.setSelection(messageModels.size());
                        }

                        @Override
                        public void onError(Exception e) {
                        }
                    };
                    SendBird.queryMessageList(SendBird.getChannelUrl()).prev(mAdapter.getMinMessageTimestamp(),
                            30, resultHandler);
                }
            }
        }

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
        }
    });
}

From source file:com.cerema.cloud2.ui.fragment.SearchShareesFragment.java

/**
 * {@inheritDoc}//w ww.  ja v  a 2  s .  c  om
 */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.search_users_groups_layout, container, false);

    // Get the SearchView and set the searchable configuration
    SearchView searchView = (SearchView) view.findViewById(R.id.searchView);
    SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE);
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getActivity().getComponentName()) // assumes parent activity is the searchable activity
    );
    searchView.setIconifiedByDefault(false); // do not iconify the widget; expand it by default

    searchView.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI); // avoid fullscreen with softkeyboard

    searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
        @Override
        public boolean onQueryTextSubmit(String query) {
            Log_OC.v(TAG, "onQueryTextSubmit intercepted, query: " + query);
            return true; // return true to prevent the query is processed to be queried;
            // a user / group will be picked only if selected in the list of suggestions
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            return false; // let it for the parent listener in the hierarchy / default behaviour
        }
    });

    return view;
}

From source file:com.dm.wallpaper.board.fragments.WallpaperSearchFragment.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.menu_wallpaper_search, menu);
    MenuItem search = menu.findItem(R.id.menu_search);
    int color = ColorHelper.getAttributeColor(getActivity(), R.attr.toolbar_icon);
    search.setIcon(DrawableHelper.getTintedDrawable(getActivity(), R.drawable.ic_toolbar_search, color));

    mSearchView = (SearchView) MenuItemCompat.getActionView(search);
    mSearchView.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_ACTION_SEARCH);
    mSearchView.setQueryHint(getActivity().getResources().getString(R.string.menu_search));
    mSearchView.setMaxWidth(Integer.MAX_VALUE);

    MenuItemCompat.expandActionView(search);
    mSearchView.setIconifiedByDefault(false);
    mSearchView.clearFocus();//from  w  w w . ja v  a  2s  . c  o m

    ViewHelper.setSearchViewTextColor(mSearchView, color);
    ViewHelper.setSearchViewBackgroundColor(mSearchView, Color.TRANSPARENT);
    ViewHelper.setSearchViewCloseIcon(mSearchView, R.drawable.ic_toolbar_close);
    ViewHelper.setSearchViewSearchIcon(mSearchView, null);

    mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

        @Override
        public boolean onQueryTextChange(String string) {
            filterSearch(string);
            return true;
        }

        @Override
        public boolean onQueryTextSubmit(String string) {
            mSearchView.clearFocus();
            return true;
        }
    });
}

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:com.dm.wallpaper.board.fragments.CategoryWallpapersFragment.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.menu_wallpaper_search_sort, menu);
    MenuItem search = menu.findItem(R.id.menu_search);
    MenuItem sort = menu.findItem(R.id.menu_sort);

    int color = ColorHelper.getAttributeColor(getActivity(), R.attr.toolbar_icon);
    search.setIcon(DrawableHelper.getTintedDrawable(getActivity(), R.drawable.ic_toolbar_search, color));
    sort.setIcon(DrawableHelper.getTintedDrawable(getActivity(), R.drawable.ic_toolbar_sort, color));

    mSearchView = (SearchView) search.getActionView();
    mSearchView.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_ACTION_SEARCH);
    mSearchView.setQueryHint(getActivity().getResources().getString(R.string.menu_search));
    mSearchView.setMaxWidth(Integer.MAX_VALUE);

    ViewHelper.setSearchViewTextColor(mSearchView, color);
    ViewHelper.setSearchViewBackgroundColor(mSearchView, Color.TRANSPARENT);
    ViewHelper.setSearchViewCloseIcon(mSearchView,
            DrawableHelper.getTintedDrawable(getActivity(), R.drawable.ic_toolbar_close, color));
    ViewHelper.setSearchViewSearchIcon(mSearchView, null);

    mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

        @Override/*from   www.ja v a  2  s .  co m*/
        public boolean onQueryTextChange(String string) {
            filterSearch(string);
            return true;
        }

        @Override
        public boolean onQueryTextSubmit(String string) {
            mSearchView.clearFocus();
            return true;
        }
    });
}

From source file:com.discord.chipsview.ChipsView.java

private void init() {
    mDensity = getResources().getDisplayMetrics().density;

    mChipsContainer = new RelativeLayout(getContext());
    addView(mChipsContainer);/*from   w  w  w  .  j a  va2 s  .  c o  m*/

    // Dummy item to prevent AutoCompleteTextView from receiving focus
    LinearLayout linearLayout = new LinearLayout(getContext());
    ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(0, 0);
    linearLayout.setLayoutParams(params);
    linearLayout.setFocusable(true);
    linearLayout.setFocusableInTouchMode(true);

    mChipsContainer.addView(linearLayout);

    mEditText = new ChipsEditText(getContext(), this);

    final int chipHeightWithPadding = (int) ((CHIP_HEIGHT * mDensity) + mVerticalSpacing);

    RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
            RelativeLayout.LayoutParams.MATCH_PARENT, chipHeightWithPadding);
    layoutParams.leftMargin = (int) (5 * mDensity);
    layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
    mEditText.setLayoutParams(layoutParams);
    mEditText.setPadding(0, 0, 0, mVerticalSpacing);
    mEditText.setBackgroundColor(Color.argb(0, 0, 0, 0));
    mEditText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
    mEditText.setInputType(InputType.TYPE_CLASS_TEXT);
    mEditText.setTextColor(mChipsSearchTextColor);
    mEditText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mChipsSearchTextSize);

    mChipsContainer.addView(mEditText);

    mRootChipsLayout = new ChipsVerticalLinearLayout(getContext(), chipHeightWithPadding);
    mRootChipsLayout.setOrientation(LinearLayout.VERTICAL);
    mRootChipsLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.WRAP_CONTENT));
    mRootChipsLayout.setPadding(0, (int) (SPACING_TOP * mDensity), 0, 0);
    mChipsContainer.addView(mRootChipsLayout);

    initListener();
    onChipsChanged(false);
}