@@ -204,7 +204,7 @@ startActivityForResult(
204
204
RC_SIGN_IN );
205
205
```
206
206
207
- If a terms of service URL, privacy policy URL, and a custom theme are required:
207
+ If a terms of service URL and privacy policy URL are required:
208
208
209
209
``` java
210
210
startActivityForResult(
@@ -213,7 +213,6 @@ startActivityForResult(
213
213
.setAvailableProviders(... )
214
214
.setTosUrl(" https://superapp.example.com/terms-of-service.html" )
215
215
.setPrivacyPolicyUrl(" https://superapp.example.com/privacy-policy.html" )
216
- .setTheme(R . style. SuperAppTheme )
217
216
.build(),
218
217
RC_SIGN_IN );
219
218
```
@@ -397,16 +396,38 @@ represented in the following diagram:
397
396
398
397
## UI customization
399
398
400
- To provide customization of the visual style of the activities that implement
401
- the flow, a new theme can be declared. Standard material design color
402
- and typography properties will take effect as expected. For example, to define
403
- a green theme:
399
+ To use FirebaseUI Auth's sign-in flows, you must provide an ` app_name ` string and use the
400
+ AppCompat color attributes in your app.
401
+
402
+ First, ensure an ` app_name ` resource is defined your ` strings.xml ` file like so:
403
+
404
+ ``` xml
405
+ <resources >
406
+ <string name =" app_name" >My App</string >
407
+ <!-- ... -->
408
+ </resources >
409
+ ```
410
+
411
+ Second, ensure the three standard AppCompat color resources are defined with your own values:
412
+
413
+ ``` xml
414
+ <style name =" AppTheme" parent =" Theme.AppCompat.Light.DarkActionBar" >
415
+ <!-- Required for sign-in flow styling -->
416
+ <item name =" colorPrimary" >@color/colorPrimary</item >
417
+ <item name =" colorPrimaryDark" >@color/colorPrimaryDark</item >
418
+ <item name =" colorAccent" >@color/colorAccent</item >
419
+ </style >
420
+
421
+ If you would like more control over FirebaseUI's styling, you can define your own custom style
422
+ to override certain or all styling attributes. For example, a green sign-in theme:
404
423
405
424
```xml
406
425
<style name =" GreenTheme" parent =" FirebaseUI" >
426
+ <!-- Required for sign-in flow styling -->
407
427
<item name =" colorPrimary" >@color/material_green_500</item >
408
428
<item name =" colorPrimaryDark" >@color/material_green_700</item >
409
429
<item name =" colorAccent" >@color/material_purple_a700</item >
430
+
410
431
<item name =" colorControlNormal" >@color/material_green_500</item >
411
432
<item name =" colorControlActivated" >@color/material_lime_a700</item >
412
433
<item name =" colorControlHighlight" >@color/material_green_a200</item >
@@ -435,21 +456,23 @@ startActivityForResult(
435
456
.build());
436
457
```
437
458
438
- Your application theme could also simply be used, rather than defining a new
439
- one.
459
+ Your application theme could also simply be used, rather than defining a new one.
440
460
441
- If you wish to change the string messages, the existing strings can be
442
- easily overridden by name in your application. See
443
- [ the built-in strings.xml] ( src/main/res/values/strings.xml ) and simply
444
- redefine a string to change it, for example:
461
+ If you wish to change the string messages, the existing strings can be overridden
462
+ by name in your application. See the module's [ strings.xml] ( src/main/res/values/strings.xml ) file
463
+ and simply redefine a string to change it:
445
464
446
465
``` xml
447
466
<resources >
448
467
<!-- was "Signing up..." -->
449
- <string name =" progress_dialog_signing_up " >Creating your shiny new account...</string >
468
+ <string name =" fui_progress_dialog_signing_up " >Creating your shiny new account...</string >
450
469
</resources >
451
470
```
452
471
472
+ ** Note:** String resource names aren't considered part of the public API and might
473
+ therefore change and break your app between library updates. We recommend looking
474
+ at a diff of the ` strings.xml ` file before updating FirebaseUI.
475
+
453
476
### OAuth Scope Customization
454
477
455
478
#### Google
0 commit comments