diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-01-16 19:19:08 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-01-16 19:19:08 -0600 |
commit | 67b9ab757d3017e29eaf489f824c6130871c6762 (patch) | |
tree | 16facd10f595d6a5c77a82322bc3fbbc8089c16e /androidApp/src/main | |
parent | f5764a13e61af80c55f0b10ec0b06d3cbb296fc6 (diff) | |
download | etbsa-trackermap-mobile-67b9ab757d3017e29eaf489f824c6130871c6762.tar.gz etbsa-trackermap-mobile-67b9ab757d3017e29eaf489f824c6130871c6762.tar.bz2 etbsa-trackermap-mobile-67b9ab757d3017e29eaf489f824c6130871c6762.zip |
Hide device limit when <= 0, and show device unique ID on details view
Diffstat (limited to 'androidApp/src/main')
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt | 6 | ||||
-rw-r--r-- | androidApp/src/main/res/layout/user_information_activity.xml | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt index 13deed0..a3c6fd6 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt @@ -64,6 +64,12 @@ class UserInformationActivity : AppCompatActivity() { idInfo.text = "${user.id ?: "--"}" deviceLimitInfo.text = "${user.deviceLimit ?: "--"}" adminInfo.text = "${user.administrator}" + user.deviceLimit?.let { + if (it <= 0) { + adminInfoLabel.visibility = View.GONE + adminInfo.visibility = View.GONE + } + } } } } diff --git a/androidApp/src/main/res/layout/user_information_activity.xml b/androidApp/src/main/res/layout/user_information_activity.xml index bc81b20..252505f 100644 --- a/androidApp/src/main/res/layout/user_information_activity.xml +++ b/androidApp/src/main/res/layout/user_information_activity.xml @@ -60,6 +60,7 @@ android:textAppearance="@style/TextAppearance.AppCompat.Headline"/> <TextView + android:id="@+id/usernameInfoLabel" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/username" @@ -73,6 +74,7 @@ tools:text="Username" /> <TextView + android:id="@+id/emailInfoLabel" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/email" @@ -86,6 +88,7 @@ tools:text="Email" /> <TextView + android:id="@+id/idInfoLabel" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/unique_id" @@ -99,6 +102,7 @@ tools:text="Unique ID" /> <TextView + android:id="@+id/deviceLimitInfoLabel" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/device_limit" @@ -112,6 +116,7 @@ tools:text="Device Limit" /> <TextView + android:id="@+id/adminInfoLabel" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/admin" @@ -207,7 +212,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/loading_indicator" - android:visibility="visible"/> + android:visibility="invisible"/> </FrameLayout> |