updating sign in specific subtitle for the server selection screen

This commit is contained in:
Adam Brown 2022-07-27 09:36:12 +01:00
parent 653c97b40d
commit 616c1d780f
3 changed files with 13 additions and 2 deletions

View File

@ -33,6 +33,7 @@ import im.vector.app.core.utils.ensureTrailingSlash
import im.vector.app.core.utils.openUrlInExternalBrowser
import im.vector.app.databinding.FragmentFtueServerSelectionCombinedBinding
import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.OnboardingFlow
import im.vector.app.features.onboarding.OnboardingViewEvents
import im.vector.app.features.onboarding.OnboardingViewState
import org.matrix.android.sdk.api.failure.isHomeserverUnavailable
@ -76,6 +77,14 @@ class FtueAuthCombinedServerSelectionFragment @Inject constructor() : AbstractFt
}
override fun updateWithState(state: OnboardingViewState) {
views.chooseServerHeaderSubtitle.setText(
when (state.onboardingFlow) {
OnboardingFlow.SignIn -> R.string.ftue_auth_choose_server_sign_in_subtitle
OnboardingFlow.SignUp -> R.string.ftue_auth_choose_server_subtitle
else -> throw IllegalStateException("Invalid flow state")
}
)
if (views.chooseServerInput.content().isEmpty()) {
val userUrlInput = state.selectedHomeserver.userFacingUrl?.toReducedUrlKeepingSchemaIfInsecure()
views.chooseServerInput.editText().setText(userUrlInput)

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<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"
style="@style/LoginFormScrollView"
android:layout_height="match_parent"
android:background="?android:colorBackground"
@ -76,12 +77,12 @@
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center"
android:text="@string/ftue_auth_choose_server_subtitle"
android:textColor="?vctr_content_secondary"
app:layout_constraintBottom_toTopOf="@id/titleContentSpacing"
app:layout_constraintEnd_toEndOf="@id/chooseServerGutterEnd"
app:layout_constraintStart_toStartOf="@id/chooseServerGutterStart"
app:layout_constraintTop_toBottomOf="@id/chooseServerHeaderTitle" />
app:layout_constraintTop_toBottomOf="@id/chooseServerHeaderTitle"
tools:text="@string/ftue_auth_choose_server_subtitle" />
<Space
android:id="@+id/titleContentSpacing"

View File

@ -1937,6 +1937,7 @@
<string name="ftue_auth_choose_server_title">Select your server</string>
<string name="ftue_auth_choose_server_subtitle">What is the address of your server? This is like a home for all your data</string>
<string name="ftue_auth_choose_server_sign_in_subtitle">What is the address of your server?</string>
<string name="ftue_auth_choose_server_entry_hint">Server URL</string>
<string name="ftue_auth_choose_server_ems_title">Want to host your own server?</string>