Search code examples
androidgoogle-chromechrome-custom-tabs

Chrome custom tabs color change


How can I change the color of bar-shadow, title text and progress bar like in the Android app for Twitter(https://i.sstatic.net/SJT3v.jpg) or Telegram (https://i.sstatic.net/8O20D.jpg)?

This is my app(https://i.sstatic.net/5AOpq.jpg)

I can't add tag meta to html. How can I do it without using a tag?

CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
            builder.setToolbarColor(ResourcesCompat.getColor(getResources(), R.color.blue, null));
            builder.enableUrlBarHiding();
            CustomTabsIntent customTabsIntent = builder.build();
            customTabsIntent.launchUrl(this, Uri.parse(url));

Solution

  • set bar-shadow color is impossible, you can set color bar and they will be filled with solid, but not all colors. I found only 3 solid colors: white(#ffffff) like twitter, black(#000000) and blue(#4d7f9e) like telegram.