In The below example I have created a recyclerview app, in this app I have used CardView. First I have added I have added first RecyclerView , CardView and design support library in build.gradle file .Now I havecreated RecyclerView and FloatingActionButton within Framelayout in main_activity.xml layout, In next step i have created a new dialog.xml layout here I have added TextView, EditView, Button and Spinner. After then in fourth step I have created a new item.xml layout here I have added CardView, ImageView and TextView. Now see programming area here I have created emp class and MyAdapter class within MyAdapter class I have created ViewHolder class and In MainActivity I have used DialogBox fuction. You can see below program it will clearly describe you how to add floating action button with RecyclerView xml layout in android.
Step(1)-I have added RecyclerView, CardView and design library in build.gradle file -