mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
refactor: android.R to const for performance reasons (#8003)
This commit is contained in:
@@ -33,6 +33,7 @@ const androidBackPressedEvent = "androidBackPressed";
|
|||||||
const shortAnimTime = 17694720; // android.R.integer.config_shortAnimTime
|
const shortAnimTime = 17694720; // android.R.integer.config_shortAnimTime
|
||||||
const statePressed = 16842919; // android.R.attr.state_pressed
|
const statePressed = 16842919; // android.R.attr.state_pressed
|
||||||
const stateEnabled = 16842910; // android.R.attr.state_enabled
|
const stateEnabled = 16842910; // android.R.attr.state_enabled
|
||||||
|
const styleAnimationDialog = 16973826; // android.R.style.Animation_Dialog
|
||||||
|
|
||||||
const sdkVersion = lazy(() => parseInt(device.sdkVersion));
|
const sdkVersion = lazy(() => parseInt(device.sdkVersion));
|
||||||
|
|
||||||
@@ -187,7 +188,7 @@ function initializeDialogFragment() {
|
|||||||
dialog
|
dialog
|
||||||
.getWindow()
|
.getWindow()
|
||||||
.setWindowAnimations(
|
.setWindowAnimations(
|
||||||
android.R.style.Animation_Dialog
|
styleAnimationDialog
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ interface TransitionListener {
|
|||||||
|
|
||||||
const defaultInterpolator = lazy(() => new android.view.animation.AccelerateDecelerateInterpolator());
|
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 waitingQueue = new Map<number, Set<ExpandedEntry>>();
|
||||||
export const completedEntries = new Map<number, 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.
|
// 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.
|
// TODO: Consider removing empty/immediate animator when migrating to official androidx.fragment.app.Fragment:1.2.
|
||||||
if (isNestedDefaultTransition) {
|
if (isNestedDefaultTransition) {
|
||||||
fragmentTransaction.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
|
fragmentTransaction.setCustomAnimations(animFadeIn, animFadeOut);
|
||||||
setupAllAnimation(newEntry, noTransition);
|
setupAllAnimation(newEntry, noTransition);
|
||||||
setupNewFragmentCustomTransition({ duration: 0, curve: null }, newEntry, noTransition);
|
setupNewFragmentCustomTransition({ duration: 0, curve: null }, newEntry, noTransition);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user