Skip to content

Commit f85abf6

Browse files
committed
Fix display of the login page
1 parent 9528b39 commit f85abf6

3 files changed

Lines changed: 161 additions & 148 deletions

File tree

Lines changed: 158 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -1,175 +1,188 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
7-
android:fitsSystemWindows="true"
8-
android:paddingStart="16dp"
9-
android:paddingEnd="16dp">
10-
11-
<ImageView
12-
android:id="@+id/imageView"
13-
android:layout_width="100dp"
14-
android:layout_height="100dp"
15-
android:layout_marginTop="32dp"
16-
android:contentDescription="@string/img_http_sms_logo"
17-
app:layout_constraintEnd_toEndOf="parent"
18-
app:layout_constraintHorizontal_bias="0.498"
19-
app:layout_constraintStart_toStartOf="parent"
20-
app:layout_constraintTop_toTopOf="parent"
21-
app:srcCompat="@drawable/logo_cropped"
22-
tools:ignore="ImageContrastCheck" />
23-
24-
<TextView
25-
android:id="@+id/textView"
26-
android:layout_width="0dp"
27-
android:layout_height="wrap_content"
28-
android:layout_marginBottom="20dp"
29-
android:autoLink="web"
30-
android:lineHeight="28sp"
31-
android:text="@string/get_your_api_key"
32-
android:textAlignment="center"
33-
android:textSize="20sp"
34-
app:layout_constraintBottom_toTopOf="@+id/loginApiKeyTextInputLayout"
35-
app:layout_constraintEnd_toEndOf="parent"
36-
app:layout_constraintStart_toStartOf="parent"
37-
app:layout_constraintTop_toBottomOf="@+id/imageView" />
38-
39-
<com.google.android.material.textfield.TextInputLayout
40-
android:id="@+id/loginApiKeyTextInputLayout"
41-
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
42-
android:layout_width="0dp"
7+
android:fillViewport="true">
8+
9+
<androidx.constraintlayout.widget.ConstraintLayout
10+
android:layout_width="match_parent"
4311
android:layout_height="wrap_content"
44-
android:hint="@string/text_area_api_key"
45-
app:errorEnabled="true"
46-
app:endIconMode="custom"
47-
app:endIconDrawable="@android:drawable/ic_menu_camera"
48-
app:endIconContentDescription="cameraButton"
49-
app:layout_constraintBottom_toTopOf="@+id/loginPhoneNumberLayoutSIM1"
50-
app:layout_constraintEnd_toEndOf="parent"
51-
app:layout_constraintStart_toStartOf="parent"
52-
app:layout_constraintTop_toBottomOf="@+id/textView">
53-
54-
<com.google.android.material.textfield.TextInputEditText
55-
android:id="@+id/loginApiKeyTextInput"
56-
android:layout_width="match_parent"
57-
android:imeOptions="actionDone"
58-
android:inputType="text"
12+
android:paddingStart="16dp"
13+
android:paddingEnd="16dp"
14+
android:paddingBottom="16dp">
15+
16+
<ImageView
17+
android:id="@+id/imageView"
18+
android:layout_width="100dp"
19+
android:layout_height="100dp"
20+
android:layout_marginTop="64dp"
21+
android:contentDescription="@string/img_http_sms_logo"
22+
app:layout_constraintEnd_toEndOf="parent"
23+
app:layout_constraintHorizontal_bias="0.498"
24+
app:layout_constraintStart_toStartOf="parent"
25+
app:layout_constraintTop_toTopOf="parent"
26+
app:srcCompat="@drawable/logo_cropped"
27+
tools:ignore="ImageContrastCheck" />
28+
29+
<TextView
30+
android:id="@+id/textView"
31+
android:layout_width="0dp"
5932
android:layout_height="wrap_content"
60-
tools:ignore="TextContrastCheck" />
61-
62-
</com.google.android.material.textfield.TextInputLayout>
33+
android:layout_marginTop="32dp"
34+
android:layout_marginBottom="24dp"
35+
android:autoLink="web"
36+
android:lineHeight="28sp"
37+
android:text="@string/get_your_api_key"
38+
android:textAlignment="center"
39+
android:textSize="20sp"
40+
app:layout_constraintBottom_toTopOf="@+id/loginApiKeyTextInputLayout"
41+
app:layout_constraintEnd_toEndOf="parent"
42+
app:layout_constraintStart_toStartOf="parent"
43+
app:layout_constraintTop_toBottomOf="@+id/imageView"
44+
app:layout_constraintVertical_bias="0"
45+
app:layout_constraintVertical_chainStyle="packed" />
6346

64-
<com.google.android.material.textfield.TextInputLayout
65-
android:id="@+id/loginPhoneNumberLayoutSIM1"
66-
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
67-
android:layout_width="0dp"
68-
android:layout_height="wrap_content"
69-
android:layout_marginTop="16dp"
70-
android:hint="@string/login_phone_number_sim1"
71-
app:errorEnabled="true"
72-
app:placeholderText="@string/login_phone_number_hint"
73-
app:layout_constraintEnd_toEndOf="parent"
74-
app:layout_constraintStart_toStartOf="parent"
75-
app:layout_constraintTop_toBottomOf="@+id/loginApiKeyTextInputLayout">
76-
77-
<com.google.android.material.textfield.TextInputEditText
78-
android:id="@+id/loginPhoneNumberInputSIM1"
79-
android:layout_width="match_parent"
80-
android:inputType="text"
47+
<com.google.android.material.textfield.TextInputLayout
48+
android:id="@+id/loginApiKeyTextInputLayout"
49+
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
50+
android:layout_width="0dp"
8151
android:layout_height="wrap_content"
82-
android:imeOptions="actionDone"
83-
tools:ignore="TextContrastCheck" />
52+
android:hint="@string/text_area_api_key"
53+
app:errorEnabled="true"
54+
app:endIconMode="custom"
55+
app:endIconDrawable="@android:drawable/ic_menu_camera"
56+
app:endIconContentDescription="cameraButton"
57+
app:layout_constraintBottom_toTopOf="@+id/loginPhoneNumberLayoutSIM1"
58+
app:layout_constraintEnd_toEndOf="parent"
59+
app:layout_constraintStart_toStartOf="parent"
60+
app:layout_constraintTop_toBottomOf="@+id/textView">
8461

85-
</com.google.android.material.textfield.TextInputLayout>
62+
<com.google.android.material.textfield.TextInputEditText
63+
android:id="@+id/loginApiKeyTextInput"
64+
android:layout_width="match_parent"
65+
android:imeOptions="actionDone"
66+
android:inputType="text"
67+
android:layout_height="wrap_content"
68+
tools:ignore="TextContrastCheck" />
8669

87-
<com.google.android.material.textfield.TextInputLayout
88-
android:id="@+id/loginPhoneNumberLayoutSIM2"
89-
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
90-
android:layout_width="0dp"
91-
android:layout_height="wrap_content"
92-
android:layout_marginTop="16dp"
93-
android:hint="@string/login_phone_number_sim2"
94-
app:errorEnabled="true"
95-
app:placeholderText="@string/login_phone_number_hint"
96-
app:layout_constraintEnd_toEndOf="parent"
97-
app:layout_constraintStart_toStartOf="parent"
98-
app:layout_constraintTop_toBottomOf="@+id/loginPhoneNumberLayoutSIM1">
99-
100-
<com.google.android.material.textfield.TextInputEditText
101-
android:id="@+id/loginPhoneNumberInputSIM2"
102-
android:layout_width="match_parent"
70+
</com.google.android.material.textfield.TextInputLayout>
71+
72+
<com.google.android.material.textfield.TextInputLayout
73+
android:id="@+id/loginPhoneNumberLayoutSIM1"
74+
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
75+
android:layout_width="0dp"
10376
android:layout_height="wrap_content"
104-
android:imeOptions="actionDone"
105-
android:inputType="text"
106-
tools:ignore="TextContrastCheck" />
77+
android:layout_marginTop="8dp"
78+
android:hint="@string/login_phone_number_sim1"
79+
app:errorEnabled="true"
80+
app:placeholderText="@string/login_phone_number_hint"
81+
app:layout_constraintBottom_toTopOf="@+id/loginPhoneNumberLayoutSIM2"
82+
app:layout_constraintEnd_toEndOf="parent"
83+
app:layout_constraintStart_toStartOf="parent"
84+
app:layout_constraintTop_toBottomOf="@+id/loginApiKeyTextInputLayout">
10785

108-
</com.google.android.material.textfield.TextInputLayout>
86+
<com.google.android.material.textfield.TextInputEditText
87+
android:id="@+id/loginPhoneNumberInputSIM1"
88+
android:layout_width="match_parent"
89+
android:inputType="text"
90+
android:layout_height="wrap_content"
91+
android:imeOptions="actionDone"
92+
tools:ignore="TextContrastCheck" />
93+
94+
</com.google.android.material.textfield.TextInputLayout>
10995

110-
<LinearLayout
111-
android:id="@+id/loginServerUrlLayoutContainer"
112-
android:orientation="vertical"
113-
android:layout_width="0dp"
114-
android:layout_height="wrap_content"
115-
android:layout_marginTop="16dp"
116-
app:layout_constraintEnd_toEndOf="parent"
117-
app:layout_constraintStart_toStartOf="parent"
118-
app:layout_constraintTop_toBottomOf="@+id/loginPhoneNumberLayoutSIM2">
11996
<com.google.android.material.textfield.TextInputLayout
120-
android:id="@+id/loginServerUrlLayout"
97+
android:id="@+id/loginPhoneNumberLayoutSIM2"
12198
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
122-
android:layout_width="match_parent"
99+
android:layout_width="0dp"
123100
android:layout_height="wrap_content"
124-
android:hint="@string/server_url"
101+
android:layout_marginTop="8dp"
102+
android:hint="@string/login_phone_number_sim2"
125103
app:errorEnabled="true"
126-
app:placeholderText="@string/login_server_url_hint">
104+
app:placeholderText="@string/login_phone_number_hint"
105+
app:layout_constraintBottom_toTopOf="@+id/loginServerUrlLayoutContainer"
106+
app:layout_constraintEnd_toEndOf="parent"
107+
app:layout_constraintStart_toStartOf="parent"
108+
app:layout_constraintTop_toBottomOf="@+id/loginPhoneNumberLayoutSIM1">
127109

128110
<com.google.android.material.textfield.TextInputEditText
129-
android:id="@+id/loginServerUrlInput"
111+
android:id="@+id/loginPhoneNumberInputSIM2"
130112
android:layout_width="match_parent"
113+
android:layout_height="wrap_content"
131114
android:imeOptions="actionDone"
132115
android:inputType="text"
133-
android:layout_height="wrap_content"
134116
tools:ignore="TextContrastCheck" />
135117

136118
</com.google.android.material.textfield.TextInputLayout>
137-
</LinearLayout>
138119

139-
<LinearLayout
140-
android:id="@+id/linearLayout"
141-
android:layout_width="0dp"
142-
android:layout_height="wrap_content"
143-
android:layout_marginTop="16dp"
144-
android:orientation="vertical"
145-
android:gravity="center"
146-
app:layout_constraintEnd_toEndOf="parent"
147-
app:layout_constraintStart_toStartOf="parent"
148-
app:layout_constraintTop_toBottomOf="@+id/loginServerUrlLayoutContainer">
149-
150-
<com.google.android.material.button.MaterialButton
151-
android:id="@+id/loginButton"
152-
style="@style/Widget.MaterialComponents.Button.Icon"
153-
android:layout_width="wrap_content"
120+
<LinearLayout
121+
android:id="@+id/loginServerUrlLayoutContainer"
122+
android:orientation="vertical"
123+
android:layout_width="0dp"
154124
android:layout_height="wrap_content"
155-
android:backgroundTint="#2196f3"
156-
android:drawableTint="@color/white"
157-
android:padding="10dp"
158-
android:text="@string/sign_in_button"
159-
android:textColor="@color/white"
160-
android:textSize="16sp"
161-
app:icon="@drawable/ic_login"
162-
app:iconTint="@color/white"
163-
tools:ignore="TextContrastCheck" />
164-
165-
<com.google.android.material.progressindicator.LinearProgressIndicator
166-
android:id="@+id/loginProgressIndicator"
167-
android:layout_width="match_parent"
125+
android:layout_marginTop="8dp"
126+
app:layout_constraintBottom_toTopOf="@+id/linearLayout"
127+
app:layout_constraintEnd_toEndOf="parent"
128+
app:layout_constraintStart_toStartOf="parent"
129+
app:layout_constraintTop_toBottomOf="@+id/loginPhoneNumberLayoutSIM2">
130+
<com.google.android.material.textfield.TextInputLayout
131+
android:id="@+id/loginServerUrlLayout"
132+
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
133+
android:layout_width="match_parent"
134+
android:layout_height="wrap_content"
135+
android:hint="@string/server_url"
136+
app:errorEnabled="true"
137+
app:placeholderText="@string/login_server_url_hint">
138+
139+
<com.google.android.material.textfield.TextInputEditText
140+
android:id="@+id/loginServerUrlInput"
141+
android:layout_width="match_parent"
142+
android:imeOptions="actionDone"
143+
android:inputType="text"
144+
android:layout_height="wrap_content"
145+
tools:ignore="TextContrastCheck" />
146+
147+
</com.google.android.material.textfield.TextInputLayout>
148+
</LinearLayout>
149+
150+
<LinearLayout
151+
android:id="@+id/linearLayout"
152+
android:layout_width="0dp"
168153
android:layout_height="wrap_content"
169-
android:layout_marginTop="4dp"
170-
android:indeterminate="true"
171-
android:visibility="invisible"
172-
app:indicatorColor="@color/pink_500" />
173-
</LinearLayout>
154+
android:layout_marginTop="16dp"
155+
android:orientation="vertical"
156+
android:gravity="center"
157+
app:layout_constraintBottom_toBottomOf="parent"
158+
app:layout_constraintEnd_toEndOf="parent"
159+
app:layout_constraintStart_toStartOf="parent"
160+
app:layout_constraintTop_toBottomOf="@+id/loginServerUrlLayoutContainer">
161+
162+
<com.google.android.material.button.MaterialButton
163+
android:id="@+id/loginButton"
164+
style="@style/Widget.MaterialComponents.Button.Icon"
165+
android:layout_width="wrap_content"
166+
android:layout_height="wrap_content"
167+
android:backgroundTint="#2196f3"
168+
android:drawableTint="@color/white"
169+
android:padding="10dp"
170+
android:text="@string/sign_in_button"
171+
android:textColor="@color/white"
172+
android:textSize="16sp"
173+
app:icon="@drawable/ic_login"
174+
app:iconTint="@color/white"
175+
tools:ignore="TextContrastCheck" />
174176

175-
</androidx.constraintlayout.widget.ConstraintLayout>
177+
<com.google.android.material.progressindicator.LinearProgressIndicator
178+
android:id="@+id/loginProgressIndicator"
179+
android:layout_width="match_parent"
180+
android:layout_height="wrap_content"
181+
android:layout_marginTop="4dp"
182+
android:indeterminate="true"
183+
android:visibility="invisible"
184+
app:indicatorColor="@color/pink_500" />
185+
</LinearLayout>
186+
187+
</androidx.constraintlayout.widget.ConstraintLayout>
188+
</androidx.core.widget.NestedScrollView>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<string name="sign_in_button">Login With API Key</string>
88
<string name="text_area_api_key">API Key</string>
99
<string name="img_http_sms_logo">HTTP Sms Logo</string>
10-
<string name="get_your_api_key">Open\nhttpsms.com/settings\nto get your API key</string>
10+
<string name="get_your_api_key">Get Your API Key at\nhttpsms.com/settings</string>
1111
<string name="main_log_out">Log Out</string>
1212
<string name="login_phone_number_hint">e.g +18005550199 (international format)</string>
1313
<string name="login_server_url_hint">e.g https://api.httpsms.com</string>

android/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ buildscript {
1010
}
1111

1212
plugins {
13-
id("com.android.application") version "9.1.0" apply false
14-
id("com.android.library") version "9.1.0" apply false
13+
id("com.android.application") version "9.1.1" apply false
14+
id("com.android.library") version "9.1.1" apply false
1515
}
1616

1717
tasks.register<Delete>("clean") {

0 commit comments

Comments
 (0)