You can create a preview using the namespace xmlns:tools="http://schemas.android.com/tools".
<!-- AndroidX -->
<androidx.recyclerview.widget.RecyclerView
tools:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
<!-- support -->
<android.support.v7.widget.RecyclerView
tools:layoutManager="android.support.v7.widget.GridLayoutManager"
<!-- common -->
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:itemCount="5"
tools:listitem="@layout/item"
tools:orientation="horizontal"
tools:scrollbars="horizontal"
tools:spanCount="2" />
From Android studio 3.0you can pre-define data through tools:textinitem.xml
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
tools:text="@tools:sample/last_names"
tools:textColor="@android:color/white" />
As a result, your preview will look like

More here