aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/java/mx/trackermap/TrackerMap
diff options
context:
space:
mode:
Diffstat (limited to 'androidApp/src/main/java/mx/trackermap/TrackerMap')
-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