<?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 =“match_parent”
android:paddingBottom =“14dp”
android:orientation =“vertical”> <textView android:layout_width =“match_parent” android:layout_height =“wrap_content” android:padding =“ 14dp” android:textSize “ android:textSize ” android:textSize “ android:textAppearance.AppCompat” android:textSize =“16sp”/> <查看 android:layout_width =“match_parent” android:layout_height =“0.6dp” android:background =“#ddd”/> <TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp"
android:paddingStart="14dp"
android:text="分享文本信息到..."
android:textAppearance="@style/TextAppearance.AppCompat"
android:textSize="14sp"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_appList"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
RecyclerView单个子项使用的布局item_app.xml
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="8dp">
<ImageView
android:id="@+id/iv_appIcon"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@mipmap/ic_launcher"/>
<TextView
android:id="@+id/tv_appName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:ellipsize="end"
android:maxLength="6"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_appIcon"
tools:text="之乎者也"/>
RecyclerView 配套使用的 Adapter :AppShareAdapter
公共类AppShareAdapter延伸RecyclerView.Adapter