@nativescript/core 8.5.0-alpha.0 → 8.5.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abortcontroller/abortsignal.js +5 -5
- package/abortcontroller/abortsignal.js.map +1 -1
- package/accessibility/accessibility-common.d.ts +1 -1
- package/accessibility/accessibility-common.js.map +1 -1
- package/accessibility/font-scale.android.js.map +1 -1
- package/accessibility/index.android.d.ts +2 -2
- package/accessibility/index.android.js.map +1 -1
- package/accessibility/index.d.ts +1 -2
- package/accessibility/index.ios.d.ts +1 -2
- package/accessibility/index.ios.js.map +1 -1
- package/application/application-common.d.ts +5 -4
- package/application/application-common.js +5 -5
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +27 -5
- package/application/index.android.d.ts +12 -12
- package/application/index.android.js.map +1 -1
- package/application/index.d.ts +30 -35
- package/application/index.ios.d.ts +1 -0
- package/application/index.ios.js +23 -28
- package/application/index.ios.js.map +1 -1
- package/core-types/index.d.ts +10 -10
- package/css/CSS3Parser.d.ts +3 -3
- package/css/parser.d.ts +17 -17
- package/data/observable/index.d.ts +139 -165
- package/data/observable/index.js +93 -6
- package/data/observable/index.js.map +1 -1
- package/file-system/file-system-access.android.js +8 -1
- package/file-system/file-system-access.android.js.map +1 -1
- package/global-types.d.ts +2 -12
- package/image-source/index.android.js +5 -5
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.ios.js +5 -5
- package/image-source/index.ios.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/widgets-release.aar +0 -0
- package/ui/action-bar/action-bar-common.js +4 -4
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.d.ts +2 -2
- package/ui/animation/animation-interfaces.d.ts +4 -4
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/xml2ui.js +3 -3
- package/ui/builder/xml2ui.js.map +1 -1
- package/ui/button/index.d.ts +2 -2
- package/ui/core/properties/index.js +6 -6
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/view/index.android.d.ts +1 -1
- package/ui/core/view/index.android.js +22 -1
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.ios.js +15 -15
- package/ui/core/view/view-common.d.ts +1 -1
- package/ui/core/view/view-common.js +7 -0
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.d.ts +9 -9
- package/ui/core/view-base/index.d.ts +450 -532
- package/ui/core/view-base/index.js +168 -5
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/core/weak-event-listener/index.js.map +1 -1
- package/ui/dialogs/dialogs-common.js +1 -0
- package/ui/dialogs/dialogs-common.js.map +1 -1
- package/ui/editable-text-base/editable-text-base-common.js +1 -2
- package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
- package/ui/editable-text-base/index.android.js +2 -7
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/frame/frame-common.d.ts +6 -0
- package/ui/frame/frame-common.js +11 -2
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/index.android.d.ts +2 -1
- package/ui/frame/index.android.js +15 -7
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +3 -3
- package/ui/frame/index.ios.js +1 -0
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/gestures-common.js +5 -5
- package/ui/gestures/gestures-common.js.map +1 -1
- package/ui/gestures/index.android.js +3 -3
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.d.ts +2 -2
- package/ui/gestures/index.ios.js +6 -6
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.d.ts +2 -2
- package/ui/image-cache/image-cache-common.d.ts +5 -5
- package/ui/image-cache/image-cache-common.js +2 -2
- package/ui/image-cache/image-cache-common.js.map +1 -1
- package/ui/image-cache/index.d.ts +3 -3
- package/ui/index.d.ts +5 -2
- package/ui/index.js +5 -2
- package/ui/index.js.map +1 -1
- package/ui/label/index.android.js +1 -0
- package/ui/label/index.android.js.map +1 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.d.ts +12 -12
- package/ui/layouts/grid-layout/grid-layout-common.d.ts +1 -1
- package/ui/layouts/root-layout/root-layout-common.js +45 -36
- package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
- package/ui/list-view/index.d.ts +6 -6
- package/ui/list-view/list-view-common.js +8 -2
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/index.ios.js +3 -2
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.d.ts +72 -39
- package/ui/placeholder/index.android.d.ts +2 -2
- package/ui/placeholder/index.d.ts +2 -2
- package/ui/repeater/index.js +2 -1
- package/ui/repeater/index.js.map +1 -1
- package/ui/scroll-view/scroll-view-common.d.ts +4 -4
- package/ui/scroll-view/scroll-view-common.js.map +1 -1
- package/ui/search-bar/index.d.ts +3 -3
- package/ui/segmented-bar/index.d.ts +2 -2
- package/ui/segmented-bar/segmented-bar-common.d.ts +2 -2
- package/ui/styling/css-selector.d.ts +1 -1
- package/ui/styling/font-common.js +6 -6
- package/ui/styling/font-common.js.map +1 -1
- package/ui/styling/font-interfaces.d.ts +3 -3
- package/ui/styling/style-properties.js +4 -0
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.js +5 -4
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/tab-view/index.d.ts +2 -2
- package/ui/tab-view/tab-view-common.d.ts +2 -2
- package/ui/text-base/span.js.map +1 -1
- package/ui/transition/index.android.d.ts +7 -5
- package/ui/transition/index.android.js +8 -5
- package/ui/transition/index.android.js.map +1 -1
- package/ui/transition/index.d.ts +19 -15
- package/ui/transition/index.ios.d.ts +7 -10
- package/ui/transition/index.ios.js +37 -21
- package/ui/transition/index.ios.js.map +1 -1
- package/ui/transition/modal-transition.android.d.ts +6 -0
- package/ui/transition/modal-transition.android.js +54 -0
- package/ui/transition/modal-transition.android.js.map +1 -0
- package/ui/transition/modal-transition.d.ts +2 -0
- package/ui/transition/modal-transition.ios.d.ts +40 -0
- package/ui/transition/modal-transition.ios.js +250 -0
- package/ui/transition/modal-transition.ios.js.map +1 -0
- package/ui/transition/page-transition.android.d.ts +6 -0
- package/ui/transition/page-transition.android.js +54 -0
- package/ui/transition/page-transition.android.js.map +1 -0
- package/ui/transition/page-transition.d.ts +2 -0
- package/ui/transition/page-transition.ios.d.ts +25 -0
- package/ui/transition/page-transition.ios.js +199 -0
- package/ui/transition/page-transition.ios.js.map +1 -0
- package/ui/transition/shared-transition.d.ts +65 -0
- package/ui/transition/shared-transition.js +64 -0
- package/ui/transition/shared-transition.js.map +1 -0
- package/ui/web-view/index.d.ts +3 -3
- package/ui/web-view/web-view-interfaces.d.ts +1 -1
- package/utils/index.d.ts +0 -82
- package/utils/typescript-utils.d.ts +6 -0
- package/xhr/index.js +28 -28
- package/xhr/index.js.map +1 -1
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Transition as TransitionType } from '.';
|
|
2
|
+
export declare class Transition implements TransitionType {
|
|
2
3
|
static AndroidTransitionType: {};
|
|
4
|
+
id: number;
|
|
3
5
|
private _duration;
|
|
4
6
|
private _curve;
|
|
5
|
-
|
|
6
|
-
constructor(duration: number, curve?: UIViewAnimationCurve);
|
|
7
|
+
constructor(duration?: number, nativeCurve?: UIViewAnimationCurve);
|
|
7
8
|
getDuration(): number;
|
|
8
9
|
getCurve(): UIViewAnimationCurve;
|
|
9
10
|
animateIOSTransition(transitionContext: UIViewControllerContextTransitioning, fromViewCtrl: UIViewController, toViewCtrl: UIViewController, operation: UINavigationControllerOperation): void;
|
|
10
11
|
createAndroidAnimator(transitionType: string): any;
|
|
11
12
|
toString(): string;
|
|
12
13
|
}
|
|
13
|
-
export declare
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
interactionDismiss?(animator: UIViewControllerAnimatedTransitioning): UIViewControllerInteractiveTransitioning;
|
|
17
|
-
interactionPresented?(animator: UIViewControllerAnimatedTransitioning): UIViewControllerInteractiveTransitioning;
|
|
18
|
-
presentedViewController?(presented: UIViewController, presenting: UIViewController, source: UIViewController): UIPresentationController;
|
|
19
|
-
}
|
|
14
|
+
export declare function iosSnapshotView(view: UIView): UIImage;
|
|
15
|
+
export declare function iosMatchLayerProperties(view: UIView, toView: UIView): void;
|
|
16
|
+
export declare function iosPrintRect(r: CGRect): string;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { Screen } from '../../platform';
|
|
1
2
|
let transitionId = 0;
|
|
2
3
|
export class Transition {
|
|
3
|
-
constructor(duration,
|
|
4
|
+
constructor(duration = 350, nativeCurve = 0 /* UIViewAnimationCurve.EaseInOut */) {
|
|
4
5
|
this._duration = duration ? duration / 1000 : 0.35;
|
|
5
|
-
this._curve =
|
|
6
|
-
|
|
6
|
+
this._curve = nativeCurve;
|
|
7
|
+
transitionId++;
|
|
8
|
+
this.id = transitionId;
|
|
7
9
|
}
|
|
8
10
|
getDuration() {
|
|
9
11
|
return this._duration;
|
|
@@ -18,26 +20,40 @@ export class Transition {
|
|
|
18
20
|
throw new Error('Abstract method call');
|
|
19
21
|
}
|
|
20
22
|
toString() {
|
|
21
|
-
return `Transition@${this.
|
|
23
|
+
return `Transition@${this.id}`;
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
Transition.AndroidTransitionType = {};
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
export function iosSnapshotView(view) {
|
|
28
|
+
if (view instanceof UIImageView) {
|
|
29
|
+
return view.image;
|
|
30
|
+
}
|
|
31
|
+
// console.log('snapshotView view.frame:', printRect(view.frame));
|
|
32
|
+
UIGraphicsBeginImageContextWithOptions(CGSizeMake(view.frame.size.width, view.frame.size.height), false, Screen.mainScreen.scale);
|
|
33
|
+
view.layer.renderInContext(UIGraphicsGetCurrentContext());
|
|
34
|
+
const image = UIGraphicsGetImageFromCurrentImageContext();
|
|
35
|
+
UIGraphicsEndImageContext();
|
|
36
|
+
return image;
|
|
37
|
+
}
|
|
38
|
+
// todo: figure out all the properties/layer properties that we want to transition automatically
|
|
39
|
+
// note: some need to be done at various stages of the animation and are not in here. (e.g. alpha)
|
|
40
|
+
export function iosMatchLayerProperties(view, toView) {
|
|
41
|
+
const viewPropertiesToMatch = ['backgroundColor'];
|
|
42
|
+
const layerPropertiesToMatch = ['cornerRadius', 'borderWidth', 'borderColor'];
|
|
43
|
+
viewPropertiesToMatch.forEach((property) => {
|
|
44
|
+
if (view[property] !== toView[property]) {
|
|
45
|
+
console.log('| -- matching view property:', property);
|
|
46
|
+
view[property] = toView[property];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
layerPropertiesToMatch.forEach((property) => {
|
|
50
|
+
if (view.layer[property] !== toView.layer[property]) {
|
|
51
|
+
console.log('| -- matching layer property:', property);
|
|
52
|
+
view.layer[property] = toView.layer[property];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export function iosPrintRect(r) {
|
|
57
|
+
return `CGRect(${r.origin.x} ${r.origin.y} ${r.size.width} ${r.size.height})`;
|
|
42
58
|
}
|
|
43
59
|
//# sourceMappingURL=index.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../../../../packages/core/ui/transition/index.ios.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../../../../packages/core/ui/transition/index.ios.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,IAAI,YAAY,GAAG,CAAC,CAAC;AACrB,MAAM,OAA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gG;AAChG,kGAAkG;AAClG,MAAM,UAAU,uBAAuB,CAAC,IAAY,EAAE,MAAc;IACnE,MAAM,qBAAqB,GAAwB,CAAC,iBAAiB,CAAC,CAAC;IACvE,MAAM,sBAAsB,GAAyB,CAAC,cAAc,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC;IAEpG,qBAAqB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC1C,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,EAAE;YACxC,OAAO,CAAC,GAAG,CAAC,iCAAiC,EAAE,QAAQ,CAAC,CAAC;YACzD,IAAI,CAAC,QAAe,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;SACzC;IACF,CAAC,CAAC,CAAC;IAEH,sBAAsB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC3C,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;YACpD,OAAO,CAAC,GAAG,CAAC,kCAAkC,EAAE,QAAQ,CAAC,CAAC;YAC1D,IAAI,CAAC,KAAK,CAAC,QAAe,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;SACrD;IACF,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,CAAS;IACrC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BackstackEntry } from '../frame';
|
|
2
|
+
import { Transition } from '.';
|
|
3
|
+
export declare class ModalTransition extends Transition {
|
|
4
|
+
createAndroidAnimator(transitionType: string): void;
|
|
5
|
+
test(fragmentTransaction: androidx.fragment.app.FragmentTransaction, currentEntry: BackstackEntry, newEntry: BackstackEntry): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Transition } from '.';
|
|
2
|
+
import { SharedTransition } from './shared-transition';
|
|
3
|
+
export class ModalTransition extends Transition {
|
|
4
|
+
createAndroidAnimator(transitionType) {
|
|
5
|
+
console.log('HELLO ModalTransition', transitionType);
|
|
6
|
+
}
|
|
7
|
+
test(fragmentTransaction, currentEntry, newEntry) {
|
|
8
|
+
console.log('HELLO ModalTransition', fragmentTransaction);
|
|
9
|
+
const fromPage = currentEntry.resolvedPage;
|
|
10
|
+
const toPage = newEntry.resolvedPage;
|
|
11
|
+
const currentFragment = currentEntry ? currentEntry.fragment : null;
|
|
12
|
+
const newFragment = newEntry.fragment;
|
|
13
|
+
const { sharedElements, presented, presenting } = SharedTransition.getSharedElements(fromPage, toPage);
|
|
14
|
+
// fragmentTransaction.addSharedElement();
|
|
15
|
+
toPage.on('loaded', () => {
|
|
16
|
+
presented.forEach((v) => {
|
|
17
|
+
console.log({
|
|
18
|
+
presentedSharedElements: true,
|
|
19
|
+
nativeView: !!v.nativeView,
|
|
20
|
+
sharedTransitionTag: v.sharedTransitionTag,
|
|
21
|
+
});
|
|
22
|
+
androidx.core.view.ViewCompat.setTransitionName(v.nativeView, v.sharedTransitionTag);
|
|
23
|
+
});
|
|
24
|
+
// setTimeout(() => {
|
|
25
|
+
newFragment.startPostponedEnterTransition();
|
|
26
|
+
// }, 2000)
|
|
27
|
+
});
|
|
28
|
+
presenting.forEach((v) => {
|
|
29
|
+
console.log({
|
|
30
|
+
presentingSharedElements: true,
|
|
31
|
+
nativeView: !!v.nativeView,
|
|
32
|
+
sharedTransitionTag: v.sharedTransitionTag,
|
|
33
|
+
});
|
|
34
|
+
androidx.core.view.ViewCompat.setTransitionName(v.nativeView, v.sharedTransitionTag);
|
|
35
|
+
});
|
|
36
|
+
presenting.forEach((v) => {
|
|
37
|
+
fragmentTransaction.addSharedElement(v.nativeView, v.sharedTransitionTag);
|
|
38
|
+
});
|
|
39
|
+
fragmentTransaction.setReorderingAllowed(true);
|
|
40
|
+
const transitionSet = new androidx.transition.TransitionSet();
|
|
41
|
+
transitionSet.setDuration(2000);
|
|
42
|
+
transitionSet.addTransition(new androidx.transition.ChangeBounds());
|
|
43
|
+
transitionSet.addTransition(new androidx.transition.ChangeTransform());
|
|
44
|
+
// transitionSet.addTransition(new androidx.transition.ChangeClipBounds());
|
|
45
|
+
// postpone enter until we call "loaded" on the new page
|
|
46
|
+
newFragment.postponeEnterTransition();
|
|
47
|
+
newFragment.setSharedElementEnterTransition(transitionSet);
|
|
48
|
+
newFragment.setSharedElementReturnTransition(transitionSet);
|
|
49
|
+
// newFragment.setSharedElementReturnTransition(new androidx.transition.ChangeBounds());
|
|
50
|
+
// currentFragment.setSharedElementEnterTransition(new androidx.transition.ChangeBounds());
|
|
51
|
+
// currentFragment.setSharedElementReturnTransition(new androidx.transition.ChangeBounds());
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=modal-transition.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-transition.android.js","sourceRoot":"","sources":["../../../../../packages/core/ui/transition/modal-transition.android.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAC9C,qBAAqB,CAAC,cAAsB;QAC3C,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,cAAc,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,CAAC,mBAA8D,EAAE,YAA4B,EAAE,QAAwB;QAC1H,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,mBAAmB,CAAC,CAAC;QAE1D,MAAM,QAAQ,GAAG,YAAY,CAAC,YAAY,C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CAAC;QACH,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACxB,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;QAEH,mBAAmB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAE/C,MAAM,aAAa,GAAG,IAAI,QAAQ,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;QAC9D,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAChC,aAAa,CAAC,aAAa,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC;QACpE,aAAa,CAAC,aAAa,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC;QACvE,2EAA2E;QAE3E,wDAAwD;QACxD,WAAW,CAAC,uBAAuB,EAAE,CAAC;QAEtC,WAAW,CAAC,+BAA+B,CAAC,aAAa,CAAC,CAAC;QAC3D,WAAW,CAAC,gCAAgC,CAAC,aAAa,CAAC,CAAC;QAE5D,wFAAwF;QACxF,2FAA2F;QAC3F,4FAA4F;IAC7F,CAAC;CACD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { View } from '../core/view';
|
|
2
|
+
import { Transition } from '.';
|
|
3
|
+
export declare class ModalTransition extends Transition {
|
|
4
|
+
transitionController: ModalTransitionController;
|
|
5
|
+
presented: UIViewController;
|
|
6
|
+
presenting: UIViewController;
|
|
7
|
+
sharedElements: {
|
|
8
|
+
presented?: Array<{
|
|
9
|
+
view: View;
|
|
10
|
+
startFrame?: CGRect;
|
|
11
|
+
endFrame?: CGRect;
|
|
12
|
+
snapshot?: UIImageView;
|
|
13
|
+
startOpacity?: number;
|
|
14
|
+
endOpacity?: number;
|
|
15
|
+
}>;
|
|
16
|
+
presenting?: Array<{
|
|
17
|
+
view: View;
|
|
18
|
+
startFrame: CGRect;
|
|
19
|
+
endFrame?: CGRect;
|
|
20
|
+
snapshot?: UIImageView;
|
|
21
|
+
startOpacity?: number;
|
|
22
|
+
endOpacity?: number;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
iosPresentedController(presented: UIViewController, presenting: UIViewController, source: UIViewController): UIViewControllerAnimatedTransitioning;
|
|
26
|
+
iosDismissedController(dismissed: UIViewController): UIViewControllerAnimatedTransitioning;
|
|
27
|
+
iosInteractionDismiss(animator: UIViewControllerAnimatedTransitioning): UIViewControllerInteractiveTransitioning;
|
|
28
|
+
iosInteractionPresented(animator: UIViewControllerAnimatedTransitioning): UIViewControllerInteractiveTransitioning;
|
|
29
|
+
iosPresentedViewController(presented: UIViewController, presenting: UIViewController, source: UIViewController): UIPresentationController;
|
|
30
|
+
}
|
|
31
|
+
declare class ModalTransitionController extends NSObject implements UIViewControllerAnimatedTransitioning {
|
|
32
|
+
static ObjCProtocols: {
|
|
33
|
+
prototype: UIViewControllerAnimatedTransitioning;
|
|
34
|
+
}[];
|
|
35
|
+
owner: WeakRef<ModalTransition>;
|
|
36
|
+
static initWithOwner(owner: WeakRef<ModalTransition>): ModalTransitionController;
|
|
37
|
+
transitionDuration(transitionContext: UIViewControllerContextTransitioning): number;
|
|
38
|
+
animateTransition(transitionContext: UIViewControllerContextTransitioning): void;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { Screen } from '../../platform';
|
|
2
|
+
import { Transition, iosMatchLayerProperties, iosPrintRect, iosSnapshotView } from '.';
|
|
3
|
+
import { SharedTransition, SharedTransitionAnimationType, DEFAULT_DURATION } from './shared-transition';
|
|
4
|
+
export class ModalTransition extends Transition {
|
|
5
|
+
iosPresentedController(presented, presenting, source) {
|
|
6
|
+
this.transitionController = ModalTransitionController.initWithOwner(new WeakRef(this));
|
|
7
|
+
this.presented = presented;
|
|
8
|
+
// console.log('presenting:', presenting)
|
|
9
|
+
return this.transitionController;
|
|
10
|
+
}
|
|
11
|
+
iosDismissedController(dismissed) {
|
|
12
|
+
this.transitionController = ModalTransitionController.initWithOwner(new WeakRef(this));
|
|
13
|
+
this.presented = dismissed;
|
|
14
|
+
return this.transitionController;
|
|
15
|
+
}
|
|
16
|
+
iosInteractionDismiss(animator) {
|
|
17
|
+
console.log('-- iosInteractionDismiss --');
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
iosInteractionPresented(animator) {
|
|
21
|
+
console.log('-- iosInteractionPresented --');
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
iosPresentedViewController(presented, presenting, source) {
|
|
25
|
+
console.log('-- iosPresentedViewController --');
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
var ModalTransitionController = /** @class */ (function (_super) {
|
|
30
|
+
__extends(ModalTransitionController, _super);
|
|
31
|
+
function ModalTransitionController() {
|
|
32
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
33
|
+
}
|
|
34
|
+
ModalTransitionController.initWithOwner = function (owner) {
|
|
35
|
+
var ctrl = ModalTransitionController.new();
|
|
36
|
+
ctrl.owner = owner;
|
|
37
|
+
return ctrl;
|
|
38
|
+
};
|
|
39
|
+
ModalTransitionController.prototype.transitionDuration = function (transitionContext) {
|
|
40
|
+
return DEFAULT_DURATION;
|
|
41
|
+
};
|
|
42
|
+
ModalTransitionController.prototype.animateTransition = function (transitionContext) {
|
|
43
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
44
|
+
// console.log('ModalTransitionController animateTransition:', animationType);
|
|
45
|
+
var owner = this.owner.deref();
|
|
46
|
+
if (owner) {
|
|
47
|
+
// console.log('owner.id:', owner.id);
|
|
48
|
+
var state_1 = SharedTransition.getState(owner.id);
|
|
49
|
+
if (!state_1) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
// console.log('state.activeType:', state.activeType)
|
|
53
|
+
switch (state_1.activeType) {
|
|
54
|
+
case SharedTransitionAnimationType.present: {
|
|
55
|
+
console.log('-- Transition present --');
|
|
56
|
+
transitionContext.containerView.addSubview(owner.presented.view);
|
|
57
|
+
owner.presented.view.layoutIfNeeded();
|
|
58
|
+
var _q = SharedTransition.getSharedElements(state_1.page, state_1.toPage), sharedElements = _q.sharedElements, presented = _q.presented;
|
|
59
|
+
console.log(' ');
|
|
60
|
+
console.log("1. Found sharedTransitionTags to animate:", sharedElements.map(function (v) { return v.sharedTransitionTag; }));
|
|
61
|
+
console.log("2. Take snapshots of shared elements and position them based on presenting view:");
|
|
62
|
+
var _loop_1 = function (presentingView) {
|
|
63
|
+
if (!owner.sharedElements) {
|
|
64
|
+
owner.sharedElements = {
|
|
65
|
+
presented: [],
|
|
66
|
+
presenting: [],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
var presentingSharedElement = presentingView.ios;
|
|
70
|
+
// console.log('fromTarget instanceof UIImageView:', fromTarget instanceof UIImageView)
|
|
71
|
+
// TODO: discuss whether we should check if UIImage/UIImageView type to always snapshot images or if other view types could be duped/added vs. snapshotted
|
|
72
|
+
// Note: snapshot may be most efficient/simple
|
|
73
|
+
// console.log('---> ', presentingView.sharedTransitionTag, ': ', presentingSharedElement)
|
|
74
|
+
var presentedView = presented.find(function (v) { return v.sharedTransitionTag === presentingView.sharedTransitionTag; });
|
|
75
|
+
var presentedSharedElement = presentedView.ios;
|
|
76
|
+
var sharedElementSnapshot = UIImageView.alloc().init(); // WithImage(snapshotView(presentedSharedElement));
|
|
77
|
+
// treat images differently...
|
|
78
|
+
if (presentedSharedElement instanceof UIImageView) {
|
|
79
|
+
// in case the image is loaded async, we need to update the snapshot when it changes
|
|
80
|
+
// todo: remove listener on transition end
|
|
81
|
+
presentedView.on('imageSourceChange', function () {
|
|
82
|
+
sharedElementSnapshot.image = iosSnapshotView(presentedSharedElement);
|
|
83
|
+
sharedElementSnapshot.tintColor = presentedSharedElement.tintColor;
|
|
84
|
+
});
|
|
85
|
+
sharedElementSnapshot.tintColor = presentedSharedElement.tintColor;
|
|
86
|
+
sharedElementSnapshot.contentMode = presentedSharedElement.contentMode;
|
|
87
|
+
}
|
|
88
|
+
iosMatchLayerProperties(sharedElementSnapshot, presentingSharedElement);
|
|
89
|
+
sharedElementSnapshot.clipsToBounds = true;
|
|
90
|
+
// console.log('---> snapshot: ', sharedElementSnapshot);
|
|
91
|
+
var startFrame = presentingSharedElement.convertRectToView(presentingSharedElement.bounds, transitionContext.containerView);
|
|
92
|
+
var endFrame = presentedSharedElement.convertRectToView(presentedSharedElement.bounds, transitionContext.containerView);
|
|
93
|
+
sharedElementSnapshot.frame = startFrame;
|
|
94
|
+
console.log('---> ', presentingView.sharedTransitionTag, ' frame:', iosPrintRect(sharedElementSnapshot.frame));
|
|
95
|
+
owner.sharedElements.presenting.push({
|
|
96
|
+
view: presentingView,
|
|
97
|
+
startFrame: startFrame,
|
|
98
|
+
endFrame: endFrame,
|
|
99
|
+
snapshot: sharedElementSnapshot,
|
|
100
|
+
startOpacity: presentingView.opacity,
|
|
101
|
+
endOpacity: presentedView.opacity,
|
|
102
|
+
});
|
|
103
|
+
owner.sharedElements.presented.push({
|
|
104
|
+
view: presentedView,
|
|
105
|
+
startFrame: endFrame,
|
|
106
|
+
endFrame: startFrame,
|
|
107
|
+
startOpacity: presentedView.opacity,
|
|
108
|
+
endOpacity: presentingView.opacity,
|
|
109
|
+
});
|
|
110
|
+
// set initial opacity to match the source view opacity
|
|
111
|
+
sharedElementSnapshot.alpha = presentingView.opacity;
|
|
112
|
+
// hide both while animating within the transition context
|
|
113
|
+
presentingView.opacity = 0;
|
|
114
|
+
presentedView.opacity = 0;
|
|
115
|
+
// add snapshot to animate
|
|
116
|
+
transitionContext.containerView.addSubview(sharedElementSnapshot);
|
|
117
|
+
};
|
|
118
|
+
for (var _i = 0, sharedElements_1 = sharedElements; _i < sharedElements_1.length; _i++) {
|
|
119
|
+
var presentingView = sharedElements_1[_i];
|
|
120
|
+
_loop_1(presentingView);
|
|
121
|
+
}
|
|
122
|
+
var cleanupPresent_1 = function () {
|
|
123
|
+
for (var _i = 0, _a = owner.sharedElements.presented; _i < _a.length; _i++) {
|
|
124
|
+
var presented_1 = _a[_i];
|
|
125
|
+
presented_1.view.opacity = presented_1.startOpacity;
|
|
126
|
+
}
|
|
127
|
+
// TODO: Discuss with Igor whether this is necessary
|
|
128
|
+
// potential this could help smooth some shared element transitions
|
|
129
|
+
UIView.animateWithDurationAnimationsCompletion(0, // Igor: disabled for now, we'll talk about this and decide
|
|
130
|
+
function () {
|
|
131
|
+
for (var _i = 0, _a = owner.sharedElements.presenting; _i < _a.length; _i++) {
|
|
132
|
+
var presenting = _a[_i];
|
|
133
|
+
presenting.snapshot.alpha = presenting.endOpacity;
|
|
134
|
+
}
|
|
135
|
+
}, function () {
|
|
136
|
+
for (var _i = 0, _a = owner.sharedElements.presenting; _i < _a.length; _i++) {
|
|
137
|
+
var presenting = _a[_i];
|
|
138
|
+
presenting.snapshot.removeFromSuperview();
|
|
139
|
+
}
|
|
140
|
+
SharedTransition.updateState(owner.id, {
|
|
141
|
+
activeType: SharedTransitionAnimationType.dismiss,
|
|
142
|
+
});
|
|
143
|
+
transitionContext.completeTransition(true);
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
var updateFramePresent_1 = function () {
|
|
147
|
+
// https://stackoverflow.com/a/27997678/1418981
|
|
148
|
+
// In order to have proper layout. Seems mostly needed when presenting.
|
|
149
|
+
// For instance during presentation, destination view doesn't account navigation bar height.
|
|
150
|
+
// Not sure if best to leave all the time?
|
|
151
|
+
// owner.presented.view.setNeedsLayout();
|
|
152
|
+
// owner.presented.view.layoutIfNeeded();
|
|
153
|
+
console.log('3. Animating shared elements:');
|
|
154
|
+
var _loop_2 = function (presented_2) {
|
|
155
|
+
var presentingMatch = owner.sharedElements.presenting.find(function (v) { return v.view.sharedTransitionTag === presented_2.view.sharedTransitionTag; });
|
|
156
|
+
// Workaround wrong origin due ongoing layout process.
|
|
157
|
+
var updatedEndFrame = presented_2.view.ios.convertRectToView(presented_2.view.ios.bounds, transitionContext.containerView);
|
|
158
|
+
var correctedEndFrame = CGRectMake(updatedEndFrame.origin.x, updatedEndFrame.origin.y, presentingMatch.endFrame.size.width, presentingMatch.endFrame.size.height);
|
|
159
|
+
presentingMatch.snapshot.frame = correctedEndFrame;
|
|
160
|
+
// apply view and layer properties to the snapshot view to match the source/presented view
|
|
161
|
+
iosMatchLayerProperties(presentingMatch.snapshot, presented_2.view.ios);
|
|
162
|
+
// create a snapshot of the presented view
|
|
163
|
+
presentingMatch.snapshot.image = iosSnapshotView(presented_2.view.ios);
|
|
164
|
+
// apply correct alpha
|
|
165
|
+
presentingMatch.snapshot.alpha = presentingMatch.endOpacity;
|
|
166
|
+
console.log("---> ".concat(presentingMatch.view.sharedTransitionTag, " animate to: "), iosPrintRect(correctedEndFrame));
|
|
167
|
+
};
|
|
168
|
+
for (var _i = 0, _a = owner.sharedElements.presented; _i < _a.length; _i++) {
|
|
169
|
+
var presented_2 = _a[_i];
|
|
170
|
+
_loop_2(presented_2);
|
|
171
|
+
}
|
|
172
|
+
console.log(' ');
|
|
173
|
+
};
|
|
174
|
+
// starting page properties
|
|
175
|
+
owner.presented.view.alpha = typeof ((_a = state_1.toPageStart) === null || _a === void 0 ? void 0 : _a.opacity) === 'number' ? (_b = state_1.toPageStart) === null || _b === void 0 ? void 0 : _b.opacity : 0;
|
|
176
|
+
var startX = typeof ((_c = state_1.toPageStart) === null || _c === void 0 ? void 0 : _c.x) === 'number' ? (_d = state_1.toPageStart) === null || _d === void 0 ? void 0 : _d.x : 0;
|
|
177
|
+
var startY = typeof ((_e = state_1.toPageStart) === null || _e === void 0 ? void 0 : _e.y) === 'number' ? (_f = state_1.toPageStart) === null || _f === void 0 ? void 0 : _f.y : Screen.mainScreen.heightDIPs;
|
|
178
|
+
var startWidth = typeof ((_g = state_1.toPageStart) === null || _g === void 0 ? void 0 : _g.width) === 'number' ? (_h = state_1.toPageStart) === null || _h === void 0 ? void 0 : _h.width : Screen.mainScreen.widthDIPs;
|
|
179
|
+
var startHeight = typeof ((_j = state_1.toPageStart) === null || _j === void 0 ? void 0 : _j.height) === 'number' ? (_k = state_1.toPageStart) === null || _k === void 0 ? void 0 : _k.height : Screen.mainScreen.heightDIPs;
|
|
180
|
+
owner.presented.view.frame = CGRectMake(startX, startY, startWidth, startHeight);
|
|
181
|
+
UIView.animateWithDurationDelayUsingSpringWithDampingInitialSpringVelocityOptionsAnimationsCompletion(typeof ((_l = state_1.toPageStart) === null || _l === void 0 ? void 0 : _l.duration) === 'number' ? ((_m = state_1.toPageStart) === null || _m === void 0 ? void 0 : _m.duration) / 1000 : DEFAULT_DURATION, 0, 0.5, 3, UIViewAnimationOptions.CurveEaseInOut, function () {
|
|
182
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
183
|
+
// animate page properties to the following:
|
|
184
|
+
owner.presented.view.alpha = typeof ((_a = state_1.toPageEnd) === null || _a === void 0 ? void 0 : _a.opacity) === 'number' ? (_b = state_1.toPageEnd) === null || _b === void 0 ? void 0 : _b.opacity : 1;
|
|
185
|
+
var endX = typeof ((_c = state_1.toPageEnd) === null || _c === void 0 ? void 0 : _c.x) === 'number' ? (_d = state_1.toPageEnd) === null || _d === void 0 ? void 0 : _d.x : 0;
|
|
186
|
+
var endY = typeof ((_e = state_1.toPageEnd) === null || _e === void 0 ? void 0 : _e.y) === 'number' ? (_f = state_1.toPageEnd) === null || _f === void 0 ? void 0 : _f.y : 0;
|
|
187
|
+
var endWidth = typeof ((_g = state_1.toPageEnd) === null || _g === void 0 ? void 0 : _g.width) === 'number' ? (_h = state_1.toPageEnd) === null || _h === void 0 ? void 0 : _h.width : Screen.mainScreen.widthDIPs;
|
|
188
|
+
var endHeight = typeof ((_j = state_1.toPageEnd) === null || _j === void 0 ? void 0 : _j.height) === 'number' ? (_k = state_1.toPageEnd) === null || _k === void 0 ? void 0 : _k.height : Screen.mainScreen.heightDIPs;
|
|
189
|
+
owner.presented.view.frame = CGRectMake(endX, endY, endWidth, endHeight);
|
|
190
|
+
updateFramePresent_1();
|
|
191
|
+
}, function () {
|
|
192
|
+
cleanupPresent_1();
|
|
193
|
+
});
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
case SharedTransitionAnimationType.dismiss: {
|
|
197
|
+
console.log('-- Transition dismiss --');
|
|
198
|
+
// console.log('transitionContext.containerView.subviews.count:', transitionContext.containerView.subviews.count);
|
|
199
|
+
console.log(' ');
|
|
200
|
+
console.log("1. Dismiss sharedTransitionTags to animate:", owner.sharedElements.presented.map(function (p) { return p.view.sharedTransitionTag; }));
|
|
201
|
+
console.log("2. Add back previously stored sharedElements to dismiss:");
|
|
202
|
+
for (var _r = 0, _s = owner.sharedElements.presented; _r < _s.length; _r++) {
|
|
203
|
+
var p = _s[_r];
|
|
204
|
+
p.view.opacity = 0;
|
|
205
|
+
}
|
|
206
|
+
for (var _t = 0, _u = owner.sharedElements.presenting; _t < _u.length; _t++) {
|
|
207
|
+
var p = _u[_t];
|
|
208
|
+
p.snapshot.alpha = p.endOpacity;
|
|
209
|
+
transitionContext.containerView.addSubview(p.snapshot);
|
|
210
|
+
}
|
|
211
|
+
var cleanupDismiss_1 = function () {
|
|
212
|
+
for (var _i = 0, _a = owner.sharedElements.presenting; _i < _a.length; _i++) {
|
|
213
|
+
var presenting = _a[_i];
|
|
214
|
+
presenting.view.opacity = presenting.startOpacity;
|
|
215
|
+
}
|
|
216
|
+
SharedTransition.finishState(owner.id);
|
|
217
|
+
transitionContext.completeTransition(true);
|
|
218
|
+
};
|
|
219
|
+
var updateFrameDismiss_1 = function () {
|
|
220
|
+
console.log('3. Dismissing shared elements:');
|
|
221
|
+
for (var _i = 0, _a = owner.sharedElements.presenting; _i < _a.length; _i++) {
|
|
222
|
+
var presenting = _a[_i];
|
|
223
|
+
iosMatchLayerProperties(presenting.snapshot, presenting.view.ios);
|
|
224
|
+
presenting.snapshot.frame = presenting.startFrame;
|
|
225
|
+
presenting.snapshot.alpha = presenting.startOpacity;
|
|
226
|
+
console.log("---> ".concat(presenting.view.sharedTransitionTag, " animate to: "), iosPrintRect(presenting.startFrame));
|
|
227
|
+
}
|
|
228
|
+
console.log(' ');
|
|
229
|
+
};
|
|
230
|
+
UIView.animateWithDurationDelayUsingSpringWithDampingInitialSpringVelocityOptionsAnimationsCompletion(typeof ((_o = state_1.fromPageEnd) === null || _o === void 0 ? void 0 : _o.duration) === 'number' ? ((_p = state_1.fromPageEnd) === null || _p === void 0 ? void 0 : _p.duration) / 1000 : DEFAULT_DURATION, 0, 0.5, 3, UIViewAnimationOptions.CurveEaseInOut, function () {
|
|
231
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
232
|
+
owner.presented.view.alpha = typeof ((_a = state_1.fromPageEnd) === null || _a === void 0 ? void 0 : _a.opacity) === 'number' ? (_b = state_1.fromPageEnd) === null || _b === void 0 ? void 0 : _b.opacity : 0;
|
|
233
|
+
var endX = typeof ((_c = state_1.fromPageEnd) === null || _c === void 0 ? void 0 : _c.x) === 'number' ? (_d = state_1.fromPageEnd) === null || _d === void 0 ? void 0 : _d.x : 0;
|
|
234
|
+
var endY = typeof ((_e = state_1.fromPageEnd) === null || _e === void 0 ? void 0 : _e.y) === 'number' ? (_f = state_1.fromPageEnd) === null || _f === void 0 ? void 0 : _f.y : Screen.mainScreen.heightDIPs;
|
|
235
|
+
var endWidth = typeof ((_g = state_1.fromPageEnd) === null || _g === void 0 ? void 0 : _g.width) === 'number' ? (_h = state_1.fromPageEnd) === null || _h === void 0 ? void 0 : _h.width : Screen.mainScreen.widthDIPs;
|
|
236
|
+
var endHeight = typeof ((_j = state_1.fromPageEnd) === null || _j === void 0 ? void 0 : _j.height) === 'number' ? (_k = state_1.fromPageEnd) === null || _k === void 0 ? void 0 : _k.height : Screen.mainScreen.heightDIPs;
|
|
237
|
+
owner.presented.view.frame = CGRectMake(endX, endY, endWidth, endHeight);
|
|
238
|
+
updateFrameDismiss_1();
|
|
239
|
+
}, function () {
|
|
240
|
+
cleanupDismiss_1();
|
|
241
|
+
});
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
ModalTransitionController.ObjCProtocols = [UIViewControllerAnimatedTransitioning];
|
|
248
|
+
return ModalTransitionController;
|
|
249
|
+
}(NSObject));
|
|
250
|
+
//# sourceMappingURL=modal-transition.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-transition.ios.js","sourceRoot":"","sources":["../../../../../packages/core/ui/transition/modal-transition.ios.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAExG,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAS9C,sBAAsB,CAAC,SAA2B,EAAE,UAA4B,EAAE,MAAwB;QACzG,IAAI,CAAC,oBAAoB,GAAG,yBAAyB,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvF,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,yCAAyC;QACzC,OAAO,IAAI,CAAC,oBAAoB,CAAC;IAClC,CAAC;IAED,sBAAsB,CAAC,SAA2B;QACjD,IAAI,CAAC,oBAAoB,GAAG,yBAAyB,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvF,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,OAAO,IAAI,CAAC,oBAAoB,CAAC;IAClC,CAAC;IAED,qBAAqB,CAAC,QAA+C;QACpE,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACb,CAAC;IAED,uBAAuB,CAAC,QAA+C;QACtE,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC;IACb,CAAC;IAED,0BAA0B,CAAC,SAA2B,EAAE,UAA4B,EAAE,MAAwB;QAC7G,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BackstackEntry } from '../frame';
|
|
2
|
+
import { Transition } from '.';
|
|
3
|
+
export declare class PageTransition extends Transition {
|
|
4
|
+
createAndroidAnimator(transitionType: string): void;
|
|
5
|
+
test(fragmentTransaction: androidx.fragment.app.FragmentTransaction, currentEntry: BackstackEntry, newEntry: BackstackEntry): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Transition } from '.';
|
|
2
|
+
import { SharedTransition } from './shared-transition';
|
|
3
|
+
export class PageTransition extends Transition {
|
|
4
|
+
createAndroidAnimator(transitionType) {
|
|
5
|
+
console.log('HELLO PageTransition', transitionType);
|
|
6
|
+
}
|
|
7
|
+
test(fragmentTransaction, currentEntry, newEntry) {
|
|
8
|
+
console.log('HELLO PageTransition', fragmentTransaction);
|
|
9
|
+
const fromPage = currentEntry.resolvedPage;
|
|
10
|
+
const toPage = newEntry.resolvedPage;
|
|
11
|
+
const currentFragment = currentEntry ? currentEntry.fragment : null;
|
|
12
|
+
const newFragment = newEntry.fragment;
|
|
13
|
+
const { sharedElements, presented, presenting } = SharedTransition.getSharedElements(fromPage, toPage);
|
|
14
|
+
// fragmentTransaction.addSharedElement();
|
|
15
|
+
toPage.on('loaded', () => {
|
|
16
|
+
presented.forEach((v) => {
|
|
17
|
+
console.log({
|
|
18
|
+
presentedSharedElements: true,
|
|
19
|
+
nativeView: !!v.nativeView,
|
|
20
|
+
sharedTransitionTag: v.sharedTransitionTag,
|
|
21
|
+
});
|
|
22
|
+
androidx.core.view.ViewCompat.setTransitionName(v.nativeView, v.sharedTransitionTag);
|
|
23
|
+
});
|
|
24
|
+
// setTimeout(() => {
|
|
25
|
+
newFragment.startPostponedEnterTransition();
|
|
26
|
+
// }, 2000)
|
|
27
|
+
});
|
|
28
|
+
presenting.forEach((v) => {
|
|
29
|
+
console.log({
|
|
30
|
+
presentingSharedElements: true,
|
|
31
|
+
nativeView: !!v.nativeView,
|
|
32
|
+
sharedTransitionTag: v.sharedTransitionTag,
|
|
33
|
+
});
|
|
34
|
+
androidx.core.view.ViewCompat.setTransitionName(v.nativeView, v.sharedTransitionTag);
|
|
35
|
+
});
|
|
36
|
+
presenting.forEach((v) => {
|
|
37
|
+
fragmentTransaction.addSharedElement(v.nativeView, v.sharedTransitionTag);
|
|
38
|
+
});
|
|
39
|
+
fragmentTransaction.setReorderingAllowed(true);
|
|
40
|
+
const transitionSet = new androidx.transition.TransitionSet();
|
|
41
|
+
transitionSet.setDuration(2000);
|
|
42
|
+
transitionSet.addTransition(new androidx.transition.ChangeBounds());
|
|
43
|
+
transitionSet.addTransition(new androidx.transition.ChangeTransform());
|
|
44
|
+
// transitionSet.addTransition(new androidx.transition.ChangeClipBounds());
|
|
45
|
+
// postpone enter until we call "loaded" on the new page
|
|
46
|
+
newFragment.postponeEnterTransition();
|
|
47
|
+
newFragment.setSharedElementEnterTransition(transitionSet);
|
|
48
|
+
newFragment.setSharedElementReturnTransition(transitionSet);
|
|
49
|
+
// newFragment.setSharedElementReturnTransition(new androidx.transition.ChangeBounds());
|
|
50
|
+
// currentFragment.setSharedElementEnterTransition(new androidx.transition.ChangeBounds());
|
|
51
|
+
// currentFragment.setSharedElementReturnTransition(new androidx.transition.ChangeBounds());
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=page-transition.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-transition.android.js","sourceRoot":"","sources":["../../../../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@
|
|
|
1
|
+
import type { View } from '../core/view';
|
|
2
|
+
import { Transition } from '.';
|
|
3
|
+
export declare class PageTransition extends Transition {
|
|
4
|
+
presented: UIViewController;
|
|
5
|
+
presenting: UIViewController;
|
|
6
|
+
sharedElements: {
|
|
7
|
+
presented?: Array<{
|
|
8
|
+
view: View;
|
|
9
|
+
startFrame?: CGRect;
|
|
10
|
+
endFrame?: CGRect;
|
|
11
|
+
snapshot?: UIImageView;
|
|
12
|
+
startOpacity?: number;
|
|
13
|
+
endOpacity?: number;
|
|
14
|
+
}>;
|
|
15
|
+
presenting?: Array<{
|
|
16
|
+
view: View;
|
|
17
|
+
startFrame: CGRect;
|
|
18
|
+
endFrame?: CGRect;
|
|
19
|
+
snapshot?: UIImageView;
|
|
20
|
+
startOpacity?: number;
|
|
21
|
+
endOpacity?: number;
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
24
|
+
animateIOSTransition(transitionContext: UIViewControllerContextTransitioning, fromViewCtrl: UIViewController, toViewCtrl: UIViewController, operation: UINavigationControllerOperation): void;
|
|
25
|
+
}
|