diff options
author | Iván Ávalos <avalos@disroot.org> | 2021-12-17 01:57:23 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2021-12-17 01:57:23 -0600 |
commit | 090bcc911e569040ceeaef29f7ca8db82694d9b0 (patch) | |
tree | 00a4f17161cb3727b682f58d428f4db5df38566e /androidApp/src/main/java | |
parent | 11d65c96a409b07ef8270cea2984109fffd04a8d (diff) | |
download | etbsa-trackermap-mobile-090bcc911e569040ceeaef29f7ca8db82694d9b0.tar.gz etbsa-trackermap-mobile-090bcc911e569040ceeaef29f7ca8db82694d9b0.tar.bz2 etbsa-trackermap-mobile-090bcc911e569040ceeaef29f7ca8db82694d9b0.zip |
Implemented SwipeLayout using Zerobranch's library
Diffstat (limited to 'androidApp/src/main/java')
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt | 24 |
1 files changed, 1 insertions, 23 deletions
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 |