Skip to content

Instantly share code, notes, and snippets.

@patrick-elmquist
Last active November 25, 2018 19:29
Show Gist options
  • Save patrick-elmquist/4f61943d396eb0ac5e7bde3ad564cf65 to your computer and use it in GitHub Desktop.
Save patrick-elmquist/4f61943d396eb0ac5e7bde3ad564cf65 to your computer and use it in GitHub Desktop.
recyclerView.apply {
// Create and attach the adapter
adapter = ShowAdapter(tvShows)
// Configure to be a horizontal list
layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
// Attach a snap helper, more on that below
PagerSnapHelper().attachToRecyclerView(this)
// Where most of the parallax magic happens
setupParallaxScrollListener()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment