Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 26, 2019 15:48
Show Gist options
  • Save parzibyte/ce9279047a901db87ebfd69d04110ca9 to your computer and use it in GitHub Desktop.
Save parzibyte/ce9279047a901db87ebfd69d04110ca9 to your computer and use it in GitHub Desktop.
// Configuramos cómo se van a organizar las vistas dentro del RecyclerView; simplemente es un LinearLayout para que
// aparezcan una debajo de otra
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(MainActivity.this);
recyclerViewMascotas.setLayoutManager(linearLayoutManager);
// La línea que divide los elementos
recyclerViewMascotas.addItemDecoration(new DividerItemDecoration(MainActivity.this, LinearLayoutManager.VERTICAL));
// El adaptador que se encarga de toda la lógica
recyclerViewMascotas.setAdapter(adaptadorRecyclerView);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment