feat: Improve the design of the api unreachable page

This commit is contained in:
Peter Vacho 2024-12-24 00:03:09 +01:00
parent e8f2c75e26
commit 916a42fb59
Signed by: school
GPG key ID: 8CFC3837052871B4

View file

@ -18,32 +18,66 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/messageView"
android:layout_width="wrap_content"
<!-- Card for Error Details -->
<com.google.android.material.card.MaterialCardView
android:id="@+id/errorDetailsCard"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/apiUnreachable"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center"
android:padding="16dp"
android:layout_margin="16dp"
app:cardElevation="4dp"
app:cardCornerRadius="8dp"
app:layout_constraintTop_toBottomOf="@id/serverSettingsBarFragment"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
app:layout_constraintEnd_toEndOf="parent">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/devErrorDetailsText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text=""
android:textAppearance="?android:attr/textAppearanceSmall"
android:gravity="center"
android:padding="8dp"
app:layout_constraintTop_toBottomOf="@id/messageView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<!-- Unreachable text (static) - essentially a header -->
<com.google.android.material.textview.MaterialTextView
android:id="@+id/messageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/apiUnreachable"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<!-- Error details (dynamic) - mainly for debugging -->
<com.google.android.material.textview.MaterialTextView
android:id="@+id/devErrorDetailsText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text=""
tools:text="Type: IOException\nMessage: Unable to connect"
android:textAppearance="?android:attr/textAppearanceSmall"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@id/messageView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<!-- Refresh count (dynamic) - for visual feedback on retry -->
<com.google.android.material.textview.MaterialTextView
android:id="@+id/retryCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text=""
tools:text="Retry failed. Attempts: 5"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@id/devErrorDetailsText"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<!-- Retry Button -->
<com.google.android.material.button.MaterialButton
android:id="@+id/retryButton"
android:layout_width="0dp"
@ -51,11 +85,12 @@
android:layout_marginTop="24dp"
android:layout_marginHorizontal="48dp"
android:text="@string/retry"
app:layout_constraintTop_toBottomOf="@id/devErrorDetailsText"
app:layout_constraintTop_toBottomOf="@id/errorDetailsCard"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
style="@style/Widget.MaterialComponents.Button" />
<!-- Close Button -->
<com.google.android.material.button.MaterialButton
android:id="@+id/closeButton"
android:layout_width="0dp"
@ -71,17 +106,4 @@
app:layout_constraintEnd_toEndOf="parent"
style="@style/Widget.MaterialComponents.Button.OutlinedButton" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/retryCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center"
android:padding="16dp"
app:layout_constraintTop_toBottomOf="@id/closeButton"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>