adding gradient background to the waiting for verification screen, matching designs

- renames drawable which redirects to the attribute colorBackground
This commit is contained in:
Adam Brown 2022-04-28 12:08:05 +01:00
parent eb4d31e955
commit 8a53eafa72
5 changed files with 37 additions and 4 deletions

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:angle="@integer/rtl_mirror_flip"
android:endColor="#55DFD1FF"
android:startColor="#55A5F2E0" />
</shape>
</item>
<item>
<shape>
<gradient
android:angle="90"
android:endColor="@android:color/transparent"
android:startColor="?android:colorBackground" />
</shape>
</item>
</layer-list>

View file

@ -29,6 +29,7 @@ import im.vector.app.core.utils.colorTerminatingFullStop
import im.vector.app.databinding.FragmentFtueWaitForEmailVerificationBinding
import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.RegisterAction
import im.vector.app.features.themes.ThemeProvider
import im.vector.app.features.themes.ThemeUtils
import kotlinx.parcelize.Parcelize
import javax.inject.Inject
@ -41,7 +42,9 @@ data class FtueAuthWaitForEmailFragmentArgument(
/**
* In this screen, the user is asked to check their emails.
*/
class FtueAuthWaitForEmailFragment @Inject constructor() : AbstractFtueAuthFragment<FragmentFtueWaitForEmailVerificationBinding>() {
class FtueAuthWaitForEmailFragment @Inject constructor(
private val themeProvider: ThemeProvider
) : AbstractFtueAuthFragment<FragmentFtueWaitForEmailVerificationBinding>() {
private val params: FtueAuthWaitForEmailFragmentArgument by args()
private var inferHasLeftAndReturnedToScreen = false
@ -56,6 +59,12 @@ class FtueAuthWaitForEmailFragment @Inject constructor() : AbstractFtueAuthFragm
}
private fun setupUi() {
views.emailVerificationGradientContainer.setBackgroundResource(
when (themeProvider.isLightTheme()) {
true -> R.drawable.bg_waiting_for_email_verification
false -> R.drawable.bg_color_background
}
)
views.emailVerificationTitle.text = R.string.ftue_auth_email_verification_title.colorTerminatingFullStop(R.attr.colorSecondary)
views.emailVerificationSubtitle.text = getString(R.string.ftue_auth_email_verification_subtitle, params.email)
views.emailVerificationResendEmail.debouncedClicks {

View file

@ -18,7 +18,6 @@ package im.vector.app.features.onboarding.ftueauth
import android.content.Context
import androidx.annotation.AttrRes
import androidx.annotation.ColorInt
import androidx.annotation.DrawableRes
import im.vector.app.R
import im.vector.app.core.resources.LocaleProvider
@ -29,7 +28,6 @@ import im.vector.app.features.themes.ThemeProvider
import im.vector.app.features.themes.ThemeUtils
import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence
import im.vector.lib.core.utils.epoxy.charsequence.toEpoxyCharSequence
import me.gujun.android.span.span
import javax.inject.Inject
class SplashCarouselStateFactory @Inject constructor(
@ -41,7 +39,7 @@ class SplashCarouselStateFactory @Inject constructor(
fun create(): SplashCarouselState {
val lightTheme = themeProvider.isLightTheme()
fun background(@DrawableRes lightDrawable: Int) = if (lightTheme) lightDrawable else R.drawable.bg_carousel_page_dark
fun background(@DrawableRes lightDrawable: Int) = if (lightTheme) lightDrawable else R.drawable.bg_color_background
fun hero(@DrawableRes lightDrawable: Int, @DrawableRes darkDrawable: Int) = if (lightTheme) lightDrawable else darkDrawable
return SplashCarouselState(
listOf(

View file

@ -19,6 +19,13 @@
android:orientation="vertical"
app:layout_constraintGuide_percent="@dimen/ftue_auth_gutter_end_percent" />
<View
android:id="@+id/emailVerificationGradientContainer"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintHeight_percent="0.60"
app:layout_constraintTop_toTopOf="parent" />
<Space
android:id="@+id/emailVerificationSpace1"
android:layout_width="match_parent"