Skip to content

Instantly share code, notes, and snippets.

@nikolajakshic
Created March 7, 2018 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikolajakshic/a72886c026a2ed4f7709d757c3a37472 to your computer and use it in GitHub Desktop.
Save nikolajakshic/a72886c026a2ed4f7709d757c3a37472 to your computer and use it in GitHub Desktop.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
movieList = setupList();
RecAdapter adapter = new RecAdapter(movieList);
RecyclerView recyclerView = findViewById(R.id.recview);
// Removes blinks
((SimpleItemAnimator) recyclerView.getItemAnimator()).setSupportsChangeAnimations(false);
// Standard setup
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter);
recyclerView.setHasFixedSize(true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment