aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/java/mx/trackermap/TrackerMap/android
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2021-12-17 01:57:23 -0600
committerIván Ávalos <avalos@disroot.org>2021-12-17 01:57:23 -0600
commit0c8576a60e59f9d7a2fb2044752d10e564237a4f (patch)
treea9e17d52c644693c88f66ee8f926d48ac3eabe6d /androidApp/src/main/java/mx/trackermap/TrackerMap/android
parent0db6ce4a48a64a29001395b9aa27de006c139707 (diff)
downloadetbsa-trackermap-mobile-0c8576a60e59f9d7a2fb2044752d10e564237a4f.tar.gz
etbsa-trackermap-mobile-0c8576a60e59f9d7a2fb2044752d10e564237a4f.tar.bz2
etbsa-trackermap-mobile-0c8576a60e59f9d7a2fb2044752d10e564237a4f.zip
Implemented SwipeLayout using Zerobranch's library
Diffstat (limited to 'androidApp/src/main/java/mx/trackermap/TrackerMap/android')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt24
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