Created
August 1, 2017 12:44
-
-
Save EmmanuelGuther/1128f0e5aa8f1716053a39a923846e96 to your computer and use it in GitHub Desktop.
ANDROID - Go to activity with transition
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
private void goToActivity(View view, Activity fromActivity, | |
final Class<? extends Activity> toActivity) { | |
Intent i = new Intent(fromActivity, toActivity); | |
Bundle bundle; | |
if (Build.VERSION.SDK_INT >= 23) { | |
bundle = ActivityOptions.makeClipRevealAnimation(view, 0, 0, view.getWidth(), | |
view.getHeight()).toBundle(); | |
} else { | |
bundle = ActivityOptions.makeScaleUpAnimation(view, 0, 0, view.getWidth(), | |
view.getHeight()).toBundle(); | |
} | |
// Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888); | |
// bitmap.eraseColor(Color.parseColor("#757575")); | |
// bundle = ActivityOptions.makeThumbnailScaleUpAnimation(view, bitmap, 0, 0).toBundle(); | |
startActivity(i, bundle); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment