Search in sources :

Example 11 with SearchView

use of android.support.v7.widget.SearchView in project actor-platform by actorapp.

the class SearchViewHacker method setEditText.

public static void setEditText(SearchView searchView, int resId) {
    View autoComplete = findView(searchView, "mSearchPlate");
    autoComplete.setBackgroundResource(resId);
}
Also used : SearchView(android.support.v7.widget.SearchView) ImageView(android.widget.ImageView) View(android.view.View) AutoCompleteTextView(android.widget.AutoCompleteTextView)

Example 12 with SearchView

use of android.support.v7.widget.SearchView in project materialistic by hidroh.

the class FavoriteFragment method createSearchView.

private void createSearchView(MenuItem menuSearch) {
    final SearchView searchView = (SearchView) mActionViewResolver.getActionView(menuSearch);
    searchView.setQueryHint(getString(R.string.hint_search_saved_stories));
    searchView.setSearchableInfo(((SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE)).getSearchableInfo(getActivity().getComponentName()));
    searchView.setIconified(!mSearchViewExpanded);
    searchView.setQuery(mFilter, false);
    searchView.setOnSearchClickListener(v -> {
        mSearchViewExpanded = true;
        v.requestFocus();
    });
    searchView.setOnCloseListener(() -> {
        // trigger a dummy empty search intent, as empty query does not get submitted
        searchView.setQuery(FavoriteActivity.EMPTY_QUERY, true);
        return false;
    });
}
Also used : SearchView(android.support.v7.widget.SearchView)

Example 13 with SearchView

use of android.support.v7.widget.SearchView in project materialistic by hidroh.

the class BaseListActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    if (mIsMultiPane) {
        getMenuInflater().inflate(R.menu.menu_item_compact, menu);
    }
    if (isSearchable()) {
        getMenuInflater().inflate(R.menu.menu_search, menu);
        MenuItem menuSearch = menu.findItem(R.id.menu_search);
        SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
        SearchView searchView = (SearchView) mActionViewResolver.getActionView(menuSearch);
        searchView.setSearchableInfo(searchManager.getSearchableInfo(new ComponentName(this, SearchActivity.class)));
        searchView.setIconified(true);
        searchView.setQuery("", false);
    }
    return super.onCreateOptionsMenu(menu);
}
Also used : SearchView(android.support.v7.widget.SearchView) SearchManager(android.app.SearchManager) MenuItem(android.view.MenuItem) ComponentName(android.content.ComponentName)

Example 14 with SearchView

use of android.support.v7.widget.SearchView in project ToolBarLib by jjhesk.

the class TestOfCandyBar method onCreate.

@SuppressLint("ResourceAsColor")
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.general);
    toolbar = (Toolbar) findViewById(R.id.toolbar);
    try {
        worker = CandyBar.Builder.with(this).companyLogo(R.drawable.starz_logo).searchView(LayoutAsset.classic_3).searchBarEvents(new SimpleSearchCallBack() {

            @Override
            public void onKeySearchStartConfirm(String text) {
                Log.d("start", text);
            }

            @Override
            public void onKeySearchLetter(String text) {
                Log.d("start", text);
            }

            @Override
            public void onRestoreToNormal(ActionBar toolbar) {
                worker.showBack();
            }
        }).setNotifcationTextColor(R.color.main_background).setNotificationOffset(15).setNotificationDrawableId(R.drawable.notg).overrideIcons(R.mipmap.cross_grey, R.mipmap.ic_action_close, R.mipmap.crossmp).background(R.drawable.bottom_line).presetCountNotification(u).build(toolbar);
    } catch (Exception e) {
        e.printStackTrace();
    }
    //show title
    Button b1 = (Button) findViewById(R.id.b1);
    //how main bar
    Button b2 = (Button) findViewById(R.id.b2);
    //show search bar
    Button b3 = (Button) findViewById(R.id.b3);
    //other function
    Button b4 = (Button) findViewById(R.id.b4);
    //other function
    Button b5 = (Button) findViewById(R.id.b5);
    //other function
    Button bxx = (Button) findViewById(R.id.bxx);
    b1.setOnClickListener(this);
    b2.setOnClickListener(this);
    b3.setOnClickListener(this);
    b4.setOnClickListener(this);
    b5.setOnClickListener(this);
    bxx.setOnClickListener(this);
}
Also used : Button(android.widget.Button) ActionBar(android.support.v7.app.ActionBar) SimpleSearchCallBack(com.hkm.advancedtoolbar.V3.layout.SimpleSearchCallBack) SuppressLint(android.annotation.SuppressLint)

Example 15 with SearchView

use of android.support.v7.widget.SearchView in project ToolBarLib by jjhesk.

the class TestOfCandyBar2Icons method onCreate.

@SuppressLint("ResourceAsColor")
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.general);
    toolbar = (Toolbar) findViewById(R.id.toolbar);
    try {
        worker = CandyBar.Builder.with(this).companyLogo(R.drawable.starz_logo).searchView(LayoutAsset.classic_3).searchBarEvents(new commonSearchBarMgr() {

            @Override
            public void onKeySearchStartConfirm(String text) {
                Log.d("start", text);
            }

            @Override
            public void onKeySearchLetter(String text) {
                Log.d("start", text);
            }

            @Override
            public void onRestoreToNormal(ActionBar toolbar) {
                worker.showBack();
            }

            @Override
            public void onPressSearchButton(ActionBar toolbar) {
                Log.d("addNow", toolbar.toString());
            }
        }).setNotifcationTextColor(R.color.main_background).setNotificationOffset(15).setNotificationDrawableId(R.drawable.notg).overrideIcons(R.mipmap.ic_action_close, R.mipmap.crossmp).background(R.drawable.bottom_line).presetCountNotification(u).build(toolbar);
    } catch (Exception e) {
        e.printStackTrace();
    }
    //show title
    Button b1 = (Button) findViewById(R.id.b1);
    //how main bar
    Button b2 = (Button) findViewById(R.id.b2);
    //show search bar
    Button b3 = (Button) findViewById(R.id.b3);
    //other function
    Button b4 = (Button) findViewById(R.id.b4);
    //other function
    Button b5 = (Button) findViewById(R.id.b5);
    //other function
    Button bx = (Button) findViewById(R.id.bxx);
    bx.setText("close this App");
    b1.setOnClickListener(this);
    b2.setOnClickListener(this);
    b3.setOnClickListener(this);
    b4.setOnClickListener(this);
    b5.setOnClickListener(this);
    bx.setOnClickListener(this);
}
Also used : V3.layout.commonSearchBarMgr(com.hkm.advancedtoolbar.V3.layout.commonSearchBarMgr) Button(android.widget.Button) ActionBar(android.support.v7.app.ActionBar) SuppressLint(android.annotation.SuppressLint)

Aggregations

SearchView (android.support.v7.widget.SearchView)67 MenuItem (android.view.MenuItem)40 View (android.view.View)19 MenuItemCompat (android.support.v4.view.MenuItemCompat)13 SearchManager (android.app.SearchManager)11 RecyclerView (android.support.v7.widget.RecyclerView)10 MenuInflater (android.view.MenuInflater)10 ImageView (android.widget.ImageView)10 TextView (android.widget.TextView)10 Toolbar (android.support.v7.widget.Toolbar)8 MaterialSearchView (com.miguelcatalan.materialsearchview.MaterialSearchView)7 AdapterView (android.widget.AdapterView)6 ListView (android.widget.ListView)6 SuppressLint (android.annotation.SuppressLint)5 ActionBar (android.support.v7.app.ActionBar)5 Button (android.widget.Button)4 ComponentName (android.content.ComponentName)3 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)3 SpannableString (android.text.SpannableString)3 AutoCompleteTextView (android.widget.AutoCompleteTextView)3