Exemplo n.º 1
0
 // Recherche dynamique
 @Override
 public boolean onQueryTextChange(String query) {
   noms = bdd.getNoms();
   final List<ContenuListe> filteredModelList = filter(noms, query);
   recAdapter.animateTo(filteredModelList);
   listView.scrollToPosition(0);
   return true;
 }
Exemplo n.º 2
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_liste_fiche);
   getSupportActionBar().setDisplayShowHomeEnabled(true);
   getSupportActionBar().setDisplayHomeAsUpEnabled(true);
   noms = bdd.getNoms();
   listView = (RecyclerView) findViewById(R.id.listeBiens);
   listView.setLayoutManager(new LinearLayoutManager(this));
   listView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
   recAdapter = new ContenuListAdapter(this.getLayoutInflater(), noms);
   listView.setAdapter(recAdapter);
 }