Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String EXTRA_CUSTOM_TABS_EXIT_ANIMATION_BUNDLE = "android.support.customtabs.extra.EXIT_ANIMATION_BUNDLE";
- Bundle finishBundle = ActivityOptions.makeCustomAnimation(mActivity, android.R.anim.slide_in_left, android.R.anim.slide_out_right).toBundle();
- i.putExtra(EXTRA_CUSTOM_TABS_EXIT_ANIMATION_BUNDLE, finishBundle);
- Bundle startBundle = ActivityOptions.makeCustomAnimation(mActivity, R.anim.slide_in_right, R.anim.slide_out_left).toBundle();
- mActivity.startActivity(i, startBundle);
- CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder()
- .setExitAnimations(this,
- android.R.anim.slide_in_left, android.R.anim.slide_out_right)
- .build();
- customTabsIntent.launchUrl(this, Uri.parse("http://www.example.com"));
- public static final String EXTRA_EXIT_ANIMATION_BUNDLE =
- "android.support.customtabs.extra.EXIT_ANIMATION_BUNDLE";
- public static final String EXTRA_SESSION = "android.support.customtabs.extra.SESSION";
- public void openCustomTab() {
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.example.com"));
- Bundle bundle = ActivityOptions
- .makeCustomAnimation(
- this, android.R.anim.slide_in_left, android.R.anim.slide_out_right)
- .toBundle();
- Bundle extrasBundle = new Bundle();
- extrasBundle.putBinder(EXTRA_SESSION, null);
- intent.putExtras(extrasBundle);
- intent.putExtra(EXTRA_EXIT_ANIMATION_BUNDLE, bundle);
- startActivity(intent);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement