Last active
June 22, 2018 09:48
-
-
Save mortenjust/85c3f0776d37c715e0b8 to your computer and use it in GitHub Desktop.
Open fragment FROM fragment, with a circular reveal. The key thing is using getChildFragmentManager, introduced in Android 4.2
This file contains hidden or 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
long TRANS_DURATION = 300; | |
Log.d(TAG, "Ready to reveal mode picker"); | |
ModeSelectorActivityFragment f = new ModeSelectorActivityFragment(); | |
fragmentContainer.setVisibility(View.INVISIBLE); | |
getChildFragmentManager() | |
.beginTransaction() | |
.add(R.id.mode_list_fragment_container, f) | |
.commit(); | |
int finalRadius = Math.max(fragmentContainer.getHeight(), fragmentContainer.getWidth()); | |
Animator anim = ViewAnimationUtils.createCircularReveal(fragmentContainer, (int) touchX, (int) touchY, 0, finalRadius); | |
anim.setDuration(TRANS_DURATION); | |
anim.setInterpolator(new AccelerateDecelerateInterpolator()); | |
fragmentContainer.setVisibility(View.VISIBLE); | |
anim.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment