Skip to content

Commit 8b8c5fd

Browse files
committed
Ensure the connection status fits in landscape layout
1 parent 693f89c commit 8b8c5fd

File tree

3 files changed

+89
-9
lines changed

3 files changed

+89
-9
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<android.widget.LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
android:orientation="vertical"
7+
android:paddingStart="16sp"
8+
android:paddingEnd="16sp"
9+
android:paddingBottom="4sp"
10+
android:clipToPadding="false">
11+
12+
<TextView
13+
android:id="@+id/connectedTo"
14+
style="@style/ConnectedToText"
15+
android:text=""
16+
android:layout_marginBottom="24sp" />
17+
18+
<com.google.android.material.card.MaterialCardView
19+
style="@style/ConnectionStatusCard"
20+
android:layout_width="match_parent"
21+
android:layout_height="wrap_content">
22+
23+
<TextView
24+
style="@style/ConnectionStatusHeading"
25+
android:drawableStart="@drawable/ic_check_circle"
26+
android:text="@string/user_connection_status_enabled_heading" />
27+
28+
</com.google.android.material.card.MaterialCardView>
29+
30+
<com.google.android.material.card.MaterialCardView
31+
style="@style/ConnectionStatusCard"
32+
android:layout_width="match_parent"
33+
android:layout_height="wrap_content">
34+
35+
<TextView
36+
style="@style/ConnectionStatusHeading"
37+
android:drawableStart="@drawable/ic_check_circle"
38+
android:text="@string/system_connection_status_enabled_heading" />
39+
40+
</com.google.android.material.card.MaterialCardView>
41+
42+
</android.widget.LinearLayout>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<android.widget.LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:orientation="vertical"
6+
android:paddingStart="16sp"
7+
android:paddingEnd="16sp"
8+
android:paddingBottom="4sp"
9+
android:clipToPadding="false">
10+
11+
<TextView
12+
android:id="@+id/connectedTo"
13+
style="@style/ConnectedToText"
14+
android:text=""
15+
android:layout_marginBottom="24sp" />
16+
17+
<com.google.android.material.card.MaterialCardView
18+
style="@style/ConnectionStatusCard"
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content">
21+
22+
<TextView
23+
style="@style/ConnectionStatusHeading"
24+
android:drawableStart="@drawable/ic_check_circle"
25+
android:text="@string/user_connection_status_enabled_heading" />
26+
27+
</com.google.android.material.card.MaterialCardView>
28+
29+
<com.google.android.material.card.MaterialCardView
30+
style="@style/ConnectionStatusCard"
31+
android:layout_width="match_parent"
32+
android:layout_height="wrap_content">
33+
34+
<TextView
35+
style="@style/ConnectionStatusHeading"
36+
android:drawableStart="@drawable/ic_exclamation_triangle"
37+
android:text="@string/system_connection_status_disabled_heading" />
38+
39+
</com.google.android.material.card.MaterialCardView>
40+
41+
</android.widget.LinearLayout>

app/src/main/res/layout-land/main_layout.xml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
android:layout_height="wrap_content"
2626
android:layout_marginBottom="24dp"
2727
android:contentDescription="The HTTP Toolkit Logo"
28+
app:layout_constraintTop_toTopOf="@+id/guideline"
2829
app:layout_constraintBottom_toTopOf="@+id/statusText"
29-
app:layout_constraintEnd_toEndOf="parent"
3030
app:layout_constraintStart_toStartOf="parent"
31-
app:layout_constraintTop_toTopOf="@+id/guideline"
31+
app:layout_constraintEnd_toEndOf="parent"
3232
app:srcCompat="@drawable/ic_transparent_icon" />
3333

3434
<TextView
@@ -41,21 +41,18 @@
4141
android:layout_marginBottom="8dp"
4242
android:text="Not Connected"
4343
app:layout_constraintBottom_toTopOf="@+id/statusDetailContainer"
44-
app:layout_constraintEnd_toEndOf="parent"
44+
app:layout_constraintTop_toBottomOf="@+id/logoImage"
4545
app:layout_constraintStart_toStartOf="parent"
46-
app:layout_constraintTop_toBottomOf="@+id/logoImage" />
46+
app:layout_constraintEnd_toEndOf="parent" />
4747

4848
<LinearLayout
4949
android:id="@+id/statusDetailContainer"
5050
android:layout_width="wrap_content"
5151
android:layout_height="wrap_content"
52-
android:layout_marginStart="32dp"
53-
android:layout_marginTop="16dp"
54-
android:layout_marginEnd="32dp"
5552
app:layout_constrainedWidth="true"
56-
app:layout_constraintEnd_toEndOf="parent"
57-
app:layout_constraintStart_toStartOf="parent"
5853
app:layout_constraintTop_toBottomOf="@+id/statusText"
54+
app:layout_constraintStart_toStartOf="parent"
55+
app:layout_constraintEnd_toEndOf="parent"
5956
android:orientation="vertical" />
6057

6158
</androidx.constraintlayout.widget.ConstraintLayout>

0 commit comments

Comments
 (0)