diff options
author | Isidro Henoch <imhenoch@protonmail.com> | 2022-01-02 16:14:50 -0600 |
---|---|---|
committer | Isidro Henoch <imhenoch@protonmail.com> | 2022-01-02 16:14:50 -0600 |
commit | 84fd0a97d775b88ef03c3161bbe126032ace8238 (patch) | |
tree | d61d251d95742edd9e1a9e1a50adab47757d3de6 /androidApp/src/main/java/mx | |
parent | 1c2761ac6bf1b3bb6e78fc3466c09aa6f0492de0 (diff) | |
download | etbsa-trackermap-mobile-84fd0a97d775b88ef03c3161bbe126032ace8238.tar.gz etbsa-trackermap-mobile-84fd0a97d775b88ef03c3161bbe126032ace8238.tar.bz2 etbsa-trackermap-mobile-84fd0a97d775b88ef03c3161bbe126032ace8238.zip |
Disables tab layout swipe gestures on the details activity
Diffstat (limited to 'androidApp/src/main/java/mx')
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt index 12ab79e..07a7b05 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt @@ -7,13 +7,15 @@ import com.google.android.material.tabs.TabLayoutMediator import mx.trackermap.TrackerMap.android.databinding.DetailsActivityBinding import mx.trackermap.TrackerMap.android.devices.Action -class DetailsActivity: AppCompatActivity() { +class DetailsActivity : AppCompatActivity() { + private var _binding: DetailsActivityBinding? = null private val binding get() = _binding!! private lateinit var adapter: UnitDetailsAdapter private var deviceId: Int = 0 companion object { + val DEVICE_ID_EXTRA = "device_id" val ACTION_EXTRA = "action" } @@ -42,16 +44,19 @@ class DetailsActivity: AppCompatActivity() { adapter = UnitDetailsAdapter(this, deviceId) binding.detailsPager.adapter = adapter TabLayoutMediator(binding.detailsTabs, binding.detailsPager) { tab, position -> - tab.text = when(position) { + tab.text = when (position) { 0 -> "Details" 1 -> "Reports" else -> "Commands" } }.attach() - binding.detailsPager.setCurrentItem(when(initialSection) { - Action.DETAILS -> 0 - Action.REPORTS -> 1 - else -> 2 - }, false) + binding.detailsPager.setCurrentItem( + when (initialSection) { + Action.DETAILS -> 0 + Action.REPORTS -> 1 + else -> 2 + }, false + ) + binding.detailsPager.isUserInputEnabled = false } }
\ No newline at end of file |