forked from github/wulkanowy-mirror
Add "I forgot my password" button in upper bar (#1375)
This commit is contained in:
parent
b9a12e46bf
commit
44888b048d
@ -79,6 +79,7 @@ class LoginFormFragment : BaseFragment<FragmentLoginFormBinding>(R.layout.fragme
|
||||
loginFormFaq.setOnClickListener { presenter.onFaqClick() }
|
||||
loginFormContactEmail.setOnClickListener { presenter.onEmailClick() }
|
||||
loginFormRecoverLink.setOnClickListener { presenter.onRecoverClick() }
|
||||
loginFormRecoverLinkSecond.setOnClickListener { presenter.onRecoverClick() }
|
||||
loginFormPass.setOnEditorDoneSignIn { loginFormSignIn.callOnClick() }
|
||||
}
|
||||
|
||||
@ -110,49 +111,42 @@ class LoginFormFragment : BaseFragment<FragmentLoginFormBinding>(R.layout.fragme
|
||||
|
||||
override fun setErrorUsernameRequired() {
|
||||
with(binding.loginFormUsernameLayout) {
|
||||
requestFocus()
|
||||
error = getString(R.string.login_field_required)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setErrorLoginRequired() {
|
||||
with(binding.loginFormUsernameLayout) {
|
||||
requestFocus()
|
||||
error = getString(R.string.login_invalid_login)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setErrorEmailRequired() {
|
||||
with(binding.loginFormUsernameLayout) {
|
||||
requestFocus()
|
||||
error = getString(R.string.login_invalid_email)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setErrorPassRequired(focus: Boolean) {
|
||||
with(binding.loginFormPassLayout) {
|
||||
if (focus) requestFocus()
|
||||
error = getString(R.string.login_field_required)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setErrorPassInvalid(focus: Boolean) {
|
||||
with(binding.loginFormPassLayout) {
|
||||
if (focus) requestFocus()
|
||||
error = getString(R.string.login_invalid_password)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setErrorPassIncorrect() {
|
||||
with(binding.loginFormPassLayout) {
|
||||
requestFocus()
|
||||
error = getString(R.string.login_incorrect_password)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setErrorEmailInvalid(domain: String) {
|
||||
with(binding.loginFormUsernameLayout) {
|
||||
requestFocus()
|
||||
error = getString(R.string.login_invalid_custom_email,domain)
|
||||
}
|
||||
}
|
||||
@ -196,6 +190,7 @@ class LoginFormFragment : BaseFragment<FragmentLoginFormBinding>(R.layout.fragme
|
||||
|
||||
override fun showContact(show: Boolean) {
|
||||
binding.loginFormContact.visibility = if (show) VISIBLE else GONE
|
||||
binding.loginFormRecoverLink.visibility = if (show) GONE else VISIBLE
|
||||
}
|
||||
|
||||
override fun openAdvancedLogin() {
|
||||
|
@ -81,6 +81,22 @@
|
||||
app:icon="@drawable/ic_about_faq" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/loginFormRecoverLinkSecond"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:text="@string/login_recover_button"
|
||||
app:fontFamily="sans-serif-medium"
|
||||
app:icon="@drawable/ic_all_about"
|
||||
app:layout_constraintBottom_toTopOf="@id/loginFormHostLayout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/loginFormPassLayout"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:id="@+id/loginFormContactDivider"
|
||||
android:layout_width="match_parent"
|
||||
@ -95,7 +111,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginRight="32dp"
|
||||
android:gravity="center_horizontal"
|
||||
@ -106,7 +122,9 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/loginFormContact"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
app:layout_constraintVertical_bias="0"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_goneMarginTop="64dp" />
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
@ -170,7 +188,6 @@
|
||||
android:maxLines="1"
|
||||
app:fontFamily="sans-serif"
|
||||
tools:targetApi="o" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
|
Loading…
x
Reference in New Issue
Block a user