From b2ee7f327f1966ed86d390b3df8673d9ebf36861 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Wed, 13 Jul 2022 09:31:33 +0100 Subject: [PATCH 01/73] removing homeserver description to match updated designs - it was hardcoded for matrix.org and made other server selections cause the page balance to feel off --- .../onboarding/OnboardingViewState.kt | 1 - .../StartAuthenticationFlowUseCase.kt | 10 -------- .../ftueauth/FtueAuthCombinedLoginFragment.kt | 1 - .../FtueAuthCombinedRegisterFragment.kt | 1 - .../fragment_ftue_combined_register.xml | 18 +++----------- .../StartAuthenticationFlowUseCaseTest.kt | 24 +------------------ 6 files changed, 4 insertions(+), 51 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewState.kt b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewState.kt index c072f13bca..cb8113157f 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewState.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewState.kt @@ -66,7 +66,6 @@ enum class OnboardingFlow { @Parcelize data class SelectedHomeserverState( - val description: String? = null, val userFacingUrl: String? = null, val upstreamUrl: String? = null, val preferredLoginMode: LoginMode = LoginMode.Unknown, diff --git a/vector/src/main/java/im/vector/app/features/onboarding/StartAuthenticationFlowUseCase.kt b/vector/src/main/java/im/vector/app/features/onboarding/StartAuthenticationFlowUseCase.kt index 7b6205bfce..2dc9a05154 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/StartAuthenticationFlowUseCase.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/StartAuthenticationFlowUseCase.kt @@ -16,10 +16,7 @@ package im.vector.app.features.onboarding -import im.vector.app.R import im.vector.app.core.extensions.containsAllItems -import im.vector.app.core.resources.StringProvider -import im.vector.app.core.utils.ensureTrailingSlash import im.vector.app.features.login.LoginMode import org.matrix.android.sdk.api.auth.AuthenticationService import org.matrix.android.sdk.api.auth.data.HomeServerConnectionConfig @@ -29,7 +26,6 @@ import javax.inject.Inject class StartAuthenticationFlowUseCase @Inject constructor( private val authenticationService: AuthenticationService, - private val stringProvider: StringProvider ) { suspend fun execute(config: HomeServerConnectionConfig): StartAuthenticationResult { @@ -46,10 +42,6 @@ class StartAuthenticationFlowUseCase @Inject constructor( config: HomeServerConnectionConfig, preferredLoginMode: LoginMode ) = SelectedHomeserverState( - description = when (config.homeServerUri.toString()) { - matrixOrgUrl() -> stringProvider.getString(R.string.ftue_auth_create_account_matrix_dot_org_server_description) - else -> null - }, userFacingUrl = config.homeServerUri.toString(), upstreamUrl = authFlow.homeServerUrl, preferredLoginMode = preferredLoginMode, @@ -57,8 +49,6 @@ class StartAuthenticationFlowUseCase @Inject constructor( isLogoutDevicesSupported = authFlow.isLogoutDevicesSupported ) - private fun matrixOrgUrl() = stringProvider.getString(R.string.matrix_org_server_url).ensureTrailingSlash() - private fun LoginFlowResult.findPreferredLoginMode() = when { supportedLoginTypes.containsAllItems(LoginFlowTypes.SSO, LoginFlowTypes.PASSWORD) -> LoginMode.SsoAndPassword(ssoIdentityProviders) supportedLoginTypes.contains(LoginFlowTypes.SSO) -> LoginMode.Sso(ssoIdentityProviders) diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedLoginFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedLoginFragment.kt index d9086952da..6f23bac1b3 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedLoginFragment.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedLoginFragment.kt @@ -105,7 +105,6 @@ class FtueAuthCombinedLoginFragment @Inject constructor( setupAutoFill() views.selectedServerName.text = state.selectedHomeserver.userFacingUrl.toReducedUrl() - views.selectedServerDescription.text = state.selectedHomeserver.description if (state.isLoading) { // Ensure password is hidden diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedRegisterFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedRegisterFragment.kt index 7df1940970..14e6b44086 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedRegisterFragment.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedRegisterFragment.kt @@ -155,7 +155,6 @@ class FtueAuthCombinedRegisterFragment @Inject constructor() : AbstractSSOFtueAu setupAutoFill() views.selectedServerName.text = state.selectedHomeserver.userFacingUrl.toReducedUrl() - views.selectedServerDescription.text = state.selectedHomeserver.description if (state.isLoading) { // Ensure password is hidden diff --git a/vector/src/main/res/layout/fragment_ftue_combined_register.xml b/vector/src/main/res/layout/fragment_ftue_combined_register.xml index 304e5b475f..492ac61d93 100644 --- a/vector/src/main/res/layout/fragment_ftue_combined_register.xml +++ b/vector/src/main/res/layout/fragment_ftue_combined_register.xml @@ -110,22 +110,10 @@ android:layout_height="wrap_content" android:layout_marginStart="12dp" android:textColor="?vctr_content_primary" - app:layout_constraintBottom_toTopOf="@id/selectedServerDescription" - app:layout_constraintEnd_toStartOf="@id/editServerButton" - app:layout_constraintStart_toStartOf="@id/createAccountGutterStart" - app:layout_constraintTop_toBottomOf="@id/chooseYourServerHeader" /> - - + app:layout_constraintTop_toBottomOf="@id/chooseYourServerHeader" />