@nativescript/core 9.0.0-alpha.25 → 9.0.0-alpha.26
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/application/application-common.d.ts +29 -10
- package/application/application-common.js +58 -5
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +10 -0
- package/application/application-shims.d.ts +27 -0
- package/application/application-shims.js +27 -0
- package/application/application-shims.js.map +1 -1
- package/application/application.android.d.ts +3 -0
- package/application/application.android.js +348 -349
- package/application/application.android.js.map +1 -1
- package/application/application.ios.d.ts +3 -0
- package/application/application.ios.js +30 -19
- package/application/application.ios.js.map +1 -1
- package/config/config.interface.d.ts +21 -0
- package/connectivity/index.android.js +22 -22
- package/connectivity/index.android.js.map +1 -1
- package/core-types/index.d.ts +10 -1
- package/core-types/index.js +10 -1
- package/core-types/index.js.map +1 -1
- package/core-types/validators.js +12 -6
- package/core-types/validators.js.map +1 -1
- package/data/observable/index.d.ts +2 -1
- package/data/observable/index.js +31 -19
- package/data/observable/index.js.map +1 -1
- package/fps-meter/fps-native.ios.js +1 -1
- package/fps-meter/fps-native.ios.js.map +1 -1
- package/http/http-request/index.ios.js +1 -1
- package/http/http-request/index.ios.js.map +1 -1
- package/package.json +1 -1
- package/platform/screen/index.d.ts +5 -0
- package/platforms/android/widgets-release.aar +0 -0
- package/timer/index.ios.js +1 -1
- package/timer/index.ios.js.map +1 -1
- package/ui/action-bar/index.android.js +18 -18
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.js +2 -4
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/animation/index.ios.js +2 -3
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/button/index.android.js +20 -20
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.ios.d.ts +2 -1
- package/ui/button/index.ios.js +28 -10
- package/ui/button/index.ios.js.map +1 -1
- package/ui/core/control-state-change/index.ios.js +1 -1
- package/ui/core/control-state-change/index.ios.js.map +1 -1
- package/ui/core/view/index.android.d.ts +2 -0
- package/ui/core/view/index.android.js +221 -194
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +17 -4
- package/ui/core/view/index.ios.d.ts +3 -2
- package/ui/core/view/index.ios.js +25 -11
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +10 -8
- 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 +5 -0
- package/ui/core/view/view-helper/index.ios.d.ts +5 -4
- package/ui/core/view/view-helper/index.ios.js +20 -23
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +7 -0
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view-base/index.d.ts +4 -0
- package/ui/core/view-base/index.js +4 -0
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/date-picker/index.android.js +38 -38
- package/ui/date-picker/index.android.js.map +1 -1
- package/ui/date-picker/index.ios.js +1 -1
- package/ui/date-picker/index.ios.js.map +1 -1
- package/ui/editable-text-base/index.android.js +34 -34
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/frame/fragment.transitions.android.d.ts +2 -1
- package/ui/frame/fragment.transitions.android.js +106 -104
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/fragment.transitions.d.ts +3 -2
- package/ui/frame/index.android.js +2 -2
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.ios.d.ts +2 -1
- package/ui/frame/index.ios.js +83 -43
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/index.android.js +129 -130
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.ios.js +3 -5
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.js +32 -32
- package/ui/gestures/touch-manager.js.map +1 -1
- package/ui/image/index.android.js +19 -19
- package/ui/image/index.android.js.map +1 -1
- package/ui/image-cache/index.android.js +12 -14
- package/ui/image-cache/index.android.js.map +1 -1
- package/ui/image-cache/index.ios.js +6 -6
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/index.d.ts +1 -0
- package/ui/index.js +1 -0
- package/ui/index.js.map +1 -1
- package/ui/label/index.android.js +4 -1
- package/ui/label/index.android.js.map +1 -1
- package/ui/label/index.ios.d.ts +2 -1
- package/ui/label/index.ios.js +12 -2
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.ios.js +3 -6
- package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
- package/ui/layouts/stack-layout/index.ios.js +6 -0
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/list-picker/index.android.js +35 -35
- package/ui/list-picker/index.android.js.map +1 -1
- package/ui/list-picker/index.ios.js +2 -2
- package/ui/list-picker/index.ios.js.map +1 -1
- package/ui/list-view/index.android.js +278 -320
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.d.ts +5 -0
- package/ui/list-view/index.ios.js +12 -27
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/page/index.ios.js +25 -64
- package/ui/page/index.ios.js.map +1 -1
- package/ui/scroll-view/index.d.ts +1 -1
- package/ui/scroll-view/index.ios.d.ts +2 -0
- package/ui/scroll-view/index.ios.js +31 -12
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/scroll-view/scroll-view-common.d.ts +3 -8
- package/ui/scroll-view/scroll-view-common.js +4 -4
- package/ui/scroll-view/scroll-view-common.js.map +1 -1
- package/ui/search-bar/index.android.js +48 -52
- package/ui/search-bar/index.android.js.map +1 -1
- package/ui/search-bar/index.ios.js +3 -6
- package/ui/search-bar/index.ios.js.map +1 -1
- package/ui/segmented-bar/index.android.js +56 -58
- package/ui/segmented-bar/index.android.js.map +1 -1
- package/ui/segmented-bar/index.ios.js +1 -1
- package/ui/segmented-bar/index.ios.js.map +1 -1
- package/ui/slider/index.android.js +23 -25
- package/ui/slider/index.android.js.map +1 -1
- package/ui/slider/index.ios.js +2 -2
- package/ui/slider/index.ios.js.map +1 -1
- package/ui/split-view/index.android.d.ts +4 -0
- package/ui/split-view/index.android.js +4 -0
- package/ui/split-view/index.android.js.map +1 -0
- package/ui/split-view/index.d.ts +11 -0
- package/ui/split-view/index.ios.d.ts +39 -0
- package/ui/split-view/index.ios.js +368 -0
- package/ui/split-view/index.ios.js.map +1 -0
- package/ui/split-view/split-view-common.d.ts +51 -0
- package/ui/split-view/split-view-common.js +111 -0
- package/ui/split-view/split-view-common.js.map +1 -0
- package/ui/styling/style/index.d.ts +1 -0
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-properties.d.ts +1 -0
- package/ui/styling/style-properties.js +7 -0
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/switch/index.android.js +18 -18
- package/ui/switch/index.android.js.map +1 -1
- package/ui/switch/index.ios.d.ts +1 -0
- package/ui/switch/index.ios.js +62 -12
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/tab-view/index.android.js +163 -179
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.d.ts +17 -1
- package/ui/tab-view/index.ios.d.ts +12 -4
- package/ui/tab-view/index.ios.js +225 -40
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/tab-view/tab-view-common.d.ts +12 -0
- package/ui/tab-view/tab-view-common.js +10 -0
- package/ui/tab-view/tab-view-common.js.map +1 -1
- package/ui/text-base/index.android.d.ts +2 -1
- package/ui/text-base/index.android.js +133 -101
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.d.ts +5 -0
- package/ui/text-base/index.ios.js +12 -18
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-base/text-base-common.d.ts +2 -1
- package/ui/text-base/text-base-common.js +1 -0
- package/ui/text-base/text-base-common.js.map +1 -1
- package/ui/text-field/index.ios.d.ts +2 -1
- package/ui/text-field/index.ios.js +9 -5
- package/ui/text-field/index.ios.js.map +1 -1
- package/ui/text-view/index.ios.d.ts +2 -1
- package/ui/text-view/index.ios.js +12 -7
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/time-picker/index.android.js +21 -21
- package/ui/time-picker/index.android.js.map +1 -1
- package/ui/time-picker/index.ios.js +1 -1
- package/ui/time-picker/index.ios.js.map +1 -1
- package/ui/transition/fade-transition.ios.js +5 -6
- package/ui/transition/fade-transition.ios.js.map +1 -1
- package/ui/transition/modal-transition.ios.js +19 -26
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.android.js +3 -12
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/transition/page-transition.ios.js +19 -25
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/slide-transition.ios.js +5 -6
- package/ui/transition/slide-transition.ios.js.map +1 -1
- package/ui/web-view/index.android.js +58 -62
- package/ui/web-view/index.android.js.map +1 -1
- package/ui/web-view/index.ios.js +18 -18
- package/ui/web-view/index.ios.js.map +1 -1
- package/utils/layout-helper/index.android.d.ts +1 -0
- package/utils/layout-helper/index.android.js +9 -0
- package/utils/layout-helper/index.android.js.map +1 -1
- package/utils/layout-helper/index.d.ts +5 -0
- package/utils/layout-helper/index.ios.d.ts +1 -0
- package/utils/layout-helper/index.ios.js +4 -0
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/native-helper.ios.js +20 -20
- package/utils/native-helper.ios.js.map +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { getNativeScriptGlobals } from '../../../globals/global-utils';
|
|
2
2
|
import { ViewCommon, isEnabledProperty, originXProperty, originYProperty, isUserInteractionEnabledProperty, testIDProperty, AndroidHelper, androidOverflowEdgeProperty, statusBarStyleProperty } from './view-common';
|
|
3
|
-
import { paddingLeftProperty, paddingTopProperty, paddingRightProperty, paddingBottomProperty } from '../../styling/style-properties';
|
|
3
|
+
import { paddingLeftProperty, paddingTopProperty, paddingRightProperty, paddingBottomProperty, directionProperty } from '../../styling/style-properties';
|
|
4
4
|
import { layout } from '../../../utils';
|
|
5
5
|
import { Trace } from '../../../trace';
|
|
6
6
|
import { hiddenProperty } from '../view-base';
|
|
7
7
|
import { isCssWideKeyword } from '../properties/property-shared';
|
|
8
8
|
import { perspectiveProperty, visibilityProperty, opacityProperty, horizontalAlignmentProperty, verticalAlignmentProperty, minWidthProperty, minHeightProperty, widthProperty, heightProperty, marginLeftProperty, marginTopProperty, marginRightProperty, marginBottomProperty, rotateProperty, rotateXProperty, rotateYProperty, scaleXProperty, scaleYProperty, translateXProperty, translateYProperty, zIndexProperty, backgroundInternalProperty, androidElevationProperty, androidDynamicElevationOffsetProperty } from '../../styling/style-properties';
|
|
9
|
+
import { CoreTypes } from '../../../core-types';
|
|
9
10
|
import { Background, refreshBorderDrawable } from '../../styling/background';
|
|
10
11
|
import { profile } from '../../../profiling';
|
|
11
12
|
import { topmost } from '../../frame/frame-stack';
|
|
@@ -79,202 +80,184 @@ function initializeTouchListener() {
|
|
|
79
80
|
if (TouchListener) {
|
|
80
81
|
return;
|
|
81
82
|
}
|
|
82
|
-
var TouchListenerImpl =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
TouchListenerImpl.prototype.onTouch = function (view, event) {
|
|
90
|
-
var owner = this.owner.get();
|
|
91
|
-
if (!owner) {
|
|
92
|
-
return;
|
|
83
|
+
var TouchListenerImpl = (function (_super) {
|
|
84
|
+
__extends(TouchListenerImpl, _super);
|
|
85
|
+
function TouchListenerImpl(owner) {
|
|
86
|
+
var _this = _super.call(this) || this;
|
|
87
|
+
_this.owner = new WeakRef(owner);
|
|
88
|
+
return global.__native(_this);
|
|
93
89
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
90
|
+
TouchListenerImpl.prototype.onTouch = function (view, event) {
|
|
91
|
+
var owner = this.owner.get();
|
|
92
|
+
if (!owner) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
owner.handleGestureTouch(event);
|
|
96
|
+
var nativeView = owner.nativeViewProtected;
|
|
97
|
+
if (!nativeView || !nativeView.onTouchEvent) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
return nativeView.onTouchEvent(event);
|
|
101
|
+
};
|
|
102
|
+
var _a;
|
|
103
|
+
TouchListenerImpl = __decorate([
|
|
104
|
+
Interfaces([android.view.View.OnTouchListener]),
|
|
105
|
+
__metadata("design:paramtypes", [typeof (_a = typeof View !== "undefined" && View) === "function" ? _a : Object])
|
|
106
|
+
], TouchListenerImpl);
|
|
107
|
+
return TouchListenerImpl;
|
|
108
|
+
}(java.lang.Object));
|
|
108
109
|
TouchListener = TouchListenerImpl;
|
|
109
110
|
}
|
|
110
111
|
function initializeDialogFragment() {
|
|
111
112
|
if (DialogFragment) {
|
|
112
113
|
return;
|
|
113
114
|
}
|
|
114
|
-
var DialogImpl =
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return global.__native(_this);
|
|
126
|
-
}
|
|
127
|
-
DialogImpl.prototype.onDetachedFromWindow = function () {
|
|
128
|
-
_super.prototype.onDetachedFromWindow.call(this);
|
|
129
|
-
this.fragment = null;
|
|
130
|
-
};
|
|
131
|
-
DialogImpl.prototype.onBackPressed = function () {
|
|
132
|
-
if (SDK_VERSION >= 33) {
|
|
133
|
-
_super.prototype.onBackPressed.call(this);
|
|
134
|
-
return;
|
|
115
|
+
var DialogImpl = (function (_super) {
|
|
116
|
+
__extends(DialogImpl, _super);
|
|
117
|
+
function DialogImpl(fragment, context, themeResId) {
|
|
118
|
+
var _this = _super.call(this, context, themeResId) || this;
|
|
119
|
+
_this.fragment = fragment;
|
|
120
|
+
if (SDK_VERSION >= 33 && OnBackPressedCallback) {
|
|
121
|
+
var callback = new OnBackPressedCallback(true);
|
|
122
|
+
callback["_dialog"] = new WeakRef(_this);
|
|
123
|
+
_this.getOnBackPressedDispatcher().addCallback(_this, callback);
|
|
124
|
+
}
|
|
125
|
+
return global.__native(_this);
|
|
135
126
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
object: view,
|
|
140
|
-
activity: view._context,
|
|
141
|
-
cancel: false,
|
|
127
|
+
DialogImpl.prototype.onDetachedFromWindow = function () {
|
|
128
|
+
_super.prototype.onDetachedFromWindow.call(this);
|
|
129
|
+
this.fragment = null;
|
|
142
130
|
};
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
var window = this.getDialog().getWindow();
|
|
219
|
-
if (this._windowSoftInputMode !== undefined) {
|
|
220
|
-
window.setSoftInputMode(this._windowSoftInputMode);
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
// the dialog seems to not follow the default activity softInputMode,
|
|
224
|
-
// thus set we set it here.
|
|
225
|
-
window.setSoftInputMode(owner._context.getWindow().getAttributes().softInputMode);
|
|
226
|
-
}
|
|
227
|
-
return owner.nativeViewProtected;
|
|
228
|
-
};
|
|
229
|
-
DialogFragmentImpl.prototype.onStart = function () {
|
|
230
|
-
_super.prototype.onStart.call(this);
|
|
231
|
-
if (this._fullscreen) {
|
|
131
|
+
DialogImpl.prototype.onBackPressed = function () {
|
|
132
|
+
if (SDK_VERSION >= 33) {
|
|
133
|
+
_super.prototype.onBackPressed.call(this);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
var view = this.fragment.owner;
|
|
137
|
+
var args = {
|
|
138
|
+
eventName: "activityBackPressed",
|
|
139
|
+
object: view,
|
|
140
|
+
activity: view._context,
|
|
141
|
+
cancel: false,
|
|
142
|
+
};
|
|
143
|
+
getNativeScriptGlobals().events.notify(args);
|
|
144
|
+
if (args.cancel) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
view.notify(args);
|
|
148
|
+
if (!args.cancel && !view.onBackPressed()) {
|
|
149
|
+
_super.prototype.onBackPressed.call(this);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
return DialogImpl;
|
|
153
|
+
}(androidx.appcompat.app.AppCompatDialog));
|
|
154
|
+
var DialogFragmentImpl = (function (_super) {
|
|
155
|
+
__extends(DialogFragmentImpl, _super);
|
|
156
|
+
function DialogFragmentImpl() {
|
|
157
|
+
var _this = _super.call(this) || this;
|
|
158
|
+
return global.__native(_this);
|
|
159
|
+
}
|
|
160
|
+
DialogFragmentImpl.prototype.onCreate = function (savedInstanceState) {
|
|
161
|
+
var _a;
|
|
162
|
+
_super.prototype.onCreate.call(this, savedInstanceState);
|
|
163
|
+
var ownerId = (_a = this.getArguments()) === null || _a === void 0 ? void 0 : _a.getInt(DOMID);
|
|
164
|
+
var options = getModalOptions(ownerId);
|
|
165
|
+
if (savedInstanceState != null && options === undefined) {
|
|
166
|
+
this.dismissAllowingStateLoss();
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
DialogFragmentImpl.prototype.onCreateDialog = function (savedInstanceState) {
|
|
170
|
+
var ownerId = this.getArguments().getInt(DOMID);
|
|
171
|
+
var options = getModalOptions(ownerId);
|
|
172
|
+
this.owner = options.owner;
|
|
173
|
+
this.owner._dialogFragment = this;
|
|
174
|
+
this._fullscreen = options.fullscreen;
|
|
175
|
+
this._animated = options.animated;
|
|
176
|
+
this._cancelable = options.cancelable;
|
|
177
|
+
this._stretched = options.stretched;
|
|
178
|
+
this._dismissCallback = options.dismissCallback;
|
|
179
|
+
this._shownCallback = options.shownCallback;
|
|
180
|
+
this._windowSoftInputMode = options.windowSoftInputMode;
|
|
181
|
+
this.setStyle(androidx.fragment.app.DialogFragment.STYLE_NO_TITLE, 0);
|
|
182
|
+
var theme = this.getTheme();
|
|
183
|
+
if (this._fullscreen) {
|
|
184
|
+
theme = this.getActivity().getApplicationInfo().theme;
|
|
185
|
+
}
|
|
186
|
+
var dialog = new DialogImpl(this, this.getActivity(), theme);
|
|
187
|
+
if (!this._fullscreen && !this._stretched) {
|
|
188
|
+
this.owner.horizontalAlignment = "center";
|
|
189
|
+
this.owner.verticalAlignment = "middle";
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
this.owner.horizontalAlignment = "stretch";
|
|
193
|
+
this.owner.verticalAlignment = "stretch";
|
|
194
|
+
}
|
|
195
|
+
if (this._animated) {
|
|
196
|
+
dialog.getWindow().setWindowAnimations(styleAnimationDialog);
|
|
197
|
+
}
|
|
198
|
+
dialog.setCanceledOnTouchOutside(this._cancelable);
|
|
199
|
+
return dialog;
|
|
200
|
+
};
|
|
201
|
+
DialogFragmentImpl.prototype.onCreateView = function (inflater, container, savedInstanceState) {
|
|
202
|
+
var owner = this.owner;
|
|
203
|
+
this.activity = new WeakRef(this.getActivity());
|
|
204
|
+
owner._setupAsRootView(this.getActivity());
|
|
205
|
+
owner._isAddedToNativeVisualTree = true;
|
|
232
206
|
var window = this.getDialog().getWindow();
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
if (owner) {
|
|
267
|
-
// Android calls onDestroy before onDismiss.
|
|
268
|
-
// Make sure we unload first and then call _tearDownUI.
|
|
269
|
-
if (owner.isLoaded) {
|
|
207
|
+
if (this._windowSoftInputMode !== undefined) {
|
|
208
|
+
window.setSoftInputMode(this._windowSoftInputMode);
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
window.setSoftInputMode(owner._context.getWindow().getAttributes().softInputMode);
|
|
212
|
+
}
|
|
213
|
+
return owner.nativeViewProtected;
|
|
214
|
+
};
|
|
215
|
+
DialogFragmentImpl.prototype.onStart = function () {
|
|
216
|
+
_super.prototype.onStart.call(this);
|
|
217
|
+
if (this._fullscreen) {
|
|
218
|
+
var window = this.getDialog().getWindow();
|
|
219
|
+
var length = android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
|
220
|
+
window.setLayout(length, length);
|
|
221
|
+
window.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.WHITE));
|
|
222
|
+
}
|
|
223
|
+
var owner = this.owner;
|
|
224
|
+
if (owner && !owner.isLoaded) {
|
|
225
|
+
owner.callLoaded();
|
|
226
|
+
}
|
|
227
|
+
this._shownCallback();
|
|
228
|
+
};
|
|
229
|
+
DialogFragmentImpl.prototype.onDismiss = function (dialog) {
|
|
230
|
+
var _a;
|
|
231
|
+
_super.prototype.onDismiss.call(this, dialog);
|
|
232
|
+
var manager = this.getFragmentManager();
|
|
233
|
+
var activity = (_a = this.activity) === null || _a === void 0 ? void 0 : _a.get();
|
|
234
|
+
if (manager && !(activity === null || activity === void 0 ? void 0 : activity.isChangingConfigurations())) {
|
|
235
|
+
removeModal(this.owner._domId);
|
|
236
|
+
this._dismissCallback();
|
|
237
|
+
}
|
|
238
|
+
var owner = this.owner;
|
|
239
|
+
if (owner && owner.isLoaded) {
|
|
270
240
|
owner.callUnloaded();
|
|
271
241
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
242
|
+
};
|
|
243
|
+
DialogFragmentImpl.prototype.onDestroy = function () {
|
|
244
|
+
var _a;
|
|
245
|
+
_super.prototype.onDestroy.call(this);
|
|
246
|
+
var owner = this.owner;
|
|
247
|
+
var activity = (_a = this.activity) === null || _a === void 0 ? void 0 : _a.get();
|
|
248
|
+
if (!(activity === null || activity === void 0 ? void 0 : activity.isChangingConfigurations())) {
|
|
249
|
+
this.activity = null;
|
|
250
|
+
}
|
|
251
|
+
if (owner) {
|
|
252
|
+
if (owner.isLoaded) {
|
|
253
|
+
owner.callUnloaded();
|
|
254
|
+
}
|
|
255
|
+
owner._isAddedToNativeVisualTree = false;
|
|
256
|
+
owner._tearDownUI(true);
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
return DialogFragmentImpl;
|
|
260
|
+
}(androidx.fragment.app.DialogFragment));
|
|
278
261
|
DialogFragment = DialogFragmentImpl;
|
|
279
262
|
}
|
|
280
263
|
function saveModal(options) {
|
|
@@ -532,11 +515,29 @@ export class View extends ViewCommon {
|
|
|
532
515
|
return false;
|
|
533
516
|
}
|
|
534
517
|
handleGestureTouch(event) {
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
518
|
+
// This keeps a copy of gesture observers from the map to ensure concurrency
|
|
519
|
+
const allObservers = Object.values(this._gestureObservers);
|
|
520
|
+
for (const observers of allObservers) {
|
|
521
|
+
const length = observers.length;
|
|
522
|
+
if (!length) {
|
|
523
|
+
continue;
|
|
524
|
+
}
|
|
525
|
+
if (length === 1) {
|
|
526
|
+
const entry = observers[0];
|
|
527
|
+
if (entry) {
|
|
528
|
+
entry.androidOnTouchEvent(event);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
// This keeps a copy of gesture observers list to ensure concurrency
|
|
533
|
+
const observersCp = observers.slice();
|
|
534
|
+
for (let i = 0; i < length; i++) {
|
|
535
|
+
const entry = observersCp[i];
|
|
536
|
+
if (entry) {
|
|
537
|
+
entry.androidOnTouchEvent(event);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
540
541
|
}
|
|
541
542
|
if (this.parent instanceof View) {
|
|
542
543
|
this.parent.handleGestureTouch(event);
|
|
@@ -878,8 +879,14 @@ export class View extends ViewCommon {
|
|
|
878
879
|
const gravity = lp.gravity;
|
|
879
880
|
const weight = lp.weight;
|
|
880
881
|
// Set only if params gravity exists.
|
|
881
|
-
if (gravity
|
|
882
|
+
if (gravity != null) {
|
|
882
883
|
switch (value) {
|
|
884
|
+
case 'start':
|
|
885
|
+
lp.gravity = (this.direction === CoreTypes.LayoutDirection.rtl ? GRAVITY_RIGHT : GRAVITY_LEFT) | (gravity & VERTICAL_GRAVITY_MASK);
|
|
886
|
+
if (weight < 0) {
|
|
887
|
+
lp.weight = -2;
|
|
888
|
+
}
|
|
889
|
+
break;
|
|
883
890
|
case 'left':
|
|
884
891
|
lp.gravity = GRAVITY_LEFT | (gravity & VERTICAL_GRAVITY_MASK);
|
|
885
892
|
if (weight < 0) {
|
|
@@ -898,6 +905,12 @@ export class View extends ViewCommon {
|
|
|
898
905
|
lp.weight = -2;
|
|
899
906
|
}
|
|
900
907
|
break;
|
|
908
|
+
case 'end':
|
|
909
|
+
lp.gravity = (this.direction === CoreTypes.LayoutDirection.rtl ? GRAVITY_LEFT : GRAVITY_RIGHT) | (gravity & VERTICAL_GRAVITY_MASK);
|
|
910
|
+
if (weight < 0) {
|
|
911
|
+
lp.weight = -2;
|
|
912
|
+
}
|
|
913
|
+
break;
|
|
901
914
|
case 'stretch':
|
|
902
915
|
lp.gravity = GRAVITY_FILL_HORIZONTAL | (gravity & VERTICAL_GRAVITY_MASK);
|
|
903
916
|
if (weight < 0) {
|
|
@@ -1027,9 +1040,6 @@ export class View extends ViewCommon {
|
|
|
1027
1040
|
}
|
|
1028
1041
|
return this._context.getWindow();
|
|
1029
1042
|
}
|
|
1030
|
-
[testIDProperty.setNative](value) {
|
|
1031
|
-
this.setAccessibilityIdentifier(this.nativeViewProtected, value);
|
|
1032
|
-
}
|
|
1033
1043
|
setAccessibilityIdentifier(view, value) {
|
|
1034
1044
|
const id = Utils.android.resources.getId(':id/nativescript_accessibility_id');
|
|
1035
1045
|
if (id) {
|
|
@@ -1041,6 +1051,23 @@ export class View extends ViewCommon {
|
|
|
1041
1051
|
if (this.accessibilityIdentifier !== value)
|
|
1042
1052
|
this.accessibilityIdentifier = value;
|
|
1043
1053
|
}
|
|
1054
|
+
[directionProperty.setNative](value) {
|
|
1055
|
+
const nativeView = this.nativeViewProtected;
|
|
1056
|
+
switch (value) {
|
|
1057
|
+
case CoreTypes.LayoutDirection.ltr:
|
|
1058
|
+
nativeView.setLayoutDirection(android.view.View.LAYOUT_DIRECTION_LTR);
|
|
1059
|
+
break;
|
|
1060
|
+
case CoreTypes.LayoutDirection.rtl:
|
|
1061
|
+
nativeView.setLayoutDirection(android.view.View.LAYOUT_DIRECTION_RTL);
|
|
1062
|
+
break;
|
|
1063
|
+
default:
|
|
1064
|
+
nativeView.setLayoutDirection(android.view.View.LAYOUT_DIRECTION_LOCALE);
|
|
1065
|
+
break;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
[testIDProperty.setNative](value) {
|
|
1069
|
+
this.setAccessibilityIdentifier(this.nativeViewProtected, value);
|
|
1070
|
+
}
|
|
1044
1071
|
[accessibilityEnabledProperty.setNative](value) {
|
|
1045
1072
|
this.nativeViewProtected.setFocusable(!!value);
|
|
1046
1073
|
updateA11yPropertiesCallback(this);
|