feat: add splash screen and login auth flow

This commit is contained in:
2026-03-15 19:58:33 -04:00
parent 75e9ad1da2
commit 6ca5c1abaa
24 changed files with 889 additions and 34 deletions

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#1D5D9B"
android:pathData="M16,16h76a8,8 0 0 1 8,8v60a8,8 0 0 1 -8,8h-76a8,8 0 0 1 -8,-8v-60a8,8 0 0 1 8,-8z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M33,34h42v8h-42zM33,50h30v8h-30zM33,66h36v8h-36z" />
</vector>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="24dp">
<TextView
android:id="@+id/boardsPlaceholderText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/boards_placeholder"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,18 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/loginContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:padding="24dp"
android:visibility="invisible">
<TextView
android:id="@+id/titleText"
android:layout_width="wrap_content"
android:id="@+id/loginTitleText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:text="@string/login_title"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline5"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/baseUrlInputLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:hint="@string/base_url_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/loginTitleText">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/baseUrlInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autofillHints="url"
android:hint="@string/base_url_hint"
android:inputType="textUri"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/apiKeyInputLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:hint="@string/api_key_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/baseUrlInputLayout">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/apiKeyInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autofillHints="password"
android:hint="@string/api_key_hint"
android:inputType="textPassword"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/errorText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="?attr/colorError"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/apiKeyInputLayout" />
<TextView
android:id="@+id/statusText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/logging_in"
android:textColor="?attr/colorOnSurface"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/errorText" />
<ProgressBar
android:id="@+id/loginProgress"
style="@style/Widget.AppCompat.ProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/statusText" />
<com.google.android.material.button.MaterialButton
android:id="@+id/signInButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/sign_in"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/loginProgress" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -2,4 +2,12 @@
<resources>
<style name="Base.Theme.Kanbn4Droid" parent="Theme.MaterialComponents.DayNight.NoActionBar" />
<style name="Theme.Kanbn4Droid" parent="Base.Theme.Kanbn4Droid" />
<style name="Theme.Kanbn4Droid.Splash" parent="Theme.SplashScreen">
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_placeholder</item>
<item name="windowSplashScreenBackground">?attr/colorPrimary</item>
<item name="postSplashScreenTheme">@style/Theme.Kanbn4Droid</item>
</style>
</resources>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Kanbn4Droid.Splash" parent="Theme.SplashScreen">
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_placeholder</item>
<item name="windowSplashScreenBackground">?attr/colorPrimary</item>
<item name="postSplashScreenTheme">@style/Theme.Kanbn4Droid</item>
</style>
</resources>

View File

@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Kanbn4Droid</string>
<string name="login_title">Sign in to your Kan.bn server</string>
<string name="base_url_label">Base URL</string>
<string name="base_url_hint">https://kan.bn/</string>
<string name="default_base_url">https://kan.bn/</string>
<string name="api_key_label">API key</string>
<string name="api_key_hint">Enter your API key</string>
<string name="sign_in">Sign in</string>
<string name="logging_in">Checking server and signing in...</string>
<string name="boards_placeholder">Boards view coming soon</string>
<string name="base_url_required">Base URL is required</string>
<string name="base_url_scheme_error">Base URL must start with http:// or https://</string>
<string name="base_url_invalid">Enter a valid server URL</string>
<string name="api_key_required">API key is required</string>
<string name="network_unreachable">Cannot reach server. Check your connection and URL.</string>
<string name="auth_failed">Authentication failed. Check your API key.</string>
<string name="unexpected_error">Unexpected error. Please try again.</string>
</resources>

View File

@@ -4,4 +4,10 @@
<style name="Base.Theme.Kanbn4Droid" parent="Theme.MaterialComponents.DayNight.NoActionBar" />
<style name="Theme.Kanbn4Droid" parent="Base.Theme.Kanbn4Droid" />
<style name="Theme.Kanbn4Droid.Splash" parent="Theme.SplashScreen">
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_placeholder</item>
<item name="windowSplashScreenBackground">?attr/colorPrimary</item>
<item name="postSplashScreenTheme">@style/Theme.Kanbn4Droid</item>
</style>
</resources>