Skip to content

Instantly share code, notes, and snippets.

View keyrunHORNET's full-sized avatar
🎸

Kiran Gyawali keyrunHORNET

🎸
View GitHub Profile
@keyrunHORNET
keyrunHORNET / row_list_item
Created November 28, 2019 04:11
row item of a recycler view
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:id="@+id/llHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/black"
android:orientation="vertical">
@keyrunHORNET
keyrunHORNET / fragment_recycler_view.xml
Last active November 28, 2019 04:09
sample recycler view xml
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/myRecyclerView"
@keyrunHORNET
keyrunHORNET / adapterGeneric.java
Created November 28, 2019 03:45
Implementation of a generic adapter using a library
GenericAdapter myAdapter = new GenericAdapter<>(stringList, R.layout.row_list_child_item,
new GenericRecyclerCallBack<RowListChildItemBinding, String>() {
*//**
* @param binding viewBinding of a row in a recycler view
* @param item object of a row in a recycler view
* @param allItem list of all items in a recycler view
* @param itemPosition position of an item in a recycler view
*//*
@Override
public void bindData(RowListChildItemBinding binding, String item, List<String> allItem, int itemPosition) {