一个包含可滚动以显示更多内容的 Android RecyclerView 列表
An Android RecyclerView List with items that can scroll to reveal more content on the side. This view has been inspired by the one found in the Reddit News App.
[]
The view has been created using standard views now available with Android Lollipop and its compatibility libraries. The list is a RecyclerView with a LinearLayoutManager. Each item in the list is essentially a ViewPager with two views; a CardView and FrameLayout with three buttons.
Everything else can be used normally except the RecyclerViewAdapter.java where most of the work is required.
The challenges were as follows:
1) The ViewPager does not inflate properly inside the RecyclerView.
In order to solve this, the width of the ViewPager was manually set to the current width of the screen when it inflates inside the adapter. The height should be specified manaully and wrap_content attribute cannot be used.
2) The ViewPagers do not retain state as the list items are scrolled away from current view and back.
In order to solve this problem, the RecyclerViewAdapter holds a list of states for each of the ViewPager and sets them back when a previously modified item comes back in view.
…暂无开放 Issues,或尚未同步最近议题。