Skip to content

Commit

Permalink
add Custom Tabs customization snippet to the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lbalmaceda committed Oct 13, 2017
1 parent 2479eb8 commit 9dafed5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public CustomTabsOptions[] newArray(int size) {
};


@SuppressWarnings("WeakerAccess")
public static class Builder {
@ColorRes
private int toolbarColor;
Expand Down

0 comments on commit 9dafed5

Please sign in to comment.