Appauth-android: Customize the Chrome custom tabs

Created on 16 Jul 2017  路  1Comment  路  Source: openid/AppAuth-Android

We can use the Chrome custom tabs as this library mention by doing this

appAuthConfigBuilder.setBrowserMatcher(new BrowserWhitelist(VersionedBrowserMatcher.CHROME_CUSTOM_TAB));

How can i cutomize the color and set a title of the toolbar ?

Most helpful comment

customTabsIntent.Builder builder = new CustomTabsIntent.Builder();
builder.setToolbarColor(
    ContextCompat.getColor(SplashScreenActivity.this,R.color.colorPrimary));
builder.setShowTitle(true);
builder.addDefaultShareMenuItem();
builder.enableUrlBarHiding();
authService.performAuthorizationRequest(
    authRequest,
    pendingIntent,
    builder.build());

>All comments

customTabsIntent.Builder builder = new CustomTabsIntent.Builder();
builder.setToolbarColor(
    ContextCompat.getColor(SplashScreenActivity.this,R.color.colorPrimary));
builder.setShowTitle(true);
builder.addDefaultShareMenuItem();
builder.enableUrlBarHiding();
authService.performAuthorizationRequest(
    authRequest,
    pendingIntent,
    builder.build());
Was this page helpful?
0 / 5 - 0 ratings