Created
February 10, 2019 12:07
-
-
Save andreban/e0e10588b8cfe7931993822291ef3245 to your computer and use it in GitHub Desktop.
Changing Status Bar colour when launching a TWA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copy LauncherActivity from the support library repo | |
// (https://github.com/GoogleChrome/custom-tabs-client/blob/master/customtabs/src/android/support/customtabs/trusted/LauncherActivity.java#L153-L155) | |
// and replace the getCustomTabsIntent method, as below: | |
protected CustomTabsIntent getCustomTabsIntent(CustomTabsSession session) { | |
return new CustomTabsIntent.Builder(session) | |
.setToolbarColor(Color.parseColor("#000000")) | |
.build(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could override the getLaunchingUrl to return Uri.parse("https://www.example.com/");
Do you mind posting the question on StackOverflow? (https://stackoverflow.com/questions/tagged/trusted-web-activity/). It will make easer for other developers with the same issue to find the answer (and other people can help with the answer too).