aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/java
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-13 01:13:44 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-13 01:13:44 -0600
commit3801314f39e4d10b0df07deb4102ccb03f105459 (patch)
tree7d444b4f20a4033f4052da303f143393a836be7b /androidApp/src/main/java
parent74aa997702a4315b574c5ee49cf0404ed8df7d0d (diff)
downloadetbsa-trackermap-mobile-3801314f39e4d10b0df07deb4102ccb03f105459.tar.gz
etbsa-trackermap-mobile-3801314f39e4d10b0df07deb4102ccb03f105459.tar.bz2
etbsa-trackermap-mobile-3801314f39e4d10b0df07deb4102ccb03f105459.zip
Enable user input on DetailsActivity only for details and commands tabs
Diffstat (limited to 'androidApp/src/main/java')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt14
1 files changed, 13 insertions, 1 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 504cac8..0b0313b 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
@@ -3,6 +3,7 @@ package mx.trackermap.TrackerMap.android.details
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
+import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
import mx.trackermap.TrackerMap.android.R
import mx.trackermap.TrackerMap.android.databinding.DetailsActivityBinding
@@ -57,6 +58,17 @@ class DetailsActivity : AppCompatActivity() {
else -> 2
}, false
)
- binding.detailsPager.isUserInputEnabled = false
+ binding.detailsTabs.addOnTabSelectedListener(object: TabLayout.OnTabSelectedListener {
+ override fun onTabSelected(tab: TabLayout.Tab?) {
+ binding.detailsPager.isUserInputEnabled =
+ when (tab?.position) {
+ 0 -> true
+ 1 -> false
+ else -> true
+ }
+ }
+ override fun onTabUnselected(tab: TabLayout.Tab?) {}
+ override fun onTabReselected(tab: TabLayout.Tab?) {}
+ })
}
} \ No newline at end of file