Skip to content

Commit

Permalink
Update sso button design
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle committed Feb 26, 2025
1 parent 7211f84 commit ee7fe61
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package im.vector.app.features.onboarding.ftueauth

import android.annotation.SuppressLint
import android.graphics.Rect
import android.graphics.Typeface
import android.os.Bundle
import android.text.Spannable
Expand Down Expand Up @@ -53,14 +54,16 @@ class FtueAuthSplashFragment :
// TCHAP Login with SSO
val isAlreadyHaveAccountEnabled = vectorFeatures.isOnboardingAlreadyHaveAccountSplashEnabled()
views.loginSplashSSO.apply {
val spannable = SpannableString(getString(CommonStrings.login_social_signin_with, TCHAP_SSO_PROVIDER))
val ssoProvider = "\n$TCHAP_SSO_PROVIDER"
val spannable = SpannableString(getString(CommonStrings.login_social_signin_with, ssoProvider))
spannable.setSpan(StyleSpan(Typeface.BOLD), spannable.length - TCHAP_SSO_PROVIDER.length, spannable.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

text = spannable
isVisible = isAlreadyHaveAccountEnabled && vectorFeatures.tchapIsSSOEnabled()
setCompoundDrawablesWithIntrinsicBounds(
ContextCompat.getDrawable(requireContext(), im.vector.lib.ui.styles.R.drawable.ic_tchap_proconnect), null, null, null
)
val ssoIcon = ContextCompat.getDrawable(requireContext(), im.vector.lib.ui.styles.R.drawable.ic_tchap_proconnect)?.apply {
bounds = Rect(0, 0, 132, 117)
}
setCompoundDrawables(ssoIcon, null, null, null)
debouncedClicks { alreadyHaveAnAccountWithSSO() }
}
views.loginSplashSSOHelp.apply {
Expand Down
13 changes: 8 additions & 5 deletions vector/src/main/res/layout/fragment_tchap_welcome.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,23 @@

<Button
android:id="@+id/loginSplashSSO"
style="@style/Widget.Vector.Button.Login"
android:layout_width="240dp"
style="@style/Widget.MaterialComponents.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start|center_vertical"
android:paddingHorizontal="25dp"
android:paddingVertical="10dp"
android:lineSpacingMultiplier="0.85"
android:textAllCaps="false"
android:textSize="16sp"
android:fontFamily="sans-serif-light"
app:cornerRadius="0dp"
app:layout_constraintBottom_toTopOf="@id/loginSplashSubmit"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.502"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/fragment_tchap_welcome_subtitle"
app:layout_constraintVertical_bias="0.492"
tools:drawableLeft="@drawable/ic_tchap_proconnect"
tools:text="@string/login_social_signin_with" />
tools:text="S’identifier avec \nProConnect" />

<Button
android:id="@+id/loginSplashSSOHelp"
Expand Down

0 comments on commit ee7fe61

Please sign in to comment.