Re-activate Wellknown support with updated UI (#1614)

This commit is contained in:
Benoit Marty 2020-07-04 12:10:17 +02:00
parent 0cfd33fc8b
commit b853397c0a
5 changed files with 23 additions and 21 deletions

View File

@ -2,7 +2,7 @@ Changes in Riot.imX 0.91.4 (2020-XX-XX)
=================================================== ===================================================
Features ✨: Features ✨:
- - Re-activate Wellknown support with updated UI (#1614)
Improvements 🙌: Improvements 🙌:
- -

View File

@ -54,6 +54,7 @@ class LoginFragment @Inject constructor() : AbstractLoginFragment() {
private var passwordShown = false private var passwordShown = false
private var isSignupMode = false private var isSignupMode = false
// Temporary patch for https://github.com/vector-im/riotX-android/issues/1410, // Temporary patch for https://github.com/vector-im/riotX-android/issues/1410,
// waiting for https://github.com/matrix-org/synapse/issues/7576 // waiting for https://github.com/matrix-org/synapse/issues/7576
private var isNumericOnlyUserIdForbidden = false private var isNumericOnlyUserIdForbidden = false
@ -138,6 +139,7 @@ class LoginFragment @Inject constructor() : AbstractLoginFragment() {
loginServerIcon.isVisible = false loginServerIcon.isVisible = false
loginTitle.text = getString(R.string.login_signin_matrix_id_title) loginTitle.text = getString(R.string.login_signin_matrix_id_title)
loginNotice.text = getString(R.string.login_signin_matrix_id_notice) loginNotice.text = getString(R.string.login_signin_matrix_id_notice)
loginPasswordNotice.isVisible = true
} else { } else {
val resId = when (state.signMode) { val resId = when (state.signMode) {
SignMode.Unknown -> error("developer error") SignMode.Unknown -> error("developer error")
@ -165,6 +167,7 @@ class LoginFragment @Inject constructor() : AbstractLoginFragment() {
loginNotice.text = getString(R.string.login_server_other_text) loginNotice.text = getString(R.string.login_server_other_text)
} }
} }
loginPasswordNotice.isVisible = false
} }
} }

View File

@ -106,6 +106,16 @@
</FrameLayout> </FrameLayout>
<TextView
android:id="@+id/loginPasswordNotice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start"
android:text="@string/login_signin_matrix_id_password_notice"
android:textAppearance="@style/TextAppearance.Vector.Login.Text.Small"
android:visibility="gone"
tools:visibility="visible" />
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -188,35 +188,23 @@
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:text="@string/login_continue" android:text="@string/login_continue"
android:transitionName="loginSubmitTransition" android:transitionName="loginSubmitTransition"
app:layout_constraintBottom_toTopOf="@+id/loginServerIKnowMyIdNotice" app:layout_constraintBottom_toTopOf="@+id/loginServerIKnowMyIdSubmit"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/loginServerChoiceOther" /> app:layout_constraintTop_toBottomOf="@+id/loginServerChoiceOther" />
<TextView
android:id="@+id/loginServerIKnowMyIdNotice"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:text="@string/login_connect_using_matrix_id_notice"
android:textAppearance="@style/TextAppearance.Vector.Login.Text.Small"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/loginServerSubmit" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/loginServerIKnowMyIdSubmit" android:id="@+id/loginServerIKnowMyIdSubmit"
style="@style/Style.Vector.Login.Button.Text" style="@style/Style.Vector.Login.Button.Text"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginBottom="32dp"
android:text="@string/login_connect_using_matrix_id_submit" android:text="@string/login_connect_using_matrix_id_submit"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/loginServerIKnowMyIdNotice" /> app:layout_constraintTop_toBottomOf="@+id/loginServerSubmit" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1995,10 +1995,11 @@ Not all features in Riot are implemented in RiotX yet. Main missing (and coming
</plurals> </plurals>
<string name="login_connect_using_matrix_id_notice">Alternatively, if you already have an account and you know your Matrix identifier and your password, you can use this method:</string> <string name="login_connect_using_matrix_id_notice">Alternatively, if you already have an account and you know your Matrix identifier and your password, you can use this method:</string>
<string name="login_connect_using_matrix_id_submit">Sign in with my Matrix identifier</string> <string name="login_connect_using_matrix_id_submit">Sign in with Matrix ID</string>
<string name="login_signin_matrix_id_title">Sign in</string> <string name="login_signin_matrix_id_title">Sign in with Matrix ID</string>
<string name="login_signin_matrix_id_notice">Enter your identifier and your password</string> <string name="login_signin_matrix_id_notice">If you set up an account on a homeserver, use your Matrix ID (e.g. @user:domain.com) and password below.</string>
<string name="login_signin_matrix_id_hint">User identifier</string> <string name="login_signin_matrix_id_hint">Matrix ID</string>
<string name="login_signin_matrix_id_password_notice">If you dont know your password, go back to reset it.</string>
<string name="login_signin_matrix_id_error_invalid_matrix_id">This is not a valid user identifier. Expected format: \'@user:homeserver.org\'</string> <string name="login_signin_matrix_id_error_invalid_matrix_id">This is not a valid user identifier. Expected format: \'@user:homeserver.org\'</string>
<string name="autodiscover_well_known_error">Unable to find a valid homeserver. Please check your identifier</string> <string name="autodiscover_well_known_error">Unable to find a valid homeserver. Please check your identifier</string>