From 9dafed55a3eca43185187467b5494a0949b24e25 Mon Sep 17 00:00:00 2001 From: Luciano Balmaceda Date: Fri, 13 Oct 2017 16:25:36 -0300 Subject: [PATCH] add Custom Tabs customization snippet to the readme --- README.md | 16 ++++++++++++++++ .../android/provider/CustomTabsOptions.java | 1 + 2 files changed, 17 insertions(+) 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;