@nativescript/core 9.0.0-preview.2 → 9.0.0
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 +40 -14
- package/application/application-common.js +109 -5
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +31 -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 +12 -2
- package/application/application.android.js +380 -343
- package/application/application.android.js.map +1 -1
- package/application/application.d.ts +74 -1
- package/application/application.ios.d.ts +68 -1
- package/application/application.ios.js +642 -16
- package/application/application.ios.js.map +1 -1
- package/application/helpers.android.d.ts +0 -9
- package/application/helpers.android.js +0 -54
- package/application/helpers.android.js.map +1 -1
- package/application/helpers.d.ts +0 -10
- package/application/helpers.ios.d.ts +0 -19
- package/application/helpers.ios.js +0 -38
- package/application/helpers.ios.js.map +1 -1
- package/cli-hooks/{before-checkForChanges.js → before-checkForChanges.mjs} +6 -6
- package/cli-hooks/postinstall.mjs +7 -0
- package/cli-hooks/preuninstall.mjs +7 -0
- package/config/config.interface.d.ts +21 -0
- package/connectivity/index.android.js +25 -25
- package/connectivity/index.android.js.map +1 -1
- package/core-types/index.d.ts +78 -63
- package/core-types/index.js +11 -1
- package/core-types/index.js.map +1 -1
- package/core-types/validators.js +14 -5
- 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/globals/index.js +1 -2
- package/globals/index.js.map +1 -1
- package/http/http-request/index.ios.js +1 -1
- package/http/http-request/index.ios.js.map +1 -1
- package/image-asset/image-asset-common.js +31 -3
- package/image-asset/image-asset-common.js.map +1 -1
- package/image-source/index.android.js +4 -3
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.d.ts +2 -2
- package/index.d.ts +1 -0
- package/index.js +0 -1
- package/index.js.map +1 -1
- package/inspector_modules.d.ts +0 -5
- package/inspector_modules.js +223 -103
- package/inspector_modules.js.map +1 -1
- package/package.json +15 -13
- package/platform/screen/index.d.ts +5 -0
- package/platforms/android/widgets-release.aar +0 -0
- package/references.d.ts +1 -1
- package/timer/index.android.js +15 -7
- package/timer/index.android.js.map +1 -1
- package/timer/index.ios.js +1 -1
- package/timer/index.ios.js.map +1 -1
- package/ui/action-bar/index.android.js +16 -18
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.d.ts +1 -0
- package/ui/action-bar/index.ios.js +28 -4
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/animation/index.d.ts +14 -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.d.ts +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/properties/index.js +64 -52
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/view/index.android.d.ts +19 -2
- package/ui/core/view/index.android.js +544 -200
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +55 -4
- package/ui/core/view/index.ios.d.ts +19 -2
- package/ui/core/view/index.ios.js +148 -10
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +70 -10
- package/ui/core/view/view-common.js +66 -1
- 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 +6 -4
- package/ui/core/view/view-helper/index.ios.js +37 -20
- 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/view-interfaces.d.ts +22 -0
- package/ui/core/view-base/index.d.ts +4 -0
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/date-picker/index.android.js +36 -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/dialogs/index.ios.js +4 -2
- package/ui/dialogs/index.ios.js.map +1 -1
- package/ui/editable-text-base/editable-text-base-common.js +1 -1
- package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
- package/ui/editable-text-base/index.android.d.ts +1 -1
- package/ui/editable-text-base/index.android.js +35 -34
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/editable-text-base/index.ios.d.ts +1 -1
- package/ui/editable-text-base/index.ios.js +3 -0
- package/ui/editable-text-base/index.ios.js.map +1 -1
- package/ui/frame/activity.android.js +3 -0
- package/ui/frame/activity.android.js.map +1 -1
- package/ui/frame/fragment.transitions.android.d.ts +2 -1
- package/ui/frame/fragment.transitions.android.js +103 -104
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/fragment.transitions.d.ts +3 -2
- package/ui/frame/frame-interfaces.d.ts +18 -8
- package/ui/frame/index.android.d.ts +2 -0
- package/ui/frame/index.android.js +57 -2
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +1 -1
- package/ui/frame/index.ios.d.ts +3 -1
- package/ui/frame/index.ios.js +94 -59
- 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 +17 -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 +10 -4
- package/ui/index.js +4 -1
- 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/index.d.ts +5 -1
- package/ui/layouts/index.js +2 -0
- package/ui/layouts/index.js.map +1 -1
- package/ui/layouts/liquid-glass/index.android.d.ts +5 -0
- package/ui/layouts/liquid-glass/index.android.js +8 -0
- package/ui/layouts/liquid-glass/index.android.js.map +1 -0
- package/ui/layouts/liquid-glass/index.d.ts +10 -0
- package/ui/layouts/liquid-glass/index.ios.d.ts +10 -0
- package/ui/layouts/liquid-glass/index.ios.js +59 -0
- package/ui/layouts/liquid-glass/index.ios.js.map +1 -0
- package/ui/layouts/liquid-glass/liquid-glass-common.d.ts +3 -0
- package/ui/layouts/liquid-glass/liquid-glass-common.js +4 -0
- package/ui/layouts/liquid-glass/liquid-glass-common.js.map +1 -0
- package/ui/layouts/liquid-glass-container/index.android.d.ts +3 -0
- package/ui/layouts/liquid-glass-container/index.android.js +4 -0
- package/ui/layouts/liquid-glass-container/index.android.js.map +1 -0
- package/ui/layouts/liquid-glass-container/index.d.ts +3 -0
- package/ui/layouts/liquid-glass-container/index.ios.d.ts +14 -0
- package/ui/layouts/liquid-glass-container/index.ios.js +121 -0
- package/ui/layouts/liquid-glass-container/index.ios.js.map +1 -0
- package/ui/layouts/liquid-glass-container/liquid-glass-container-common.d.ts +4 -0
- package/ui/layouts/liquid-glass-container/liquid-glass-container-common.js +5 -0
- package/ui/layouts/liquid-glass-container/liquid-glass-container-common.js.map +1 -0
- 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 +31 -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 +320 -321
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.d.ts +7 -2
- package/ui/list-view/index.ios.d.ts +1 -1
- package/ui/list-view/index.ios.js +30 -45
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/page/index.android.d.ts +1 -10
- package/ui/page/index.android.js +1 -45
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.d.ts +0 -8
- package/ui/page/index.ios.d.ts +1 -3
- package/ui/page/index.ios.js +33 -91
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.d.ts +0 -6
- package/ui/page/page-common.js +0 -14
- package/ui/page/page-common.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.d.ts +2 -1
- package/ui/search-bar/index.android.js +64 -53
- package/ui/search-bar/index.android.js.map +1 -1
- package/ui/search-bar/index.d.ts +7 -0
- package/ui/search-bar/index.ios.d.ts +2 -1
- package/ui/search-bar/index.ios.js +14 -7
- package/ui/search-bar/index.ios.js.map +1 -1
- package/ui/search-bar/search-bar-common.d.ts +2 -0
- package/ui/search-bar/search-bar-common.js +7 -0
- package/ui/search-bar/search-bar-common.js.map +1 -1
- package/ui/segmented-bar/index.android.js +52 -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 +22 -25
- package/ui/slider/index.android.js.map +1 -1
- package/ui/slider/index.d.ts +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/background-common.d.ts +4 -4
- package/ui/styling/background-common.js +8 -8
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.d.ts +0 -3
- package/ui/styling/background.ios.d.ts +2 -1
- package/ui/styling/background.ios.js +47 -38
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/css-stroke.js.map +1 -1
- package/ui/styling/css-utils.d.ts +1 -0
- package/ui/styling/css-utils.js +15 -4
- package/ui/styling/css-utils.js.map +1 -1
- package/ui/styling/style/index.d.ts +3 -1
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-properties.d.ts +1 -0
- package/ui/styling/style-properties.js +30 -11
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/switch/index.android.js +16 -18
- package/ui/switch/index.android.js.map +1 -1
- package/ui/switch/index.ios.d.ts +1 -1
- package/ui/switch/index.ios.js +62 -25
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/tab-view/index.android.js +185 -187
- 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 +13 -5
- package/ui/tab-view/index.ios.js +255 -57
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/tab-view/tab-view-common.d.ts +14 -0
- package/ui/tab-view/tab-view-common.js +15 -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 +134 -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.android.js +3 -0
- package/ui/text-field/index.android.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 +19 -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 +18 -13
- 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/common.d.ts +3 -1
- package/utils/common.js +9 -3
- package/utils/common.js.map +1 -1
- package/utils/constants.android.d.ts +1 -0
- package/utils/constants.android.js +3 -0
- package/utils/constants.android.js.map +1 -1
- package/utils/constants.d.ts +1 -0
- package/utils/constants.ios.d.ts +1 -0
- package/utils/constants.ios.js +3 -0
- package/utils/constants.ios.js.map +1 -1
- package/utils/index.d.ts +6 -0
- 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-for-android.d.ts +22 -0
- package/utils/native-helper-for-android.js +103 -0
- package/utils/native-helper-for-android.js.map +1 -1
- package/utils/native-helper.android.d.ts +9 -1
- package/utils/native-helper.android.js +5 -1
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.d.ts +30 -0
- package/utils/native-helper.ios.js +20 -20
- package/utils/native-helper.ios.js.map +1 -1
- package/cli-hooks/postinstall.js +0 -2
- package/cli-hooks/preuninstall.js +0 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ListViewBase, separatorColorProperty, itemTemplatesProperty, stickyHeaderProperty, stickyHeaderTemplateProperty, sectionedProperty, showSearchProperty } from './list-view-common';
|
|
2
2
|
import { View } from '../core/view';
|
|
3
|
+
import { PercentLength } from '../styling/length-shared';
|
|
3
4
|
import { unsetValue } from '../core/properties/property-shared';
|
|
4
5
|
import { Color } from '../../color';
|
|
5
6
|
import { Observable } from '../../data/observable';
|
|
@@ -7,6 +8,7 @@ import { StackLayout } from '../layouts/stack-layout';
|
|
|
7
8
|
import { ProxyViewContainer } from '../proxy-view-container';
|
|
8
9
|
import { LayoutBase } from '../layouts/layout-base';
|
|
9
10
|
import { profile } from '../../profiling';
|
|
11
|
+
import { Trace } from '../../trace';
|
|
10
12
|
import { Builder } from '../builder';
|
|
11
13
|
import { Label } from '../label';
|
|
12
14
|
export * from './list-view-common';
|
|
@@ -14,6 +16,8 @@ const ITEMLOADING = ListViewBase.itemLoadingEvent;
|
|
|
14
16
|
const LOADMOREITEMS = ListViewBase.loadMoreItemsEvent;
|
|
15
17
|
const ITEMTAP = ListViewBase.itemTapEvent;
|
|
16
18
|
const SEARCHCHANGE = ListViewBase.searchChangeEvent;
|
|
19
|
+
const STICKY_HEADER_Z_INDEX = 1000;
|
|
20
|
+
const SEARCH_VIEW_Z_INDEX = 2000;
|
|
17
21
|
// View type constants for sectioned lists
|
|
18
22
|
const ITEM_VIEW_TYPE = 0;
|
|
19
23
|
let ItemClickListener;
|
|
@@ -21,30 +25,28 @@ function initializeItemClickListener() {
|
|
|
21
25
|
if (ItemClickListener) {
|
|
22
26
|
return;
|
|
23
27
|
}
|
|
24
|
-
var ItemClickListenerImpl =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return ItemClickListenerImpl;
|
|
47
|
-
}(java.lang.Object));
|
|
28
|
+
var ItemClickListenerImpl = (function (_super) {
|
|
29
|
+
__extends(ItemClickListenerImpl, _super);
|
|
30
|
+
function ItemClickListenerImpl(owner) {
|
|
31
|
+
var _this = _super.call(this) || this;
|
|
32
|
+
_this.owner = owner;
|
|
33
|
+
return global.__native(_this);
|
|
34
|
+
}
|
|
35
|
+
ItemClickListenerImpl.prototype.onItemClick = function (parent, convertView, index, id) {
|
|
36
|
+
var owner = this.owner;
|
|
37
|
+
var view = owner._realizedItems.get(convertView).view;
|
|
38
|
+
owner.notify({
|
|
39
|
+
eventName: ITEMTAP,
|
|
40
|
+
object: owner,
|
|
41
|
+
index: index,
|
|
42
|
+
view: view,
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
ItemClickListenerImpl = __decorate([
|
|
46
|
+
Interfaces([android.widget.AdapterView.OnItemClickListener])
|
|
47
|
+
], ItemClickListenerImpl);
|
|
48
|
+
return ItemClickListenerImpl;
|
|
49
|
+
}(java.lang.Object));
|
|
48
50
|
ItemClickListener = ItemClickListenerImpl;
|
|
49
51
|
}
|
|
50
52
|
export class ListView extends ListViewBase {
|
|
@@ -197,7 +199,9 @@ export class ListView extends ListViewBase {
|
|
|
197
199
|
adapter.notifyDataSetChanged();
|
|
198
200
|
}
|
|
199
201
|
catch (error) {
|
|
200
|
-
|
|
202
|
+
if (Trace.isEnabled()) {
|
|
203
|
+
Trace.error('Error refreshing adapter, recreating: ' + error);
|
|
204
|
+
}
|
|
201
205
|
nativeView.setAdapter(new ListViewAdapterClass(this));
|
|
202
206
|
}
|
|
203
207
|
}
|
|
@@ -328,7 +332,7 @@ export class ListView extends ListViewBase {
|
|
|
328
332
|
this._stickyHeaderView.marginTop = 0; // Reset any previous margin
|
|
329
333
|
// Position sticky header with proper offset using native positioning
|
|
330
334
|
if (this._stickyHeaderView.nativeViewProtected) {
|
|
331
|
-
this._stickyHeaderView.nativeViewProtected.setZ(
|
|
335
|
+
this._stickyHeaderView.nativeViewProtected.setZ(STICKY_HEADER_Z_INDEX);
|
|
332
336
|
// Use a timeout to ensure search view is measured first
|
|
333
337
|
setTimeout(() => {
|
|
334
338
|
if (this._searchView && this._searchView._wrapper) {
|
|
@@ -347,7 +351,7 @@ export class ListView extends ListViewBase {
|
|
|
347
351
|
else {
|
|
348
352
|
// No search view - position at top
|
|
349
353
|
if (this._stickyHeaderView.nativeViewProtected) {
|
|
350
|
-
this._stickyHeaderView.nativeViewProtected.setZ(
|
|
354
|
+
this._stickyHeaderView.nativeViewProtected.setZ(STICKY_HEADER_Z_INDEX);
|
|
351
355
|
this._stickyHeaderView.nativeViewProtected.setTranslationY(0);
|
|
352
356
|
}
|
|
353
357
|
}
|
|
@@ -374,29 +378,33 @@ export class ListView extends ListViewBase {
|
|
|
374
378
|
this._stickyHeaderHeight = defaultHeaderHeight;
|
|
375
379
|
// Request layout to ensure proper measurement
|
|
376
380
|
this._stickyHeaderView.requestLayout();
|
|
377
|
-
// Then measure and adjust padding if needed
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
381
|
+
// Then measure and adjust padding if needed using a layout listener for determinism
|
|
382
|
+
const stickyHeaderNativeView = this._stickyHeaderView && this._stickyHeaderView.nativeViewProtected;
|
|
383
|
+
if (stickyHeaderNativeView) {
|
|
384
|
+
const layoutListener = new android.view.View.OnLayoutChangeListener({
|
|
385
|
+
onLayoutChange: (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) => {
|
|
386
|
+
if (v.getMeasuredHeight() > 0) {
|
|
387
|
+
const measuredHeaderHeight = v.getMeasuredHeight();
|
|
388
|
+
let finalSearchHeight = searchViewHeight;
|
|
389
|
+
// Re-measure search view if needed
|
|
390
|
+
if (this.showSearch && this._searchView && this._searchView._wrapper) {
|
|
391
|
+
const searchWrapper = this._searchView._wrapper;
|
|
392
|
+
if (searchWrapper.nativeViewProtected && searchWrapper.nativeViewProtected.getMeasuredHeight() > 0) {
|
|
393
|
+
finalSearchHeight = searchWrapper.nativeViewProtected.getMeasuredHeight();
|
|
394
|
+
}
|
|
390
395
|
}
|
|
396
|
+
// Calculate final padding: search height + sticky header height + small buffer
|
|
397
|
+
const totalPaddingHeight = finalSearchHeight + measuredHeaderHeight + 4;
|
|
398
|
+
this._stickyHeaderHeight = measuredHeaderHeight;
|
|
399
|
+
this.nativeViewProtected.setPadding(0, totalPaddingHeight, 0, 0);
|
|
400
|
+
this.scrollToIndex(0);
|
|
401
|
+
// Remove the listener after first valid layout
|
|
402
|
+
v.removeOnLayoutChangeListener(layoutListener);
|
|
391
403
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
this.scrollToIndex(0);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
}, 150); // Slightly longer delay for more reliable measurement after positioning
|
|
404
|
+
},
|
|
405
|
+
});
|
|
406
|
+
stickyHeaderNativeView.addOnLayoutChangeListener(layoutListener);
|
|
407
|
+
}
|
|
400
408
|
}
|
|
401
409
|
_setupScrollListener() {
|
|
402
410
|
if (this._scrollListener) {
|
|
@@ -427,7 +435,8 @@ export class ListView extends ListViewBase {
|
|
|
427
435
|
const sectionCount = this._getSectionCount();
|
|
428
436
|
for (let section = 0; section < sectionCount; section++) {
|
|
429
437
|
// Check if firstVisibleItem is in this section (header or items)
|
|
430
|
-
const
|
|
438
|
+
const sectionItems = this._getItemsInSection(section) || [];
|
|
439
|
+
const itemsInSection = sectionItems.length || 0;
|
|
431
440
|
const sectionEndPosition = currentPosition + 1 + itemsInSection; // +1 for header
|
|
432
441
|
if (firstVisibleItem < sectionEndPosition) {
|
|
433
442
|
return section;
|
|
@@ -624,7 +633,7 @@ export class ListView extends ListViewBase {
|
|
|
624
633
|
}
|
|
625
634
|
// Ensure search view appears above everything else
|
|
626
635
|
if (searchViewWrapper.nativeViewProtected) {
|
|
627
|
-
searchViewWrapper.nativeViewProtected.setZ(
|
|
636
|
+
searchViewWrapper.nativeViewProtected.setZ(SEARCH_VIEW_Z_INDEX);
|
|
628
637
|
}
|
|
629
638
|
// Store reference for cleanup
|
|
630
639
|
this._searchView._wrapper = searchViewWrapper;
|
|
@@ -699,301 +708,291 @@ function ensureListViewAdapterClass() {
|
|
|
699
708
|
if (ListViewAdapterClass) {
|
|
700
709
|
return;
|
|
701
710
|
}
|
|
702
|
-
var ListViewAdapter =
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
}
|
|
709
|
-
ListViewAdapter.prototype.getCount = function () {
|
|
710
|
-
if (!this.owner || !this.owner.items) {
|
|
711
|
-
return 0;
|
|
711
|
+
var ListViewAdapter = (function (_super) {
|
|
712
|
+
__extends(ListViewAdapter, _super);
|
|
713
|
+
function ListViewAdapter(owner) {
|
|
714
|
+
var _this = _super.call(this) || this;
|
|
715
|
+
_this.owner = owner;
|
|
716
|
+
return global.__native(_this);
|
|
712
717
|
}
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
var
|
|
718
|
-
|
|
719
|
-
var
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
718
|
+
ListViewAdapter.prototype.getCount = function () {
|
|
719
|
+
if (!this.owner) {
|
|
720
|
+
return 0;
|
|
721
|
+
}
|
|
722
|
+
var count = 0;
|
|
723
|
+
if (this.owner.sectioned) {
|
|
724
|
+
var sectionCount = this.owner._getSectionCount();
|
|
725
|
+
if (!this.owner.items || sectionCount <= 0) {
|
|
726
|
+
return 0;
|
|
727
|
+
}
|
|
728
|
+
for (var i = 0; i < sectionCount; i++) {
|
|
729
|
+
var itemsInSection = this.owner._getItemsInSection(i) || [];
|
|
730
|
+
if (itemsInSection.length > 0) {
|
|
731
|
+
count += 1;
|
|
732
|
+
count += itemsInSection.length;
|
|
733
|
+
}
|
|
724
734
|
}
|
|
725
735
|
}
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
736
|
+
else {
|
|
737
|
+
var src = this.owner.items;
|
|
738
|
+
count = src && typeof src.length === "number" ? src.length : 0;
|
|
739
|
+
}
|
|
740
|
+
return Math.max(0, count);
|
|
741
|
+
};
|
|
742
|
+
ListViewAdapter.prototype.getItem = function (i) {
|
|
743
|
+
if (!this.owner || !this.owner.items) {
|
|
744
|
+
return null;
|
|
745
|
+
}
|
|
746
|
+
var totalCount = this.getCount();
|
|
747
|
+
if (i < 0 || i >= totalCount) {
|
|
748
|
+
return null;
|
|
749
|
+
}
|
|
750
|
+
if (this.owner.sectioned) {
|
|
751
|
+
var positionInfo = this._getPositionInfo(i);
|
|
752
|
+
if (positionInfo.isHeader) {
|
|
753
|
+
return this.owner._getSectionData(positionInfo.section);
|
|
754
|
+
}
|
|
755
|
+
else {
|
|
756
|
+
return this.owner._getDataItemInSection(positionInfo.section, positionInfo.itemIndex);
|
|
757
|
+
}
|
|
746
758
|
}
|
|
747
759
|
else {
|
|
748
|
-
|
|
760
|
+
var src = this.owner.items;
|
|
761
|
+
if (src && typeof src.length === "number" && i < src.length) {
|
|
762
|
+
var getItem = src.getItem;
|
|
763
|
+
return getItem ? getItem.call(src, i) : src[i];
|
|
764
|
+
}
|
|
749
765
|
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
return
|
|
766
|
+
return null;
|
|
767
|
+
};
|
|
768
|
+
ListViewAdapter.prototype._getPositionInfo = function (position) {
|
|
769
|
+
if (!this.owner.sectioned) {
|
|
770
|
+
return { isHeader: false, section: 0, itemIndex: position };
|
|
755
771
|
}
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
if (
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
return
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
// Add 1 for header view type when sectioned
|
|
815
|
-
if (this.owner.sectioned && this.owner.stickyHeaderTemplate) {
|
|
816
|
-
count += 1;
|
|
817
|
-
}
|
|
818
|
-
return count;
|
|
819
|
-
};
|
|
820
|
-
ListViewAdapter.prototype.getItemViewType = function (index) {
|
|
821
|
-
if (this.owner.sectioned) {
|
|
822
|
-
var positionInfo = this._getPositionInfo(index);
|
|
823
|
-
if (positionInfo.isHeader) {
|
|
824
|
-
// Header view type is the last index (after all item template types)
|
|
825
|
-
return this.owner._itemTemplatesInternal.length;
|
|
772
|
+
var currentPosition = 0;
|
|
773
|
+
var sectionCount = this.owner._getSectionCount();
|
|
774
|
+
for (var section = 0; section < sectionCount; section++) {
|
|
775
|
+
var itemsInSection = this.owner._getItemsInSection(section) || [];
|
|
776
|
+
if (itemsInSection.length === 0) {
|
|
777
|
+
continue;
|
|
778
|
+
}
|
|
779
|
+
if (currentPosition === position) {
|
|
780
|
+
return { isHeader: true, section: section, itemIndex: -1 };
|
|
781
|
+
}
|
|
782
|
+
currentPosition++;
|
|
783
|
+
if (position < currentPosition + itemsInSection.length) {
|
|
784
|
+
var itemIndex = position - currentPosition;
|
|
785
|
+
return { isHeader: false, section: section, itemIndex: itemIndex };
|
|
786
|
+
}
|
|
787
|
+
currentPosition += itemsInSection.length;
|
|
788
|
+
}
|
|
789
|
+
return { isHeader: false, section: 0, itemIndex: 0 };
|
|
790
|
+
};
|
|
791
|
+
ListViewAdapter.prototype.getItemId = function (i) {
|
|
792
|
+
var item = this.getItem(i);
|
|
793
|
+
var id = i;
|
|
794
|
+
if (this.owner && item && this.owner.items) {
|
|
795
|
+
id = this.owner.itemIdGenerator(item, i, this.owner.items);
|
|
796
|
+
}
|
|
797
|
+
return long(id);
|
|
798
|
+
};
|
|
799
|
+
ListViewAdapter.prototype.hasStableIds = function () {
|
|
800
|
+
return true;
|
|
801
|
+
};
|
|
802
|
+
ListViewAdapter.prototype.isEnabled = function (position) {
|
|
803
|
+
var totalCount = this.getCount();
|
|
804
|
+
if (totalCount === 0 || position < 0 || position >= totalCount) {
|
|
805
|
+
return false;
|
|
806
|
+
}
|
|
807
|
+
if (this.owner.sectioned) {
|
|
808
|
+
var positionInfo = this._getPositionInfo(position);
|
|
809
|
+
return !positionInfo.isHeader;
|
|
810
|
+
}
|
|
811
|
+
return true;
|
|
812
|
+
};
|
|
813
|
+
ListViewAdapter.prototype.getViewTypeCount = function () {
|
|
814
|
+
var count = this.owner._itemTemplatesInternal.length;
|
|
815
|
+
if (this.owner.sectioned && this.owner.stickyHeaderTemplate) {
|
|
816
|
+
count += 1;
|
|
817
|
+
}
|
|
818
|
+
return count;
|
|
819
|
+
};
|
|
820
|
+
ListViewAdapter.prototype.getItemViewType = function (index) {
|
|
821
|
+
if (this.owner.sectioned) {
|
|
822
|
+
var positionInfo = this._getPositionInfo(index);
|
|
823
|
+
if (positionInfo.isHeader) {
|
|
824
|
+
return this.owner._itemTemplatesInternal.length;
|
|
825
|
+
}
|
|
826
|
+
else {
|
|
827
|
+
var template = this.owner._getItemTemplate(positionInfo.itemIndex);
|
|
828
|
+
return this.owner._itemTemplatesInternal.indexOf(template);
|
|
829
|
+
}
|
|
826
830
|
}
|
|
827
831
|
else {
|
|
828
|
-
|
|
829
|
-
var template = this.owner._getItemTemplate(positionInfo.itemIndex);
|
|
832
|
+
var template = this.owner._getItemTemplate(index);
|
|
830
833
|
return this.owner._itemTemplatesInternal.indexOf(template);
|
|
831
834
|
}
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
835
|
+
};
|
|
836
|
+
ListViewAdapter.prototype.getView = function (index, convertView, parent) {
|
|
837
|
+
if (!this.owner) {
|
|
838
|
+
return null;
|
|
839
|
+
}
|
|
840
|
+
var totalCount = this.getCount();
|
|
841
|
+
if (index < 0 || index >= totalCount) {
|
|
842
|
+
var emptyView = new android.view.View(this.owner._context);
|
|
843
|
+
var layoutParams = new android.view.ViewGroup.LayoutParams(android.view.ViewGroup.LayoutParams.MATCH_PARENT, 0);
|
|
844
|
+
emptyView.setLayoutParams(layoutParams);
|
|
845
|
+
return emptyView;
|
|
846
|
+
}
|
|
847
|
+
if (index === totalCount - 1) {
|
|
848
|
+
this.owner.notify({
|
|
849
|
+
eventName: LOADMOREITEMS,
|
|
850
|
+
object: this.owner,
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
if (this.owner.sectioned) {
|
|
854
|
+
var positionInfo = this._getPositionInfo(index);
|
|
855
|
+
if (positionInfo.isHeader) {
|
|
856
|
+
return this._createHeaderView(positionInfo.section, convertView, parent, index);
|
|
857
|
+
}
|
|
858
|
+
else {
|
|
859
|
+
return this._createItemView(positionInfo.section, positionInfo.itemIndex, convertView, parent);
|
|
860
|
+
}
|
|
857
861
|
}
|
|
858
862
|
else {
|
|
859
|
-
|
|
860
|
-
return this._createItemView(positionInfo.section, positionInfo.itemIndex, convertView, parent);
|
|
863
|
+
return this._createItemView(0, index, convertView, parent);
|
|
861
864
|
}
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
}
|
|
877
|
-
var headerView = null;
|
|
878
|
-
var headerViewType = this.owner._itemTemplatesInternal.length; // Same as getItemViewType for headers
|
|
879
|
-
// Try to reuse convertView if it's the right type
|
|
880
|
-
if (convertView) {
|
|
881
|
-
var existingData = this.owner._realizedItems.get(convertView);
|
|
882
|
-
if (existingData && existingData.templateKey === "header_".concat(headerViewType)) {
|
|
883
|
-
headerView = existingData.view;
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
// Create new header view if we can't reuse
|
|
887
|
-
if (!headerView) {
|
|
888
|
-
if (this.owner.stickyHeaderTemplate) {
|
|
889
|
-
if (typeof this.owner.stickyHeaderTemplate === 'string') {
|
|
890
|
-
try {
|
|
891
|
-
headerView = Builder.parse(this.owner.stickyHeaderTemplate, this.owner);
|
|
892
|
-
}
|
|
893
|
-
catch (error) {
|
|
894
|
-
// Fallback to simple label
|
|
895
|
-
headerView = new Label();
|
|
896
|
-
headerView.text = 'Header Error';
|
|
897
|
-
}
|
|
865
|
+
};
|
|
866
|
+
ListViewAdapter.prototype._createHeaderView = function (section, convertView, parent, index) {
|
|
867
|
+
if (this.owner._hiddenHeaderPositions.has(index)) {
|
|
868
|
+
var emptyView = new android.view.View(this.owner._context);
|
|
869
|
+
var layoutParams = new android.view.ViewGroup.LayoutParams(android.view.ViewGroup.LayoutParams.MATCH_PARENT, 0);
|
|
870
|
+
emptyView.setLayoutParams(layoutParams);
|
|
871
|
+
return emptyView;
|
|
872
|
+
}
|
|
873
|
+
var headerView = null;
|
|
874
|
+
var headerViewType = this.owner._itemTemplatesInternal.length;
|
|
875
|
+
if (convertView) {
|
|
876
|
+
var existingData = this.owner._realizedItems.get(convertView);
|
|
877
|
+
if (existingData && existingData.templateKey === "header_".concat(headerViewType)) {
|
|
878
|
+
headerView = existingData.view;
|
|
898
879
|
}
|
|
899
880
|
}
|
|
900
881
|
if (!headerView) {
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
882
|
+
if (this.owner.stickyHeaderTemplate) {
|
|
883
|
+
if (typeof this.owner.stickyHeaderTemplate === "string") {
|
|
884
|
+
try {
|
|
885
|
+
headerView = Builder.parse(this.owner.stickyHeaderTemplate, this.owner);
|
|
886
|
+
}
|
|
887
|
+
catch (error) {
|
|
888
|
+
headerView = new Label();
|
|
889
|
+
headerView.text = "Header Error";
|
|
890
|
+
}
|
|
891
|
+
}
|
|
910
892
|
}
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
893
|
+
if (!headerView) {
|
|
894
|
+
headerView = new Label();
|
|
895
|
+
headerView.text = "Section ".concat(section);
|
|
896
|
+
}
|
|
897
|
+
if (!headerView.parent) {
|
|
898
|
+
if (headerView instanceof LayoutBase && !(headerView instanceof ProxyViewContainer)) {
|
|
899
|
+
this.owner._addView(headerView);
|
|
900
|
+
convertView = headerView.nativeViewProtected;
|
|
901
|
+
}
|
|
902
|
+
else {
|
|
903
|
+
var sp = new StackLayout();
|
|
904
|
+
sp.addChild(headerView);
|
|
905
|
+
this.owner._addView(sp);
|
|
906
|
+
convertView = sp.nativeViewProtected;
|
|
907
|
+
}
|
|
916
908
|
}
|
|
909
|
+
this.owner._realizedItems.set(convertView, {
|
|
910
|
+
view: headerView,
|
|
911
|
+
templateKey: "header_".concat(headerViewType),
|
|
912
|
+
});
|
|
917
913
|
}
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
templateKey: "header_".concat(headerViewType),
|
|
922
|
-
});
|
|
923
|
-
}
|
|
924
|
-
// Set binding context to section data (always update, even for recycled views)
|
|
925
|
-
var sectionData = this.owner._getSectionData(section);
|
|
926
|
-
if (sectionData) {
|
|
927
|
-
headerView.bindingContext = sectionData;
|
|
928
|
-
}
|
|
929
|
-
else {
|
|
930
|
-
headerView.bindingContext = { title: "Section ".concat(section), section: section };
|
|
931
|
-
}
|
|
932
|
-
return convertView;
|
|
933
|
-
};
|
|
934
|
-
ListViewAdapter.prototype._createItemView = function (section, itemIndex, convertView, parent) {
|
|
935
|
-
// Use existing item creation logic but with sectioned data
|
|
936
|
-
var template = this.owner._getItemTemplate(itemIndex);
|
|
937
|
-
var view;
|
|
938
|
-
// convertView is of the wrong type
|
|
939
|
-
if (convertView && this.owner._getKeyFromView(convertView) !== template.key) {
|
|
940
|
-
this.owner._markViewUnused(convertView); // release this view
|
|
941
|
-
convertView = this.owner._getAvailableView(template.key); // get a view from the right type or null
|
|
942
|
-
}
|
|
943
|
-
if (convertView) {
|
|
944
|
-
view = this.owner._realizedItems.get(convertView).view;
|
|
945
|
-
}
|
|
946
|
-
if (!view) {
|
|
947
|
-
view = template.createView();
|
|
948
|
-
}
|
|
949
|
-
var args = {
|
|
950
|
-
eventName: ITEMLOADING,
|
|
951
|
-
object: this.owner,
|
|
952
|
-
index: itemIndex,
|
|
953
|
-
view: view,
|
|
954
|
-
android: parent,
|
|
955
|
-
ios: undefined,
|
|
956
|
-
};
|
|
957
|
-
this.owner.notify(args);
|
|
958
|
-
if (!args.view) {
|
|
959
|
-
args.view = this.owner._getDefaultItemContent(itemIndex);
|
|
960
|
-
}
|
|
961
|
-
if (args.view) {
|
|
962
|
-
if (this.owner._effectiveRowHeight > -1) {
|
|
963
|
-
args.view.height = this.owner.rowHeight;
|
|
914
|
+
var sectionData = this.owner._getSectionData(section);
|
|
915
|
+
if (sectionData) {
|
|
916
|
+
headerView.bindingContext = sectionData;
|
|
964
917
|
}
|
|
965
918
|
else {
|
|
966
|
-
|
|
919
|
+
headerView.bindingContext = { title: "Section ".concat(section), section: section };
|
|
967
920
|
}
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
921
|
+
return convertView;
|
|
922
|
+
};
|
|
923
|
+
ListViewAdapter.prototype._createItemView = function (section, itemIndex, convertView, parent) {
|
|
924
|
+
var template = this.owner._getItemTemplate(itemIndex);
|
|
925
|
+
var view;
|
|
926
|
+
if (convertView && this.owner._getKeyFromView(convertView) !== template.key) {
|
|
927
|
+
this.owner._markViewUnused(convertView);
|
|
928
|
+
convertView = this.owner._getAvailableView(template.key);
|
|
929
|
+
}
|
|
930
|
+
if (convertView) {
|
|
931
|
+
view = this.owner._realizedItems.get(convertView).view;
|
|
932
|
+
}
|
|
933
|
+
if (!view) {
|
|
934
|
+
view = template.createView();
|
|
935
|
+
}
|
|
936
|
+
var args = {
|
|
937
|
+
eventName: ITEMLOADING,
|
|
938
|
+
object: this.owner,
|
|
939
|
+
index: itemIndex,
|
|
940
|
+
view: view,
|
|
941
|
+
android: parent,
|
|
942
|
+
ios: undefined,
|
|
943
|
+
};
|
|
944
|
+
this.owner.notify(args);
|
|
945
|
+
if (!args.view) {
|
|
946
|
+
args.view = this.owner._getDefaultItemContent(itemIndex);
|
|
947
|
+
}
|
|
948
|
+
if (args.view) {
|
|
949
|
+
if (this.owner._effectiveRowHeight > -1) {
|
|
950
|
+
args.view.height = this.owner.rowHeight;
|
|
951
|
+
}
|
|
952
|
+
else {
|
|
953
|
+
args.view.height = unsetValue;
|
|
954
|
+
}
|
|
955
|
+
if (this.owner.sectioned) {
|
|
956
|
+
this.owner._prepareItemInSection(args.view, section, itemIndex);
|
|
957
|
+
}
|
|
958
|
+
else {
|
|
959
|
+
this.owner._prepareItem(args.view, itemIndex);
|
|
960
|
+
}
|
|
961
|
+
if (!args.view.parent) {
|
|
962
|
+
if (args.view instanceof LayoutBase && !(args.view instanceof ProxyViewContainer)) {
|
|
963
|
+
var mt = PercentLength.toDevicePixels(args.view.marginTop, 0, Number.NaN);
|
|
964
|
+
var mb = PercentLength.toDevicePixels(args.view.marginBottom, 0, Number.NaN);
|
|
965
|
+
var ml = PercentLength.toDevicePixels(args.view.marginLeft, 0, Number.NaN);
|
|
966
|
+
var mr = PercentLength.toDevicePixels(args.view.marginRight, 0, Number.NaN);
|
|
967
|
+
var hasMargins = mt > 0 || mb > 0 || ml > 0 || mr > 0;
|
|
968
|
+
if (hasMargins) {
|
|
969
|
+
var outer = new StackLayout();
|
|
970
|
+
outer.addChild(args.view);
|
|
971
|
+
this.owner._addView(outer);
|
|
972
|
+
convertView = outer.nativeViewProtected;
|
|
973
|
+
}
|
|
974
|
+
else {
|
|
975
|
+
this.owner._addView(args.view);
|
|
976
|
+
convertView = args.view.nativeViewProtected;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
else {
|
|
980
|
+
var sp = new StackLayout();
|
|
981
|
+
sp.addChild(args.view);
|
|
982
|
+
this.owner._addView(sp);
|
|
983
|
+
convertView = sp.nativeViewProtected;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
this.owner._registerViewToTemplate(template.key, convertView, args.view);
|
|
987
|
+
this.owner._markViewUsed(convertView);
|
|
971
988
|
}
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
container.addChild(args.view);
|
|
980
|
-
this.owner._addView(container);
|
|
981
|
-
convertView = container.nativeViewProtected;
|
|
982
|
-
}
|
|
983
|
-
this.owner._registerViewToTemplate(template.key, convertView, args.view);
|
|
984
|
-
this.owner._markViewUsed(convertView);
|
|
985
|
-
}
|
|
986
|
-
return convertView;
|
|
987
|
-
};
|
|
988
|
-
var _a, _b, _c, _d, _e, _f;
|
|
989
|
-
__decorate([
|
|
990
|
-
profile,
|
|
991
|
-
__metadata("design:type", Function),
|
|
992
|
-
__metadata("design:paramtypes", [Number, typeof (_b = typeof android !== "undefined" && (_a = android.view) !== void 0 && _a.View) === "function" ? _b : Object, typeof (_d = typeof android !== "undefined" && (_c = android.view) !== void 0 && _c.ViewGroup) === "function" ? _d : Object]),
|
|
993
|
-
__metadata("design:returntype", typeof (_f = typeof android !== "undefined" && (_e = android.view) !== void 0 && _e.View) === "function" ? _f : Object)
|
|
994
|
-
], ListViewAdapter.prototype, "getView", null);
|
|
995
|
-
return ListViewAdapter;
|
|
996
|
-
}(android.widget.BaseAdapter));
|
|
989
|
+
return convertView;
|
|
990
|
+
};
|
|
991
|
+
__decorate([
|
|
992
|
+
profile
|
|
993
|
+
], ListViewAdapter.prototype, "getView", null);
|
|
994
|
+
return ListViewAdapter;
|
|
995
|
+
}(android.widget.BaseAdapter));
|
|
997
996
|
ListViewAdapterClass = ListViewAdapter;
|
|
998
997
|
}
|
|
999
998
|
//# sourceMappingURL=index.android.js.map
|