From 090bcc911e569040ceeaef29f7ca8db82694d9b0 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Fri, 17 Dec 2021 01:57:23 -0600 Subject: Implemented SwipeLayout using Zerobranch's library --- .../TrackerMap/android/devices/DevicesAdapter.kt | 24 +--------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'androidApp/src/main/java/mx/trackermap/TrackerMap') diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt index c54e8bf..4852757 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt @@ -32,8 +32,6 @@ class DevicesAdapter( } override fun onBindViewHolder(holder: ViewHolder, position: Int) { - holder.toggleOptions(false) - val unit = units[position] val context = holder.itemView.context holder.binding.apply { @@ -86,25 +84,5 @@ class DevicesAdapter( override fun getItemCount(): Int = units.size - inner class ViewHolder(val binding: UnitItemBinding) : RecyclerView.ViewHolder(binding.root) { - init { - binding.unitCard.setOnLongClickListener { - toggleOptions(binding.itemOptions.visibility == View.GONE) - true - } - } - - fun toggleOptions(shouldExpand: Boolean) { - val context = binding.root.context - binding.unitCard.setCardBackgroundColor( - ResourcesCompat.getColor( - context.resources, - if (shouldExpand) R.color.background else R.color.darkBackground, - context.theme - ) - ) - binding.itemOptions.visibility = if (shouldExpand) View.VISIBLE else View.GONE - binding.unitCard.cardElevation = if (shouldExpand) 5.0F else 0.0F - } - } + inner class ViewHolder(val binding: UnitItemBinding) : RecyclerView.ViewHolder(binding.root) } \ No newline at end of file -- cgit v1.2.3