refactor: android.R to const for performance reasons (#8003)

This commit is contained in:
Manol Donev
2019-10-22 22:09:17 +03:00
committed by GitHub
parent ae6c02258e
commit 0a495b55a2
2 changed files with 6 additions and 2 deletions

View File

@@ -33,6 +33,7 @@ const androidBackPressedEvent = "androidBackPressed";
const shortAnimTime = 17694720; // android.R.integer.config_shortAnimTime
const statePressed = 16842919; // android.R.attr.state_pressed
const stateEnabled = 16842910; // android.R.attr.state_enabled
const styleAnimationDialog = 16973826; // android.R.style.Animation_Dialog
const sdkVersion = lazy(() => parseInt(device.sdkVersion));
@@ -187,7 +188,7 @@ function initializeDialogFragment() {
dialog
.getWindow()
.setWindowAnimations(
android.R.style.Animation_Dialog
styleAnimationDialog
);
}

View File

@@ -17,6 +17,9 @@ interface TransitionListener {
const defaultInterpolator = lazy(() => new android.view.animation.AccelerateDecelerateInterpolator());
const animFadeIn = 17432576; // android.R.anim.fade_in
const animFadeOut = 17432577; // android.R.anim.fade_out
export const waitingQueue = new Map<number, Set<ExpandedEntry>>();
export const completedEntries = new Map<number, ExpandedEntry>();
@@ -105,7 +108,7 @@ export function _setAndroidFragmentTransitions(
// Also setup empty/immediate transition to be executed when navigating back to this page.
// TODO: Consider removing empty/immediate animator when migrating to official androidx.fragment.app.Fragment:1.2.
if (isNestedDefaultTransition) {
fragmentTransaction.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
fragmentTransaction.setCustomAnimations(animFadeIn, animFadeOut);
setupAllAnimation(newEntry, noTransition);
setupNewFragmentCustomTransition({ duration: 0, curve: null }, newEntry, noTransition);
} else {