-
Notifications
You must be signed in to change notification settings - Fork 860
FTUE - Combined registration #5648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b439322
2cbbfca
7e5c3df
1198344
585ac4b
c3ab895
e8791fb
53675b5
bc4566d
12ae35f
d302875
c83882d
aa5054c
32b54e1
4e215fa
4c1c9a5
468a81e
c45c421
801fb90
13fb4e5
5120e7a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Adding combined account creation and server selection screen as part of the new FTUE |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| /* | ||
| * Copyright (c) 2022 New Vector Ltd | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package im.vector.app.core.extensions | ||
|
|
||
| import com.google.android.material.textfield.TextInputLayout | ||
| import kotlinx.coroutines.flow.map | ||
| import reactivecircus.flowbinding.android.widget.textChanges | ||
|
|
||
| fun TextInputLayout.editText() = this.editText!! | ||
|
|
||
| /** | ||
| * Detect if a field starts or ends with spaces | ||
| */ | ||
| fun TextInputLayout.hasSurroundingSpaces() = editText().text.toString().let { it.trim() != it } | ||
|
|
||
| fun TextInputLayout.hasContentFlow(mapper: (CharSequence) -> CharSequence = { it }) = editText().textChanges().map { mapper(it).isNotEmpty() } | ||
|
|
||
| fun TextInputLayout.content() = editText().text.toString() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ sealed interface OnboardingAction : VectorViewModelAction { | |
|
|
||
| // Login or Register, depending on the signMode | ||
| data class LoginOrRegister(val username: String, val password: String, val initialDeviceName: String) : OnboardingAction | ||
| data class Register(val username: String, val password: String, val initialDeviceName: String) : OnboardingAction | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Concerning the naming, I think we should stick to either
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 100% agree, would favour using register & login. For now I'll rename the code introduced by the PR rather than renaming the entire |
||
| object StopEmailValidationCheck : OnboardingAction | ||
|
|
||
| data class PostRegisterAction(val registerAction: RegisterAction) : OnboardingAction | ||
|
|
@@ -51,7 +52,7 @@ sealed interface OnboardingAction : VectorViewModelAction { | |
| object ResetHomeServerType : ResetAction | ||
| object ResetHomeServerUrl : ResetAction | ||
| object ResetSignMode : ResetAction | ||
| object ResetLogin : ResetAction | ||
| object ResetAuthenticationAttempt : ResetAction | ||
| object ResetResetPassword : ResetAction | ||
|
|
||
| // Homeserver history | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it would be interesting to have a comment explaining the purpose of the method? If my understanding is correct it only updates the children views according to the height but there is no mention of that in the function name. Do you think the current naming is sufficient?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great point, will do! the tl;dr is that constraint layouts within scrollviews use the total scrolling height rather than the viewport, which means percentages change size depending on how much they can scroll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c45c421