Created
January 22, 2020 15:48
-
-
Save ferrannp/368922f1e4c9cce65174ee9f3375ac4a to your computer and use it in GitHub Desktop.
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
// MainActivity.java | |
public void switchToReactView() { | |
if (mReactRootView != null && !mReactRootView.isAttachedToWindow()) { | |
mReactRootView.setAlpha(0f); | |
mReactRootView.animate() | |
.alpha(1f) | |
.setInterpolator(new AccelerateDecelerateInterpolator()) | |
.setDuration(350) | |
.setListener(new Animator.AnimatorListener() { | |
@Override | |
public void onAnimationStart(Animator animation) { | |
setContentView(mReactRootView); | |
} | |
@Override | |
public void onAnimationEnd(Animator animation) { | |
setTheme(R.style.AppTheme); | |
} | |
@Override | |
public void onAnimationCancel(Animator animation) { | |
} | |
@Override | |
public void onAnimationRepeat(Animator animation) { | |
} | |
}) | |
.start(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment