Last active
November 15, 2019 02:32
-
-
Save john-lorrenz/e6a21017c91ee4d66f65c2266fd0be5e to your computer and use it in GitHub Desktop.
Basic Groupie Recycler View
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implementation "com.xwray:groupie:2.5.0" | |
implementation 'androidx.recyclerview:recyclerview:1.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onCreate(savedInstanceState: Bundle?) { | |
reycler_view.isNestedScrollingEnabled = true | |
reycler_view.layoutManager = LinearLayoutManager(this) | |
var adapter = GroupAdapter<ViewHolder>() | |
adapter.add(storyItem()) | |
adapter.add(storyItem()) | |
adapter.add(storyItem()) | |
adapter.add(storyItem()) | |
reycler_view.adapter = adapter | |
} | |
inner class storyItem(): Item<ViewHolder>() { | |
override fun bind(viewHolder: ViewHolder, position: Int) { | |
} | |
override fun getLayout(): Int { | |
return R.layout.row_story | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<androidx.recyclerview.widget.RecyclerView | |
android:id="@+id/reycler_view" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:orientation="horizontal" | |
android:fadeScrollbars="false"/> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment