Skip to content

Commit a4c1be0

Browse files
demolafthatfiredev
andauthored
fix: Provider button shape customization and theming API (#2288)
* feat: introduce provider button shape customization and update theming API * feat: add back navigation support to authentication screens * feat: add customizable screen transitions for Firebase Auth UI * feat: update theming API to support null theme inheritance and introduce adaptive theme * refactor: simplify theme observation in AuthUIThemeTest by using CompositionLocalProvider --------- Co-authored-by: Rosário P. Fernandes <[email protected]>
1 parent e92790d commit a4c1be0

File tree

22 files changed

+1775
-266
lines changed

22 files changed

+1775
-266
lines changed

app/src/main/java/com/firebaseui/android/demo/CustomSlotsThemingDemoActivity.kt

Lines changed: 321 additions & 41 deletions
Large diffs are not rendered by default.

app/src/main/java/com/firebaseui/android/demo/HighLevelApiDemoActivity.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import android.util.Log
55
import androidx.activity.ComponentActivity
66
import androidx.activity.compose.setContent
77
import androidx.activity.enableEdgeToEdge
8+
import androidx.compose.animation.slideInHorizontally
9+
import androidx.compose.animation.slideOutHorizontally
810
import androidx.compose.foundation.layout.Arrangement
911
import androidx.compose.foundation.layout.Column
1012
import androidx.compose.foundation.layout.Spacer
@@ -13,6 +15,7 @@ import androidx.compose.foundation.layout.height
1315
import androidx.compose.material3.Button
1416
import androidx.compose.material3.CircularProgressIndicator
1517
import androidx.compose.material3.MaterialTheme
18+
import androidx.compose.material3.ShapeDefaults
1619
import androidx.compose.material3.Surface
1720
import androidx.compose.material3.Text
1821
import androidx.compose.runtime.Composable
@@ -24,6 +27,7 @@ import androidx.compose.ui.unit.dp
2427
import com.firebase.ui.auth.AuthException
2528
import com.firebase.ui.auth.AuthState
2629
import com.firebase.ui.auth.FirebaseAuthUI
30+
import com.firebase.ui.auth.configuration.AuthUITransitions
2731
import com.firebase.ui.auth.configuration.PasswordRule
2832
import com.firebase.ui.auth.configuration.authUIConfiguration
2933
import com.firebase.ui.auth.configuration.auth_provider.AuthProvider
@@ -42,12 +46,23 @@ class HighLevelApiDemoActivity : ComponentActivity() {
4246
val authUI = FirebaseAuthUI.getInstance()
4347
val emailLink = intent.getStringExtra(EmailLinkConstants.EXTRA_EMAIL_LINK)
4448

49+
val customTheme = AuthUITheme.Default.copy(
50+
providerButtonShape = ShapeDefaults.ExtraLarge
51+
)
52+
4553
val configuration = authUIConfiguration {
4654
context = applicationContext
55+
theme = customTheme
4756
logo = AuthUIAsset.Resource(R.drawable.firebase_auth)
4857
tosUrl = "https://policies.google.com/terms"
4958
privacyPolicyUrl = "https://policies.google.com/privacy"
5059
isAnonymousUpgradeEnabled = false
60+
transitions = AuthUITransitions(
61+
enterTransition = { slideInHorizontally { it } },
62+
exitTransition = { slideOutHorizontally { -it } },
63+
popEnterTransition = { slideInHorizontally { -it } },
64+
popExitTransition = { slideOutHorizontally { it } }
65+
)
5166
providers {
5267
provider(AuthProvider.Anonymous)
5368
provider(

0 commit comments

Comments
 (0)