diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-01-16 19:19:39 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-01-16 19:19:39 -0600 |
commit | 6537ff8aeddb4dd3026806aa1667527226ec902d (patch) | |
tree | dfd0e002d6279f647129658784bf4b21cbdfed0c /androidApp/src | |
parent | 8eda4b6bb96db95e4099a3f8d2fad7996dd36c47 (diff) | |
parent | 33e051ae011471e3472a69d405f805319d25bd70 (diff) | |
download | etbsa-trackermap-mobile-6537ff8aeddb4dd3026806aa1667527226ec902d.tar.gz etbsa-trackermap-mobile-6537ff8aeddb4dd3026806aa1667527226ec902d.tar.bz2 etbsa-trackermap-mobile-6537ff8aeddb4dd3026806aa1667527226ec902d.zip |
Merge branch 'main' of https://git.sr.ht/~avalos/trackermap-mobile
Diffstat (limited to 'androidApp/src')
5 files changed, 17 insertions, 1 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt index 568bd6b..e75f475 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt @@ -96,6 +96,9 @@ class UnitInformationFragment : Fragment() { unit.device.contact?.let { contact -> details.add(getString(R.string.unit_info_contact) to contact) } + unit.device.uniqueId?.let { uniqueId -> + details.add(getString(R.string.unit_info_uniqueid) to uniqueId) + } unit.position?.fixTime?.let { fixTime -> details.add(getString(R.string.unit_info_datetime) to Formatter.formatDate(fixTime)) } 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 7dae0d5..b0cc463 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" @@ -208,7 +213,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/loading_indicator" - android:visibility="visible"/> + android:visibility="invisible"/> </FrameLayout> diff --git a/androidApp/src/main/res/values-es-rMX/strings.xml b/androidApp/src/main/res/values-es-rMX/strings.xml index 182656b..0889008 100644 --- a/androidApp/src/main/res/values-es-rMX/strings.xml +++ b/androidApp/src/main/res/values-es-rMX/strings.xml @@ -67,6 +67,7 @@ <!-- Unit Information --> <string name="unit_info_contact">Contacto</string> + <string name="unit_info_uniqueid">ID único</string> <string name="unit_info_speed">Velocidad</string> <string name="unit_info_address">Dirección</string> <string name="unit_info_latitude">Latitud</string> diff --git a/androidApp/src/main/res/values/strings.xml b/androidApp/src/main/res/values/strings.xml index 1969a35..b1f87cb 100644 --- a/androidApp/src/main/res/values/strings.xml +++ b/androidApp/src/main/res/values/strings.xml @@ -80,6 +80,7 @@ <!-- Unit Information --> <string name="unit_info_contact">Contact</string> + <string name="unit_info_uniqueid">Unique ID</string> <string name="unit_info_speed">Speed</string> <string name="unit_info_address">Address</string> <string name="unit_info_latitude">Latitude</string> |