Search in sources :

Example 1 with AppBlacklistAdapter

use of nodomain.freeyourgadget.gadgetbridge.adapter.AppBlacklistAdapter in project Gadgetbridge by Freeyourgadget.

the class AppBlacklistActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_appblacklist);
    RecyclerView appListView = (RecyclerView) findViewById(R.id.appListView);
    appListView.setLayoutManager(new LinearLayoutManager(this));
    appBlacklistAdapter = new AppBlacklistAdapter(R.layout.item_app_blacklist, this);
    appListView.setAdapter(appBlacklistAdapter);
    SearchView searchView = (SearchView) findViewById(R.id.appListViewSearch);
    searchView.setIconifiedByDefault(false);
    searchView.setIconified(false);
    searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

        @Override
        public boolean onQueryTextSubmit(String query) {
            return false;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            appBlacklistAdapter.getFilter().filter(newText);
            return true;
        }
    });
}
Also used : SearchView(androidx.appcompat.widget.SearchView) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) AppBlacklistAdapter(nodomain.freeyourgadget.gadgetbridge.adapter.AppBlacklistAdapter)

Aggregations

SearchView (androidx.appcompat.widget.SearchView)1 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 AppBlacklistAdapter (nodomain.freeyourgadget.gadgetbridge.adapter.AppBlacklistAdapter)1