Skip to content

Commit 764fd34

Browse files
committed
fix: small fixes before v10
1 parent 16cda47 commit 764fd34

File tree

4 files changed

+46
-33
lines changed

4 files changed

+46
-33
lines changed

auth/src/main/AndroidManifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@
109109
android:label="@string/fui_default_toolbar_title"
110110
android:exported="false" />
111111

112+
<activity
113+
android:name=".compose.FirebaseAuthActivity"
114+
android:label=""
115+
android:exported="false" />
116+
112117
<activity
113118
android:name="com.facebook.FacebookActivity"
114119
android:label="@string/app_name"

auth/src/main/java/com/firebase/ui/auth/compose/FirebaseAuthActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import android.content.Intent
2020
import android.os.Bundle
2121
import androidx.activity.ComponentActivity
2222
import androidx.activity.compose.setContent
23+
import androidx.activity.enableEdgeToEdge
2324
import androidx.compose.runtime.collectAsState
2425
import androidx.compose.runtime.getValue
2526
import androidx.lifecycle.lifecycleScope
@@ -76,6 +77,7 @@ class FirebaseAuthActivity : ComponentActivity() {
7677

7778
override fun onCreate(savedInstanceState: Bundle?) {
7879
super.onCreate(savedInstanceState)
80+
enableEdgeToEdge()
7981

8082
// Extract configuration from cache using UUID key
8183
val configKey = intent.getStringExtra(EXTRA_CONFIGURATION_KEY)

composeapp/src/main/java/com/firebase/composeapp/CustomSlotsThemingDemoActivity.kt

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import com.firebase.ui.auth.compose.FirebaseAuthUI
2222
import com.firebase.ui.auth.compose.configuration.PasswordRule
2323
import com.firebase.ui.auth.compose.configuration.authUIConfiguration
2424
import com.firebase.ui.auth.compose.configuration.auth_provider.AuthProvider
25+
import com.firebase.ui.auth.compose.configuration.string_provider.LocalAuthUIStringProvider
2526
import com.firebase.ui.auth.compose.configuration.theme.AuthUIAsset
2627
import com.firebase.ui.auth.compose.configuration.theme.AuthUITheme
2728
import com.firebase.ui.auth.compose.ui.screens.EmailAuthContentState
@@ -275,22 +276,25 @@ fun EmailAuthDemo(
275276
}
276277
} else {
277278
// Show custom email auth UI using slot API
278-
EmailAuthScreen(
279-
context = context,
280-
configuration = configuration,
281-
authUI = authUI,
282-
onSuccess = { result: AuthResult ->
283-
Log.d("CustomSlotsDemo", "Email auth success: ${result.user?.uid}")
284-
},
285-
onError = { exception: AuthException ->
286-
Log.e("CustomSlotsDemo", "Email auth error", exception)
287-
},
288-
onCancel = {
289-
Log.d("CustomSlotsDemo", "Email auth cancelled")
279+
// Provide the string provider required by EmailAuthScreen
280+
CompositionLocalProvider(LocalAuthUIStringProvider provides configuration.stringProvider) {
281+
EmailAuthScreen(
282+
context = context,
283+
configuration = configuration,
284+
authUI = authUI,
285+
onSuccess = { result: AuthResult ->
286+
Log.d("CustomSlotsDemo", "Email auth success: ${result.user?.uid}")
287+
},
288+
onError = { exception: AuthException ->
289+
Log.e("CustomSlotsDemo", "Email auth error", exception)
290+
},
291+
onCancel = {
292+
Log.d("CustomSlotsDemo", "Email auth cancelled")
293+
}
294+
) { state: EmailAuthContentState ->
295+
// Custom UI using the slot API
296+
CustomEmailAuthUI(state)
290297
}
291-
) { state: EmailAuthContentState ->
292-
// Custom UI using the slot API
293-
CustomEmailAuthUI(state)
294298
}
295299
}
296300
}
@@ -609,22 +613,25 @@ fun PhoneAuthDemo(
609613
}
610614
} else {
611615
// Show custom phone auth UI using slot API
612-
PhoneAuthScreen(
613-
context = context,
614-
configuration = configuration,
615-
authUI = authUI,
616-
onSuccess = { result: AuthResult ->
617-
Log.d("CustomSlotsDemo", "Phone auth success: ${result.user?.uid}")
618-
},
619-
onError = { exception: AuthException ->
620-
Log.e("CustomSlotsDemo", "Phone auth error", exception)
621-
},
622-
onCancel = {
623-
Log.d("CustomSlotsDemo", "Phone auth cancelled")
616+
// Provide the string provider required by PhoneAuthScreen
617+
CompositionLocalProvider(LocalAuthUIStringProvider provides configuration.stringProvider) {
618+
PhoneAuthScreen(
619+
context = context,
620+
configuration = configuration,
621+
authUI = authUI,
622+
onSuccess = { result: AuthResult ->
623+
Log.d("CustomSlotsDemo", "Phone auth success: ${result.user?.uid}")
624+
},
625+
onError = { exception: AuthException ->
626+
Log.e("CustomSlotsDemo", "Phone auth error", exception)
627+
},
628+
onCancel = {
629+
Log.d("CustomSlotsDemo", "Phone auth cancelled")
630+
}
631+
) { state: PhoneAuthContentState ->
632+
// Custom UI using the slot API
633+
CustomPhoneAuthUI(state)
624634
}
625-
) { state: PhoneAuthContentState ->
626-
// Custom UI using the slot API
627-
CustomPhoneAuthUI(state)
628635
}
629636
}
630637
}

composeapp/src/main/java/com/firebase/composeapp/HighLevelApiDemoActivity.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class HighLevelApiDemoActivity : ComponentActivity() {
4545

4646
val configuration = authUIConfiguration {
4747
context = applicationContext
48-
locale = Locale.GERMANY
4948
providers {
5049
provider(AuthProvider.Anonymous)
5150
provider(
@@ -99,8 +98,8 @@ class HighLevelApiDemoActivity : ComponentActivity() {
9998
)
10099
provider(
101100
AuthProvider.Apple(
102-
locale = "DE",
103-
customParameters = emptyMap()
101+
customParameters = emptyMap(),
102+
locale = null
104103
)
105104
)
106105
provider(

0 commit comments

Comments
 (0)