aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-13 00:40:40 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-13 00:40:40 -0600
commit430e643ec7aefd7a2bb51bc4d6dfa6c71cac42cd (patch)
treec55d168a42011cf18a94540ad2bba646c22e5474
parent2bdf011e61db6899a3a44a5357a0100b045767f9 (diff)
downloadetbsa-trackermap-mobile-430e643ec7aefd7a2bb51bc4d6dfa6c71cac42cd.tar.gz
etbsa-trackermap-mobile-430e643ec7aefd7a2bb51bc4d6dfa6c71cac42cd.tar.bz2
etbsa-trackermap-mobile-430e643ec7aefd7a2bb51bc4d6dfa6c71cac42cd.zip
Finished and redesigned UserInformationActivity and added About section
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt2
-rw-r--r--androidApp/src/main/res/drawable/icon_back.xml11
-rw-r--r--androidApp/src/main/res/layout/user_information_activity.xml312
-rw-r--r--androidApp/src/main/res/values/dimen.xml1
4 files changed, 197 insertions, 129 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 12ea352..f5a1e13 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
@@ -103,7 +103,7 @@ class UnitInformationFragment : Fragment() {
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
- params.setMargins(0, 0, 0, resources.getDimensionPixelSize(R.dimen.padding))
+ params.setMargins(0, 0, 0, resources.getDimensionPixelSize(R.dimen.fields_spacing))
layout.layoutParams = params
val text1 = TextView(context)
diff --git a/androidApp/src/main/res/drawable/icon_back.xml b/androidApp/src/main/res/drawable/icon_back.xml
new file mode 100644
index 0000000..2a31b2e
--- /dev/null
+++ b/androidApp/src/main/res/drawable/icon_back.xml
@@ -0,0 +1,11 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:tint="?attr/colorControlNormal"
+ android:autoMirrored="true">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
+</vector>
diff --git a/androidApp/src/main/res/layout/user_information_activity.xml b/androidApp/src/main/res/layout/user_information_activity.xml
index 8bb994a..0b4924a 100644
--- a/androidApp/src/main/res/layout/user_information_activity.xml
+++ b/androidApp/src/main/res/layout/user_information_activity.xml
@@ -14,143 +14,199 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
+ android:translationZ="2dp"
android:visibility="gone"/>
- <androidx.cardview.widget.CardView
- android:id="@+id/userInfoCard"
- android:layout_margin="@dimen/card_margin"
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/backButton"
+ android:layout_width="wrap_content"
+ android:layout_height="0dp"
+ android:layout_margin="@dimen/fab_margin"
+ android:backgroundTint="@android:color/white"
+ android:contentDescription="@string/open_profile"
+ android:src="@drawable/icon_back"
+ app:borderWidth="0dp"
+ app:elevation="@dimen/fab_elevation"
+ app:fabSize="mini"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <ScrollView
android:layout_width="0dp"
- android:layout_height="wrap_content"
- app:layout_constraintTop_toTopOf="parent"
+ android:layout_height="0dp"
+ android:layout_marginTop="@dimen/fab_margin"
+ app:layout_constraintTop_toBottomOf="@id/backButton"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintBottom_toBottomOf="parent"
- app:contentPadding="@dimen/card_padding"
- app:cardCornerRadius="@dimen/card_border_radius"
- app:cardElevation="@dimen/card_elevation">
+ app:layout_constraintBottom_toBottomOf="parent">
- <androidx.constraintlayout.widget.ConstraintLayout
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
- <TextView
- android:id="@+id/usernameLabel"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:text="@string/username"
- app:layout_constraintBottom_toTopOf="@id/usernameInfo"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintVertical_chainStyle="spread_inside" />
-
- <TextView
- android:id="@+id/usernameInfo"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- app:layout_constraintBottom_toTopOf="@id/emailLabel"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/usernameLabel"
- tools:text="Username" />
-
- <TextView
- android:id="@+id/emailLabel"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/fields_spacing"
- android:text="@string/email"
- app:layout_constraintBottom_toTopOf="@id/emailInfo"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/usernameInfo" />
-
- <TextView
- android:id="@+id/emailInfo"
- android:layout_width="0dp"
+ <androidx.cardview.widget.CardView
+ android:id="@+id/userInfoCard"
+ android:layout_margin="@dimen/card_margin"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- app:layout_constraintBottom_toTopOf="@id/idLabel"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/emailLabel"
- tools:text="Email" />
-
- <TextView
- android:id="@+id/idLabel"
- android:layout_width="0dp"
+ app:contentPadding="@dimen/card_padding"
+ app:cardCornerRadius="@dimen/card_border_radius"
+ app:cardElevation="@dimen/card_elevation">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/fields_spacing"
+ android:text="@string/user_details"
+ android:textAppearance="@style/TextAppearance.AppCompat.Headline"/>
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/username"
+ android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
+
+ <TextView
+ android:id="@+id/usernameInfo"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/fields_spacing"
+ tools:text="Username" />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/email"
+ android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
+
+ <TextView
+ android:id="@+id/emailInfo"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/fields_spacing"
+ tools:text="Email" />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/unique_id"
+ android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
+
+ <TextView
+ android:id="@+id/idInfo"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/fields_spacing"
+ tools:text="Unique ID" />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/device_limit"
+ android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
+
+ <TextView
+ android:id="@+id/deviceLimitInfo"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/fields_spacing"
+ tools:text="Device Limit" />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/admin"
+ android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
+
+ <TextView
+ android:id="@+id/adminInfo"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/fields_spacing"
+ tools:text="Admin" />
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/signoutButton"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/sign_out" />
+
+ </LinearLayout>
+
+ </androidx.cardview.widget.CardView>
+
+ <androidx.cardview.widget.CardView
+ android:id="@+id/aboutCard"
+ android:layout_margin="@dimen/card_margin"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/fields_spacing"
- android:text="@string/unique_id"
- app:layout_constraintBottom_toTopOf="@id/idInfo"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/emailInfo" />
-
- <TextView
- android:id="@+id/idInfo"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- app:layout_constraintBottom_toTopOf="@id/deviceLimitLabel"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/idLabel"
- tools:text="Unique ID" />
-
- <TextView
- android:id="@+id/deviceLimitLabel"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/fields_spacing"
- android:text="@string/device_limit"
- app:layout_constraintBottom_toTopOf="@id/deviceLimitInfo"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/idInfo" />
-
- <TextView
- android:id="@+id/deviceLimitInfo"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- app:layout_constraintBottom_toTopOf="@id/adminLabel"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/deviceLimitLabel"
- tools:text="Device Limit" />
-
- <TextView
- android:id="@+id/adminLabel"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/fields_spacing"
- android:text="@string/admin"
- app:layout_constraintBottom_toTopOf="@id/adminInfo"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/deviceLimitInfo" />
-
- <TextView
- android:id="@+id/adminInfo"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- app:layout_constraintBottom_toTopOf="@id/signoutButton"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/adminLabel"
- tools:text="Admin" />
-
- <com.google.android.material.button.MaterialButton
- android:id="@+id/signoutButton"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/fields_spacing"
- android:text="@string/sign_out"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/adminInfo" />
-
- </androidx.constraintlayout.widget.ConstraintLayout>
-
- </androidx.cardview.widget.CardView>
+ app:contentPadding="@dimen/card_padding"
+ app:cardCornerRadius="@dimen/card_border_radius"
+ app:cardElevation="@dimen/card_elevation">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/fields_spacing"
+ android:text="@string/about_details"
+ android:textAppearance="@style/TextAppearance.AppCompat.Headline"/>
+
+ <ImageView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/fields_spacing"
+ android:contentDescription="@string/about_logo"
+ android:src="@drawable/about_logo" />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/fields_spacing"
+ android:text="@string/about_text"
+ android:maxLines="10"/>
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/app_version"
+ android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
+
+ <TextView
+ android:id="@+id/appVersion"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/fields_spacing"
+ tools:text="1.0" />
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/sourceCodeButton"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/source_code" />
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/websiteButton"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/open_website" />
+
+ </LinearLayout>
+
+ </androidx.cardview.widget.CardView>
+
+ </LinearLayout>
+
+ </ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file
diff --git a/androidApp/src/main/res/values/dimen.xml b/androidApp/src/main/res/values/dimen.xml
index 25d0e98..2d0dcc3 100644
--- a/androidApp/src/main/res/values/dimen.xml
+++ b/androidApp/src/main/res/values/dimen.xml
@@ -23,4 +23,5 @@
<!-- User Information -->
<dimen name="fields_spacing">8dp</dimen>
+ <dimen name="fields_large_spacing">16dp</dimen>
</resources> \ No newline at end of file