title: How to implement, drag and drop and swipe to delete in recyclerview?
body: <p>Hi I'm new to Kotlin I have almost 1 month programming in it, I have one recycler I'm trying to re order the cardviews in the recycler and delete the ones that I don't need by swipping it, how can I achieve this? could it be done with a library? I couldn't find one</p>
  
  <p>this is what I have:</p>
  
  <p><strong>Adapter</strong></p>
  
  <pre><code>    open class EmployeesAdapter(var context: Context, var employee:ArrayList&lt;EmployeesTest&gt;):BaseAdapter() {
  
      private class ViewHolder(row: View?) {
  
          var txt_user: TextView
          var user_job: TextView
          var img_user: ImageView
          var checBox: CheckBox
  
          init {
              this.txt_user = row?.findViewById(R.id.txt_user) as TextView
              this.img_user = row.findViewById(R.id.img_user) as ImageView
              this.user_job = row.findViewById(R.id.user_job) as TextView
              this.checBox = row.findViewById(R.id.checkBox) as CheckBox
  
  
          }
      }
  
      override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
  
          var view: View
          var viewHolder: ViewHolder
          if (convertView == null) {
              var layout = LayoutInflater.from(context)
              view = layout.inflate(R.layout.employee_list_item, parent, false)
              viewHolder = ViewHolder(view)
              view.tag = viewHolder
          } else {
              view = convertView
              viewHolder = view.tag as ViewHolder
          }
          var employees:EmployeesTest=getItem(position) as EmployeesTest
          viewHolder.txt_user.text = employees.nombre
          viewHolder.img_user.setImageResource(employees.profilePic)
          viewHolder.user_job.text = employees.cargo
          viewHolder.checBox.isChecked = false
  
          return view
  
      }
  
      override fun getItem(position: Int): Any {
          return employee[position]
      }
  
      override fun getItemId(position: Int): Long {
          return  position.toLong()
      }
  
      override fun getCount(): Int {
          return employee.count()
      }
  }
  </code></pre>
  
  <p><strong>Activity</strong></p>
  
  <pre><code>    class EditEmployeeFragment : Fragment() {
      var tv_name: TextView? = null
      var rel_main: RelativeLayout? = null
  
  
      override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
          var view:View?=inflater!!.inflate(R.layout.edit_employee_fragment,container,false)
  
          var arrReports: ArrayList&lt;EmployeesTest&gt;? = ArrayList()
          arrReports?.add(EmployeesTest("Heber","Desarrollador",R.drawable.img_user))
          arrReports?.add(EmployeesTest("Mata","Desarrollador",R.drawable.img_user))
          arrReports?.add(EmployeesTest("Ernesto","Desarrollador",R.drawable.img_user))
          arrReports?.add(EmployeesTest("Toño","Desarrollador",R.drawable.img_user))
  
          var recyclerView:RecyclerView=view?.findViewById(R.id.recycler_edit_employees) as RecyclerView
          recyclerView.layoutManager = LinearLayoutManager(this.context, LinearLayout.VERTICAL, false)
          recyclerView.adapter = EditEmployeesAdapter( arrReports!!)
          return view
      }
  
  }
  </code></pre>
  
  <p>thank you for your kind help</p>