Challenge: An empty view for the RecyclerView

I made the recyclerview within a constrained layout… and inserted an (Invisible) imagebutton above it in the middle… all inside the same fragment_crime_list.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent">

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/crime_recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:layout_editor_absoluteX="0dp"
        tools:layout_editor_absoluteY="-130dp" />

    <ImageButton
        android:id="@+id/imageButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="@+id/crime_recycler_view"
        app:layout_constraintTop_toTopOf="@+id/crime_recycler_view"
        app:srcCompat="@drawable/ic_menu_add"
        android:visibility="invisible"/>


</androidx.constraintlayout.widget.ConstraintLayout>

inside the UpdateUI i set a condition if crimes.isEmpty()

 private fun updateUI(crimes: List<Crime>) {
    if (crimes.isEmpty()){
        imageButton = view?.findViewById(R.id.imageButton) as ImageButton
        imageButton.setVisibility(View.VISIBLE)
        imageButton.setOnClickListener{
                    val crime = Crime()
                    crimeListViewModel.addCrime(crime)
                    callbacks?.onCrimeSelected(crime.id)
        }
    } else{
        adapter = CrimeAdapter(crimes)
        crimeRecyclerView.adapter = adapter
    }

}