Merge pull request #4964 from vector-im/feature/adm/splash-carousel-review

Enabling FTUE splash carousel
This commit is contained in:
Adam Brown 2022-01-19 15:52:25 +00:00 committed by GitHub
commit 491044b0c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 32 additions and 25 deletions

1
changelog.d/4584.feature Normal file
View file

@ -0,0 +1 @@
Enables the FTUE splash carousel

View file

@ -1,7 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="270"
android:endColor="?vctr_system"
android:startColor="#000000" />
<solid android:color="?android:colorBackground" />
</shape>

View file

@ -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 {

View file

@ -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
}

View file

@ -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))
}

View file

@ -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))
}

View file

@ -182,13 +182,13 @@
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"
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" />
<Button
android:id="@+id/loginSplashAlreadyHaveAccount"

View file

@ -61,13 +61,13 @@
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"
app:layout_constraintEnd_toEndOf="@id/splashCarouselGutterEnd"
app:layout_constraintStart_toStartOf="@id/splashCarouselGutterStart"
app:layout_constraintTop_toBottomOf="@id/loginSplashButtonsSpace" />
app:layout_constraintTop_toBottomOf="@id/loginSplashButtonsSpace"
tools:text="@string/login_splash_create_account" />
<Button
android:id="@+id/loginSplashAlreadyHaveAccount"

View file

@ -18,13 +18,6 @@
<string name="cut_the_slack_from_teams" translatable="false">Cut the slack from teams.</string>
<!-- WIP strings, will move to strings.xml when signed off -->
<string name="ftue_auth_carousel_body_secure" translatable="false">Secure and independent communication that gives you the same level of privacy as a face-to-face conversation in your own home.</string>
<string name="ftue_auth_carousel_body_control" translatable="false">Choose where your conversations are kept, giving you control and independence. Connected via Matrix.</string>
<string name="ftue_auth_carousel_body_encrypted" translatable="false">End-to-end encrypted and no phone number required. No ads or datamining.</string>
<string name="ftue_auth_carousel_title_messaging" translatable="false">Messaging for your team.</string>
<!-- Note to translators: the translation MUST contain the string "${app_name}", which will be replaced by the application name -->
<string name="template_ftue_auth_carousel_body_workplace" translatable="false">${app_name} is also great for the workplace. Its trusted by the worlds most secure organisations.</string>
<string name="ftue_auth_use_case_title" translatable="false">Who will you chat to the most?</string>
<string name="ftue_auth_use_case_subtitle" translatable="false">We\'ll help you get connected.</string>
<string name="ftue_auth_use_case_option_one" translatable="false">Friends and family</string>

View file

@ -2526,18 +2526,26 @@
<string name="ftue_auth_carousel_2_title">You\'re in control.</string>
<!-- TODO TO BE REMOVED -->
<string name="ftue_auth_carousel_2_body">Element lets you choose where your messages are stored, keeping you in control of your data.</string>
<string name="ftue_auth_carousel_3_title">Secure Messaging.</string>
<string name="ftue_auth_carousel_3_title">Secure messaging.</string>
<!-- TODO TO BE REMOVED -->
<string name="ftue_auth_carousel_3_body">No phone number required, so you don\'t have to share those details with the outside world. No ads, no datamining.</string>
<string name="ftue_auth_carousel_4_title">Cut the slack from teams.</string>
<!-- TODO TO BE REMOVED -->
<string name="ftue_auth_carousel_4_body">As universal as email, Element is a completely new type of collaboration.</string>
<string name="ftue_auth_carousel_body_secure">Secure and independent communication that gives you the same level of privacy as a face-to-face conversation in your own home.</string>
<string name="ftue_auth_carousel_body_control">Choose where your conversations are kept, giving you control and independence. Connected via Matrix.</string>
<string name="ftue_auth_carousel_body_encrypted">End-to-end encrypted and no phone number required. No ads or datamining.</string>
<string name="ftue_auth_carousel_title_messaging">Messaging for your team.</string>
<!-- Note to translators: the translation MUST contain the string "${app_name}", which will be replaced by the application name -->
<string name="template_ftue_auth_carousel_body_workplace" translatable="false">${app_name} is also great for the workplace. Its trusted by the worlds most secure organisations.</string>
<string name="login_splash_title">It\'s your conversation. Own it.</string>
<string name="login_splash_text1">Chat with people directly or in groups</string>
<string name="login_splash_text2">Keep conversations private with encryption</string>
<string name="login_splash_text3">Extend &amp; customise your experience</string>
<string name="login_splash_submit">Get started</string>
<string name="login_splash_create_account">Create account</string>
<string name="login_splash_already_have_account">I already have an account</string>
<string name="login_server_title">Select a server</string>