diff --git a/README.md b/README.md index 0fcb1d5df..008557c1d 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,22 @@ WebAuthProvider.init(account) ``` +#### Customize the Custom Tabs UI + +If the device where the app is running has a Custom Tabs compatible Browser, a Custom Tab will be preferred for the authentication flow. You can customize the Page Title visibility and the Toolbar color by using the `CustomTabsOptions` class. + +```java + CustomTabsOptions options = CustomTabsOptions.newBuilder() + .withToolbarColor(R.color.ct_toolbar_color) + .showTitle(true) + .build(); + + WebAuthProvider.init(account) + .withCustomTabsOptions(options) + .start(MainActivity.this, authCallback); +``` + + ## Next steps ### Learning resources diff --git a/auth0/src/main/java/com/auth0/android/provider/CustomTabsOptions.java b/auth0/src/main/java/com/auth0/android/provider/CustomTabsOptions.java index 7e0b4c5e4..0a2bf59da 100644 --- a/auth0/src/main/java/com/auth0/android/provider/CustomTabsOptions.java +++ b/auth0/src/main/java/com/auth0/android/provider/CustomTabsOptions.java @@ -74,6 +74,7 @@ public CustomTabsOptions[] newArray(int size) { }; + @SuppressWarnings("WeakerAccess") public static class Builder { @ColorRes private int toolbarColor;