Send and receive SMS messages using your Android phone programmatically via a simple HTTP API
Fix display of the login page
Acho Arnoldf85abf629e2e
diff --git a/android/app/src/main/res/layout/activity_login.xml b/android/app/src/main/res/layout/activity_login.xmlindex 25a19468..03552be5 100644--- a/android/app/src/main/res/layout/activity_login.xml+++ b/android/app/src/main/res/layout/activity_login.xml@@ -1,175 +1,188 @@<?xml version="1.0" encoding="utf-8"?>-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"+<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"- android:fitsSystemWindows="true"- android:paddingStart="16dp"- android:paddingEnd="16dp">-- <ImageView- android:id="@+id/imageView"- android:layout_width="100dp"- android:layout_height="100dp"- android:layout_marginTop="32dp"- android:contentDescription="@string/img_http_sms_logo"- app:layout_constraintEnd_toEndOf="parent"- app:layout_constraintHorizontal_bias="0.498"- app:layout_constraintStart_toStartOf="parent"- app:layout_constraintTop_toTopOf="parent"- app:srcCompat="@drawable/logo_cropped"- tools:ignore="ImageContrastCheck" />-- <TextView- android:id="@+id/textView"- android:layout_width="0dp"- android:layout_height="wrap_content"- android:layout_marginBottom="20dp"- android:autoLink="web"- android:lineHeight="28sp"- android:text="@string/get_your_api_key"- android:textAlignment="center"- android:textSize="20sp"- app:layout_constraintBottom_toTopOf="@+id/loginApiKeyTextInputLayout"- app:layout_constraintEnd_toEndOf="parent"- app:layout_constraintStart_toStartOf="parent"- app:layout_constraintTop_toBottomOf="@+id/imageView" />-- <com.google.android.material.textfield.TextInputLayout- android:id="@+id/loginApiKeyTextInputLayout"- style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"- android:layout_width="0dp"+ android:fillViewport="true">++ <androidx.constraintlayout.widget.ConstraintLayout+ android:layout_width="match_parent"android:layout_height="wrap_content"- android:hint="@string/text_area_api_key"- app:errorEnabled="true"- app:endIconMode="custom"- app:endIconDrawable="@android:drawable/ic_menu_camera"- app:endIconContentDescription="cameraButton"- app:layout_constraintBottom_toTopOf="@+id/loginPhoneNumberLayoutSIM1"- app:layout_constraintEnd_toEndOf="parent"- app:layout_constraintStart_toStartOf="parent"- app:layout_constraintTop_toBottomOf="@+id/textView">-- <com.google.android.material.textfield.TextInputEditText- android:id="@+id/loginApiKeyTextInput"- android:layout_width="match_parent"- android:imeOptions="actionDone"- android:inputType="text"+ android:paddingStart="16dp"+ android:paddingEnd="16dp"+ android:paddingBottom="16dp">++ <ImageView+ android:id="@+id/imageView"+ android:layout_width="100dp"+ android:layout_height="100dp"+ android:layout_marginTop="64dp"+ android:contentDescription="@string/img_http_sms_logo"+ app:layout_constraintEnd_toEndOf="parent"+ app:layout_constraintHorizontal_bias="0.498"+ app:layout_constraintStart_toStartOf="parent"+ app:layout_constraintTop_toTopOf="parent"+ app:srcCompat="@drawable/logo_cropped"+ tools:ignore="ImageContrastCheck" />++ <TextView+ android:id="@+id/textView"+ android:layout_width="0dp"android:layout_height="wrap_content"- tools:ignore="TextContrastCheck" />-- </com.google.android.material.textfield.TextInputLayout>+ android:layout_marginTop="32dp"+ android:layout_marginBottom="24dp"+ android:autoLink="web"+ android:lineHeight="28sp"+ android:text="@string/get_your_api_key"+ android:textAlignment="center"+ android:textSize="20sp"+ app:layout_constraintBottom_toTopOf="@+id/loginApiKeyTextInputLayout"+ app:layout_constraintEnd_toEndOf="parent"+ app:layout_constraintStart_toStartOf="parent"+ app:layout_constraintTop_toBottomOf="@+id/imageView"+ app:layout_constraintVertical_bias="0"+ app:layout_constraintVertical_chainStyle="packed" />- <com.google.android.material.textfield.TextInputLayout- android:id="@+id/loginPhoneNumberLayoutSIM1"- style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"- android:layout_width="0dp"- android:layout_height="wrap_content"- android:layout_marginTop="16dp"- android:hint="@string/login_phone_number_sim1"- app:errorEnabled="true"- app:placeholderText="@string/login_phone_number_hint"- app:layout_constraintEnd_toEndOf="parent"- app:layout_constraintStart_toStartOf="parent"- app:layout_constraintTop_toBottomOf="@+id/loginApiKeyTextInputLayout">-- <com.google.android.material.textfield.TextInputEditText- android:id="@+id/loginPhoneNumberInputSIM1"- android:layout_width="match_parent"- android:inputType="text"+ <com.google.android.material.textfield.TextInputLayout+ android:id="@+id/loginApiKeyTextInputLayout"+ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"+ android:layout_width="0dp"android:layout_height="wrap_content"- android:imeOptions="actionDone"- tools:ignore="TextContrastCheck" />+ android:hint="@string/text_area_api_key"+ app:errorEnabled="true"+ app:endIconMode="custom"+ app:endIconDrawable="@android:drawable/ic_menu_camera"+ app:endIconContentDescription="cameraButton"+ app:layout_constraintBottom_toTopOf="@+id/loginPhoneNumberLayoutSIM1"+ app:layout_constraintEnd_toEndOf="parent"+ app:layout_constraintStart_toStartOf="parent"+ app:layout_constraintTop_toBottomOf="@+id/textView">- </com.google.android.material.textfield.TextInputLayout>+ <com.google.android.material.textfield.TextInputEditText+ android:id="@+id/loginApiKeyTextInput"+ android:layout_width="match_parent"+ android:imeOptions="actionDone"+ android:inputType="text"+ android:layout_height="wrap_content"+ tools:ignore="TextContrastCheck" />- <com.google.android.material.textfield.TextInputLayout- android:id="@+id/loginPhoneNumberLayoutSIM2"- style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"- android:layout_width="0dp"- android:layout_height="wrap_content"- android:layout_marginTop="16dp"- android:hint="@string/login_phone_number_sim2"- app:errorEnabled="true"- app:placeholderText="@string/login_phone_number_hint"- app:layout_constraintEnd_toEndOf="parent"- app:layout_constraintStart_toStartOf="parent"- app:layout_constraintTop_toBottomOf="@+id/loginPhoneNumberLayoutSIM1">-- <com.google.android.material.textfield.TextInputEditText- android:id="@+id/loginPhoneNumberInputSIM2"- android:layout_width="match_parent"+ </com.google.android.material.textfield.TextInputLayout>++ <com.google.android.material.textfield.TextInputLayout+ android:id="@+id/loginPhoneNumberLayoutSIM1"+ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"+ android:layout_width="0dp"android:layout_height="wrap_content"- android:imeOptions="actionDone"- android:inputType="text"- tools:ignore="TextContrastCheck" />+ android:layout_marginTop="8dp"+ android:hint="@string/login_phone_number_sim1"+ app:errorEnabled="true"+ app:placeholderText="@string/login_phone_number_hint"+ app:layout_constraintBottom_toTopOf="@+id/loginPhoneNumberLayoutSIM2"+ app:layout_constraintEnd_toEndOf="parent"+ app:layout_constraintStart_toStartOf="parent"+ app:layout_constraintTop_toBottomOf="@+id/loginApiKeyTextInputLayout">- </com.google.android.material.textfield.TextInputLayout>+ <com.google.android.material.textfield.TextInputEditText+ android:id="@+id/loginPhoneNumberInputSIM1"+ android:layout_width="match_parent"+ android:inputType="text"+ android:layout_height="wrap_content"+ android:imeOptions="actionDone"+ tools:ignore="TextContrastCheck" />++ </com.google.android.material.textfield.TextInputLayout>- <LinearLayout- android:id="@+id/loginServerUrlLayoutContainer"- android:orientation="vertical"- android:layout_width="0dp"- android:layout_height="wrap_content"- android:layout_marginTop="16dp"- app:layout_constraintEnd_toEndOf="parent"- app:layout_constraintStart_toStartOf="parent"- app:layout_constraintTop_toBottomOf="@+id/loginPhoneNumberLayoutSIM2"><com.google.android.material.textfield.TextInputLayout- android:id="@+id/loginServerUrlLayout"+ android:id="@+id/loginPhoneNumberLayoutSIM2"style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"- android:layout_width="match_parent"+ android:layout_width="0dp"android:layout_height="wrap_content"- android:hint="@string/server_url"+ android:layout_marginTop="8dp"+ android:hint="@string/login_phone_number_sim2"app:errorEnabled="true"- app:placeholderText="@string/login_server_url_hint">+ app:placeholderText="@string/login_phone_number_hint"+ app:layout_constraintBottom_toTopOf="@+id/loginServerUrlLayoutContainer"+ app:layout_constraintEnd_toEndOf="parent"+ app:layout_constraintStart_toStartOf="parent"+ app:layout_constraintTop_toBottomOf="@+id/loginPhoneNumberLayoutSIM1"><com.google.android.material.textfield.TextInputEditText- android:id="@+id/loginServerUrlInput"+ android:id="@+id/loginPhoneNumberInputSIM2"android:layout_width="match_parent"+ android:layout_height="wrap_content"android:imeOptions="actionDone"android:inputType="text"- android:layout_height="wrap_content"tools:ignore="TextContrastCheck" /></com.google.android.material.textfield.TextInputLayout>- </LinearLayout>- <LinearLayout- android:id="@+id/linearLayout"- android:layout_width="0dp"- android:layout_height="wrap_content"- android:layout_marginTop="16dp"- android:orientation="vertical"- android:gravity="center"- app:layout_constraintEnd_toEndOf="parent"- app:layout_constraintStart_toStartOf="parent"- app:layout_constraintTop_toBottomOf="@+id/loginServerUrlLayoutContainer">-- <com.google.android.material.button.MaterialButton- android:id="@+id/loginButton"- style="@style/Widget.MaterialComponents.Button.Icon"- android:layout_width="wrap_content"+ <LinearLayout+ android:id="@+id/loginServerUrlLayoutContainer"+ android:orientation="vertical"+ android:layout_width="0dp"android:layout_height="wrap_content"- android:backgroundTint="#2196f3"- android:drawableTint="@color/white"- android:padding="10dp"- android:text="@string/sign_in_button"- android:textColor="@color/white"- android:textSize="16sp"- app:icon="@drawable/ic_login"- app:iconTint="@color/white"- tools:ignore="TextContrastCheck" />-- <com.google.android.material.progressindicator.LinearProgressIndicator- android:id="@+id/loginProgressIndicator"- android:layout_width="match_parent"+ android:layout_marginTop="8dp"+ app:layout_constraintBottom_toTopOf="@+id/linearLayout"+ app:layout_constraintEnd_toEndOf="parent"+ app:layout_constraintStart_toStartOf="parent"+ app:layout_constraintTop_toBottomOf="@+id/loginPhoneNumberLayoutSIM2">+ <com.google.android.material.textfield.TextInputLayout+ android:id="@+id/loginServerUrlLayout"+ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"+ android:layout_width="match_parent"+ android:layout_height="wrap_content"+ android:hint="@string/server_url"+ app:errorEnabled="true"+ app:placeholderText="@string/login_server_url_hint">++ <com.google.android.material.textfield.TextInputEditText+ android:id="@+id/loginServerUrlInput"+ android:layout_width="match_parent"+ android:imeOptions="actionDone"+ android:inputType="text"+ android:layout_height="wrap_content"+ tools:ignore="TextContrastCheck" />++ </com.google.android.material.textfield.TextInputLayout>+ </LinearLayout>++ <LinearLayout+ android:id="@+id/linearLayout"+ android:layout_width="0dp"android:layout_height="wrap_content"- android:layout_marginTop="4dp"- android:indeterminate="true"- android:visibility="invisible"- app:indicatorColor="@color/pink_500" />- </LinearLayout>+ android:layout_marginTop="16dp"+ android:orientation="vertical"+ android:gravity="center"+ app:layout_constraintBottom_toBottomOf="parent"+ app:layout_constraintEnd_toEndOf="parent"+ app:layout_constraintStart_toStartOf="parent"+ app:layout_constraintTop_toBottomOf="@+id/loginServerUrlLayoutContainer">++ <com.google.android.material.button.MaterialButton+ android:id="@+id/loginButton"+ style="@style/Widget.MaterialComponents.Button.Icon"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:backgroundTint="#2196f3"+ android:drawableTint="@color/white"+ android:padding="10dp"+ android:text="@string/sign_in_button"+ android:textColor="@color/white"+ android:textSize="16sp"+ app:icon="@drawable/ic_login"+ app:iconTint="@color/white"+ tools:ignore="TextContrastCheck" />-</androidx.constraintlayout.widget.ConstraintLayout>+ <com.google.android.material.progressindicator.LinearProgressIndicator+ android:id="@+id/loginProgressIndicator"+ android:layout_width="match_parent"+ android:layout_height="wrap_content"+ android:layout_marginTop="4dp"+ android:indeterminate="true"+ android:visibility="invisible"+ app:indicatorColor="@color/pink_500" />+ </LinearLayout>++ </androidx.constraintlayout.widget.ConstraintLayout>+</androidx.core.widget.NestedScrollView>diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xmlindex 81a0f4f8..02dfa1b6 100644--- a/android/app/src/main/res/values/strings.xml+++ b/android/app/src/main/res/values/strings.xml@@ -7,7 +7,7 @@<string name="sign_in_button">Login With API Key</string><string name="text_area_api_key">API Key</string><string name="img_http_sms_logo">HTTP Sms Logo</string>- <string name="get_your_api_key">Open\nhttpsms.com/settings\nto get your API key</string>+ <string name="get_your_api_key">Get Your API Key at\nhttpsms.com/settings</string><string name="main_log_out">Log Out</string><string name="login_phone_number_hint">e.g +18005550199 (international format)</string><string name="login_server_url_hint">e.g https://api.httpsms.com</string>diff --git a/android/build.gradle.kts b/android/build.gradle.ktsindex 095d0884..32077a01 100644--- a/android/build.gradle.kts+++ b/android/build.gradle.kts@@ -10,8 +10,8 @@ buildscript {}plugins {- id("com.android.application") version "9.1.0" apply false- id("com.android.library") version "9.1.0" apply false+ id("com.android.application") version "9.1.1" apply false+ id("com.android.library") version "9.1.1" apply false}tasks.register<Delete>("clean") {