aboutsummaryrefslogtreecommitdiff
path: root/androidApp
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-14 03:05:35 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-14 03:05:35 -0600
commit507d6d03561b809ab8507c70443aeba63e3a29e6 (patch)
treee4a64f54472004dcd438681853c918dfba50f565 /androidApp
parent81a0b6689e94b8a10ebf68dccbb94a1f11507487 (diff)
downloadetbsa-trackermap-mobile-507d6d03561b809ab8507c70443aeba63e3a29e6.tar.gz
etbsa-trackermap-mobile-507d6d03561b809ab8507c70443aeba63e3a29e6.tar.bz2
etbsa-trackermap-mobile-507d6d03561b809ab8507c70443aeba63e3a29e6.zip
Loading indicator for commands fragment
Diffstat (limited to 'androidApp')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt1
-rw-r--r--androidApp/src/main/res/layout/unit_details_commands.xml11
2 files changed, 12 insertions, 0 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt
index 90968e2..fa6a37a 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt
@@ -47,6 +47,7 @@ class UnitCommandsFragment: Fragment() {
private fun setupObservers() {
unitCommandsViewModel.commands.observe(viewLifecycleOwner) { commands ->
Log.d("UnitCommandsFragment", "Device commands - $commands")
+ binding.reportLoading.visibility = View.GONE
val context = activity!!.applicationContext
val adapter = ArrayAdapter<String>(context, R.layout.simple_list_item_checked)
adapter.addAll(commands.map { it.description })
diff --git a/androidApp/src/main/res/layout/unit_details_commands.xml b/androidApp/src/main/res/layout/unit_details_commands.xml
index 6b554cc..3616f75 100644
--- a/androidApp/src/main/res/layout/unit_details_commands.xml
+++ b/androidApp/src/main/res/layout/unit_details_commands.xml
@@ -6,6 +6,17 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
+ <ProgressBar
+ android:id="@+id/reportLoading"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/margin"
+ android:translationZ="9dp"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
<com.google.android.material.card.MaterialCardView
android:id="@+id/commandsCard"
android:layout_width="0dp"