From 00f2947636cec91629e4cbf500731a3ef6c38e35 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Mon, 17 Jan 2022 17:20:41 +0000 Subject: [PATCH 1/5] enabling the splash carousel feature by default --- changelog.d/4584.feature | 1 + vector/src/main/java/im/vector/app/features/VectorFeatures.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/4584.feature diff --git a/changelog.d/4584.feature b/changelog.d/4584.feature new file mode 100644 index 0000000000..6c0de3b34f --- /dev/null +++ b/changelog.d/4584.feature @@ -0,0 +1 @@ +Enables the FTUE splash carousel \ No newline at end of file diff --git a/vector/src/main/java/im/vector/app/features/VectorFeatures.kt b/vector/src/main/java/im/vector/app/features/VectorFeatures.kt index 25c204f2ef..03e9954b2c 100644 --- a/vector/src/main/java/im/vector/app/features/VectorFeatures.kt +++ b/vector/src/main/java/im/vector/app/features/VectorFeatures.kt @@ -35,6 +35,6 @@ interface VectorFeatures { class DefaultVectorFeatures : VectorFeatures { override fun onboardingVariant(): VectorFeatures.OnboardingVariant = BuildConfig.ONBOARDING_VARIANT override fun isOnboardingAlreadyHaveAccountSplashEnabled() = true - override fun isOnboardingSplashCarouselEnabled() = false + override fun isOnboardingSplashCarouselEnabled() = true override fun isOnboardingUseCaseEnabled() = false } From 36a26fcfd0625d6fceaf110d336fe48b2e95d84a Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Mon, 17 Jan 2022 17:32:15 +0000 Subject: [PATCH 2/5] replacing the dark carousel background with a solid colour as par design changes --- .../src/main/res/drawable/bg_carousel_page_dark.xml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/library/ui-styles/src/main/res/drawable/bg_carousel_page_dark.xml b/library/ui-styles/src/main/res/drawable/bg_carousel_page_dark.xml index f229c51d1b..2542ff2b1d 100644 --- a/library/ui-styles/src/main/res/drawable/bg_carousel_page_dark.xml +++ b/library/ui-styles/src/main/res/drawable/bg_carousel_page_dark.xml @@ -1,7 +1,4 @@ - + \ No newline at end of file From 8f98f3e6d08a1011f76f788faf36c5cd8eed8b21 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Tue, 18 Jan 2022 16:36:01 +0000 Subject: [PATCH 3/5] promoting wip carousel strings --- vector/src/main/res/values/donottranslate.xml | 7 ------- vector/src/main/res/values/strings.xml | 9 ++++++++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/vector/src/main/res/values/donottranslate.xml b/vector/src/main/res/values/donottranslate.xml index ab50d7e7c3..af2319883c 100755 --- a/vector/src/main/res/values/donottranslate.xml +++ b/vector/src/main/res/values/donottranslate.xml @@ -18,13 +18,6 @@ Cut the slack from teams. - Secure and independent communication that gives you the same level of privacy as a face-to-face conversation in your own home. - Choose where your conversations are kept, giving you control and independence. Connected via Matrix. - End-to-end encrypted and no phone number required. No ads or datamining. - Messaging for your team. - - ${app_name} is also great for the workplace. It’s trusted by the world’s most secure organisations. - Who will you chat to the most? We\'ll help you get connected. Friends and family diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index 27bab7d66f..5480f7f433 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -2526,13 +2526,20 @@ You\'re in control. Element lets you choose where your messages are stored, keeping you in control of your data. - Secure Messaging. + Secure messaging. No phone number required, so you don\'t have to share those details with the outside world. No ads, no datamining. Cut the slack from teams. As universal as email, Element is a completely new type of collaboration. + Secure and independent communication that gives you the same level of privacy as a face-to-face conversation in your own home. + Choose where your conversations are kept, giving you control and independence. Connected via Matrix. + End-to-end encrypted and no phone number required. No ads or datamining. + Messaging for your team. + + ${app_name} is also great for the workplace. It’s trusted by the world’s most secure organisations. + It\'s your conversation. Own it. Chat with people directly or in groups Keep conversations private with encryption From 211f1840669ffd92997d3fbec1662a4da02220be Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Wed, 19 Jan 2022 09:49:17 +0000 Subject: [PATCH 4/5] updating splash submit copy to use Create account when the I already have an account feature is enabled --- .../java/im/vector/app/ui/robot/OnboardingRobot.kt | 2 +- .../ftueauth/FtueAuthSplashCarouselFragment.kt | 12 ++++++++---- .../onboarding/ftueauth/FtueAuthSplashFragment.kt | 10 +++++++--- .../main/res/layout/fragment_ftue_auth_splash.xml | 1 - .../res/layout/fragment_ftue_splash_carousel.xml | 1 - vector/src/main/res/values/strings.xml | 1 + 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/vector/src/androidTest/java/im/vector/app/ui/robot/OnboardingRobot.kt b/vector/src/androidTest/java/im/vector/app/ui/robot/OnboardingRobot.kt index 62d446fe84..47bf31355c 100644 --- a/vector/src/androidTest/java/im/vector/app/ui/robot/OnboardingRobot.kt +++ b/vector/src/androidTest/java/im/vector/app/ui/robot/OnboardingRobot.kt @@ -63,7 +63,7 @@ class OnboardingRobot { password: String, homeServerUrl: String) { waitUntilViewVisible(withId(R.id.loginSplashSubmit)) - assertDisplayed(R.id.loginSplashSubmit, R.string.login_splash_submit) + assertDisplayed(R.id.loginSplashSubmit, R.string.login_splash_create_account) if (createAccount) { clickOn(R.id.loginSplashSubmit) } else { diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashCarouselFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashCarouselFragment.kt index 038e020cf6..49e8875cb5 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashCarouselFragment.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashCarouselFragment.kt @@ -68,9 +68,13 @@ class FtueAuthSplashCarouselFragment @Inject constructor( TabLayoutMediator(views.carouselIndicator, views.splashCarousel) { _, _ -> }.attach() carouselController.setData(carouselStateFactory.create()) - views.loginSplashSubmit.debouncedClicks { getStarted() } + val isAlreadyHaveAccountEnabled = vectorFeatures.isOnboardingAlreadyHaveAccountSplashEnabled() + views.loginSplashSubmit.apply { + setText(if (isAlreadyHaveAccountEnabled) R.string.login_splash_create_account else R.string.login_splash_submit) + debouncedClicks { splashSubmit(isAlreadyHaveAccountEnabled) } + } views.loginSplashAlreadyHaveAccount.apply { - isVisible = vectorFeatures.isOnboardingAlreadyHaveAccountSplashEnabled() + isVisible = isAlreadyHaveAccountEnabled debouncedClicks { alreadyHaveAnAccount() } } @@ -111,8 +115,8 @@ class FtueAuthSplashCarouselFragment @Inject constructor( } } - private fun getStarted() { - val getStartedFlow = if (vectorFeatures.isOnboardingAlreadyHaveAccountSplashEnabled()) OnboardingFlow.SignUp else OnboardingFlow.SignInSignUp + private fun splashSubmit(isAlreadyHaveAccountEnabled: Boolean) { + val getStartedFlow = if (isAlreadyHaveAccountEnabled) OnboardingFlow.SignUp else OnboardingFlow.SignInSignUp viewModel.handle(OnboardingAction.OnGetStarted(resetLoginConfig = false, onboardingFlow = getStartedFlow)) } diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashFragment.kt index fd63889fd6..031579db5f 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashFragment.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashFragment.kt @@ -53,7 +53,11 @@ class FtueAuthSplashFragment @Inject constructor( } private fun setupViews() { - views.loginSplashSubmit.debouncedClicks { getStarted() } + val isAlreadyHaveAccountEnabled = vectorFeatures.isOnboardingAlreadyHaveAccountSplashEnabled() + views.loginSplashSubmit.apply { + setText(if (isAlreadyHaveAccountEnabled) R.string.login_splash_create_account else R.string.login_splash_submit) + debouncedClicks { splashSubmit(isAlreadyHaveAccountEnabled) } + } views.loginSplashAlreadyHaveAccount.apply { isVisible = vectorFeatures.isOnboardingAlreadyHaveAccountSplashEnabled() debouncedClicks { alreadyHaveAnAccount() } @@ -69,8 +73,8 @@ class FtueAuthSplashFragment @Inject constructor( } } - private fun getStarted() { - val getStartedFlow = if (vectorFeatures.isOnboardingAlreadyHaveAccountSplashEnabled()) OnboardingFlow.SignUp else OnboardingFlow.SignInSignUp + private fun splashSubmit(isAlreadyHaveAccountEnabled: Boolean) { + val getStartedFlow = if (isAlreadyHaveAccountEnabled) OnboardingFlow.SignUp else OnboardingFlow.SignInSignUp viewModel.handle(OnboardingAction.OnGetStarted(resetLoginConfig = false, onboardingFlow = getStartedFlow)) } diff --git a/vector/src/main/res/layout/fragment_ftue_auth_splash.xml b/vector/src/main/res/layout/fragment_ftue_auth_splash.xml index 803ad700db..afe086f484 100644 --- a/vector/src/main/res/layout/fragment_ftue_auth_splash.xml +++ b/vector/src/main/res/layout/fragment_ftue_auth_splash.xml @@ -182,7 +182,6 @@ style="@style/Widget.Vector.Button.Login" android:layout_width="0dp" android:layout_height="wrap_content" - android:text="@string/login_splash_submit" android:textAllCaps="true" android:transitionName="loginSubmitTransition" app:layout_constraintBottom_toTopOf="@id/loginSplashSpace5" diff --git a/vector/src/main/res/layout/fragment_ftue_splash_carousel.xml b/vector/src/main/res/layout/fragment_ftue_splash_carousel.xml index facef377d4..c049ec81d9 100644 --- a/vector/src/main/res/layout/fragment_ftue_splash_carousel.xml +++ b/vector/src/main/res/layout/fragment_ftue_splash_carousel.xml @@ -61,7 +61,6 @@ style="@style/Widget.Vector.Button.Login" android:layout_width="0dp" android:layout_height="wrap_content" - android:text="@string/login_splash_submit" android:textAllCaps="true" android:transitionName="loginSubmitTransition" app:layout_constraintBottom_toTopOf="@id/loginSplashAlreadyHaveAccount" diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index 5480f7f433..110d1e651b 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -2545,6 +2545,7 @@ Keep conversations private with encryption Extend & customise your experience Get started + Create account I already have an account Select a server From 3c7f2c5bdfa8b2cf69531f6946ab8b33de7bd9d3 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Wed, 19 Jan 2022 11:18:54 +0000 Subject: [PATCH 5/5] adding tools:text for dynamically set text --- vector/src/main/res/layout/fragment_ftue_auth_splash.xml | 3 ++- vector/src/main/res/layout/fragment_ftue_splash_carousel.xml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/vector/src/main/res/layout/fragment_ftue_auth_splash.xml b/vector/src/main/res/layout/fragment_ftue_auth_splash.xml index afe086f484..ef3d015bdb 100644 --- a/vector/src/main/res/layout/fragment_ftue_auth_splash.xml +++ b/vector/src/main/res/layout/fragment_ftue_auth_splash.xml @@ -187,7 +187,8 @@ app:layout_constraintBottom_toTopOf="@id/loginSplashSpace5" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/loginSplashSpace4" /> + app:layout_constraintTop_toBottomOf="@id/loginSplashSpace4" + tools:text="@string/login_splash_create_account" />