recyclerview android code example

Example 1: androidx recyclerview dependency

dependencies {
    implementation "androidx.recyclerview:recyclerview:1.1.0"
    // For control over item selection of both touch and mouse driven selection
    implementation "androidx.recyclerview:recyclerview-selection:1.1.0-rc01"
}

Example 2: recyclerview library

implementation "androidx.recyclerview:recyclerview:1.1.0"

Example 3: recyclerview dependency

implementation 'com.android.support:recyclerview-v7:23.1.1'

Example 4: how to add recyclerview support in android studio

dependencies {
    implementation 'com.android.support:recyclerview-v7:28.0.0'
}

Example 5: add textview to recyclerview

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <ScrollView
        android:id="@+id/childScroll"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <TextView
            android:id="@+id/description"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </ScrollView>

    <TextView
        android:id="@+id/solutions"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>

Example 6: RECYCLER VIEW

Elective Subjects Notes

Tags:

Java Example