Android two way scroll interface

Omar A Landgrave
2 min readFeb 28, 2018

After wrote my last iOS medium it came to my mind an experiment using nested recycler views to have two way scroll interface. The general idea behind is using LinearLayoutManager (vertical and horizontal).

Lets start first creating a ConstraintLayout to adding our external Recycler view with his constraints. Creating a constraint with ConstraintSet.START will help our view to support internationalization.

We need two layouts, one for holding the nested recycler view and the other that will hold the content. For now we just going to add a generic view.

Next will be define the adapters behave, when onCreateViewHolder is being call lets inflate the layout with the inner recycler view. For each position we are going to generate random colors and using it to change the background of the generic view.

I left two adapters but we also can create a custom one subclassing for RecyclerView.Adapter and adapting the parameters but I will left that for other medium. At the end we are going to have the two way scroll app with different colors selected random. Don’t hesitate on comment and leave any comments.

Thanks for the reading.

Kotlin version

--

--

Omar A Landgrave

Mobile developer. A man provided with paper, pencil, and rubber, and subject to strict discipline, is in effect a universal machine.