Skip to content

Commit c36cf58

Browse files
committed
Fix layout
1 parent 5e796f7 commit c36cf58

File tree

3 files changed

+70
-41
lines changed

3 files changed

+70
-41
lines changed

android/app/src/main/java/com/httpsms/LoginActivity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import timber.log.Timber
1313
class LoginActivity : AppCompatActivity() {
1414
override fun onCreate(savedInstanceState: Bundle?) {
1515
super.onCreate(savedInstanceState)
16+
redirectToMain()
1617
setContentView(R.layout.activity_login)
1718
registerListeners()
1819
}

android/app/src/main/res/layout/activity_main.xml

Lines changed: 68 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,71 +3,98 @@
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
6+
android:paddingLeft="16dp"
7+
android:paddingRight="16dp"
68
android:layout_height="match_parent"
79
tools:context=".MainActivity">
810

11+
<ImageView
12+
android:id="@+id/imageView"
13+
android:layout_width="wrap_content"
14+
android:layout_height="wrap_content"
15+
android:layout_marginTop="16dp"
16+
android:contentDescription="@string/img_http_sms_logo"
17+
app:layout_constraintEnd_toEndOf="parent"
18+
app:layout_constraintStart_toStartOf="parent"
19+
app:layout_constraintTop_toTopOf="parent"
20+
app:srcCompat="@drawable/ic_colored_logo"
21+
tools:ignore="ImageContrastCheck" />
22+
923
<com.google.android.material.card.MaterialCardView
1024
android:id="@+id/card"
1125
android:layout_width="match_parent"
1226
android:layout_height="wrap_content"
13-
android:layout_margin="8dp"
27+
android:elevation="16dp"
28+
app:cardCornerRadius="16dp"
1429
app:layout_constraintEnd_toEndOf="parent"
1530
app:layout_constraintStart_toStartOf="parent"
1631
app:layout_constraintTop_toTopOf="parent">
1732

18-
<LinearLayout
19-
android:layout_width="match_parent"
20-
android:layout_height="wrap_content"
21-
android:orientation="vertical"
22-
android:padding="16dp">
23-
24-
<!-- Title, secondary and supporting text -->
25-
<LinearLayout
26-
android:layout_width="match_parent"
27-
android:layout_height="match_parent"
28-
android:orientation="horizontal">
33+
</com.google.android.material.card.MaterialCardView>
2934

30-
<TextView
31-
android:id="@+id/cardPhoneNumber"
32-
android:layout_width="wrap_content"
33-
android:layout_height="match_parent"
34-
android:text="@string/phone_number"
35-
android:textAppearance="?attr/textAppearanceTitleMedium"
36-
android:textColor="?android:attr/textColorPrimary"
37-
android:textSize="28sp" />
35+
<LinearLayout
36+
android:layout_width="match_parent"
37+
android:layout_height="wrap_content"
38+
android:layout_marginTop="32dp"
39+
android:orientation="vertical"
40+
android:padding="16dp"
41+
android:background="#1E1E1E"
42+
app:layout_constraintTop_toBottomOf="@+id/imageView"
43+
tools:layout_editor_absoluteX="0dp">
3844

39-
<com.google.android.material.switchmaterial.SwitchMaterial
40-
android:id="@+id/cardSwitch"
41-
android:layout_width="match_parent"
42-
android:layout_height="wrap_content"
43-
android:minHeight="48dp"
44-
android:text=""
45-
tools:ignore="TouchTargetSizeCheck" />
46-
</LinearLayout>
45+
<!-- Title, secondary and supporting text -->
4746

47+
<LinearLayout
48+
android:layout_width="match_parent"
49+
android:layout_height="match_parent"
50+
android:orientation="horizontal">
4851

4952
<TextView
50-
android:id="@+id/cardRefreshTime"
53+
android:id="@+id/cardPhoneNumber"
5154
android:layout_width="wrap_content"
52-
android:layout_height="wrap_content"
53-
android:layout_marginTop="8dp"
54-
android:text="@string/nextRefreshTime"
55-
android:textAppearance="?attr/textAppearanceBodyMedium"
56-
android:textColor="?android:attr/textColorSecondary"
57-
android:textSize="16sp" />
55+
android:layout_height="match_parent"
56+
android:text="@string/phone_number"
57+
android:textAppearance="?attr/textAppearanceTitleMedium"
58+
android:textColor="?android:attr/textColorPrimary"
59+
android:textSize="28sp" />
5860

61+
<com.google.android.material.switchmaterial.SwitchMaterial
62+
android:id="@+id/cardSwitch"
63+
android:layout_width="match_parent"
64+
android:layout_height="wrap_content"
65+
android:minHeight="48dp"
66+
tools:ignore="TouchTargetSizeCheck" />
5967
</LinearLayout>
6068

61-
</com.google.android.material.card.MaterialCardView>
6269

63-
<Button
64-
android:id="@+id/sign_in_button"
70+
<TextView
71+
android:id="@+id/cardRefreshTime"
72+
android:layout_width="wrap_content"
73+
android:layout_height="wrap_content"
74+
android:layout_marginTop="8dp"
75+
android:text="@string/nextRefreshTime"
76+
android:textAppearance="?attr/textAppearanceBodyMedium"
77+
android:textColor="?android:attr/textColorSecondary"
78+
android:textSize="16sp" />
79+
80+
</LinearLayout>
81+
82+
<com.google.android.material.button.MaterialButton
83+
style="@style/Widget.MaterialComponents.Button.Icon"
6584
android:layout_width="wrap_content"
6685
android:layout_height="wrap_content"
67-
android:layout_marginTop="32dp"
68-
android:text="@string/sign_in_button"
86+
android:layout_marginBottom="16dp"
87+
android:backgroundTint="@color/black"
88+
android:drawableTint="@color/white"
89+
android:padding="10dp"
90+
android:text="@string/main_log_out"
91+
android:textColor="@color/white"
92+
android:textSize="16sp"
93+
app:icon="@drawable/ic_login"
94+
app:iconTint="@color/white"
95+
app:layout_constraintBottom_toBottomOf="parent"
6996
app:layout_constraintEnd_toEndOf="parent"
7097
app:layout_constraintStart_toStartOf="parent"
71-
app:layout_constraintTop_toBottomOf="@+id/card" />
98+
tools:ignore="TextContrastCheck" />
7299

73100
</androidx.constraintlayout.widget.ConstraintLayout>

android/app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
<string name="text_area_api_key">API Key</string>
1010
<string name="img_http_sms_logo">HTTP Sms Logo</string>
1111
<string name="get_your_api_key">Open\nhttpsms.com/settings\nto get your API key</string>
12+
<string name="main_log_out">Log Out</string>
1213
</resources>

0 commit comments

Comments
 (0)