Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void redirectUsingCustomTab(String url)
- {
- Uri uri = Uri.parse(url);
- CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder();
- // set desired toolbar colors
- intentBuilder.setToolbarColor(ContextCompat.getColor(this, R.color.colorPrimary));
- intentBuilder.setSecondaryToolbarColor(ContextCompat.getColor(this, R.color.colorPrimaryDark));
- // add start and exit animations if you want(optional)
- intentBuilder.setStartAnimations(this, android.R.anim.slide_in_left, android.R.anim.slide_out_right);
- intentBuilder.setExitAnimations(this, android.R.anim.slide_in_left,
- android.R.anim.slide_out_right);
- CustomTabsIntent customTabsIntent = intentBuilder.build();
- customTabsIntent.launchUrl(getActivity(), uri);
- }
- implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation 'com.android.support:appcompat-v7:26.1.0'
- implementation 'com.android.support.constraint:constraint-layout:1.0.2'
- implementation 'com.android.support:design:26.1.0'
- implementation 'com.android.support:recyclerview-v7:26.1.0'
- testImplementation 'junit:junit:4.12'
- androidTestImplementation 'com.android.support.test:runner:1.0.1'
- androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
- compile 'com.prolificinteractive:material-calendarview:1.4.3'
- compile 'com.android.support:support-v4:26.1.0'
Add Comment
Please, Sign In to add comment