From 229fc41de36ba7a7fb18f8c295a9464acd6a8feb Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 22 Apr 2020 11:37:43 +0800 Subject: [PATCH] update js api --- .../doric/src/main/java/pub/doric/shader/list/ListNode.java | 2 +- doric-js/bundle/doric-lib.es5.js | 4 ++-- doric-js/bundle/doric-lib.js | 4 ++-- doric-js/bundle/doric-vm.js | 4 ++-- doric-js/index.d.ts | 2 +- doric-js/lib/src/widget/list.d.ts | 2 +- doric-js/lib/src/widget/list.js | 4 ++-- doric-js/src/widget/list.ts | 4 ++-- doric-web/dist/index.js | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doric-android/doric/src/main/java/pub/doric/shader/list/ListNode.java b/doric-android/doric/src/main/java/pub/doric/shader/list/ListNode.java index 7a02a360..1a3fce41 100644 --- a/doric-android/doric/src/main/java/pub/doric/shader/list/ListNode.java +++ b/doric-android/doric/src/main/java/pub/doric/shader/list/ListNode.java @@ -247,7 +247,7 @@ public class ListNode extends SuperNode implements IDoricScrollabl if (params.getProperty("animated").isBoolean()) { animated = params.getProperty("animated").asBoolean().value(); } - JSNumber pos = params.getProperty("pos").asNumber(); + JSNumber pos = params.getProperty("index").asNumber(); moveToPosition(pos.toInt(), animated); } diff --git a/doric-js/bundle/doric-lib.es5.js b/doric-js/bundle/doric-lib.es5.js index d273c631..84025811 100644 --- a/doric-js/bundle/doric-lib.es5.js +++ b/doric-js/bundle/doric-lib.es5.js @@ -1889,10 +1889,10 @@ var List = /** @class */ (function (_super) { return this.cachedViews.values(); } }; - List.prototype.scrollToItem = function (context, pos, config) { + List.prototype.scrollToItem = function (context, index, config) { var _a; var animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated; - return this.nativeChannel(context, 'scrollToItem')({ pos: pos, animated: animated }); + return this.nativeChannel(context, 'scrollToItem')({ index: index, animated: animated, }); }; List.prototype.reset = function () { this.cachedViews.clear(); diff --git a/doric-js/bundle/doric-lib.js b/doric-js/bundle/doric-lib.js index 184a322b..55082bd0 100644 --- a/doric-js/bundle/doric-lib.js +++ b/doric-js/bundle/doric-lib.js @@ -1395,10 +1395,10 @@ class List extends Superview { return this.cachedViews.values(); } } - scrollToItem(context, pos, config) { + scrollToItem(context, index, config) { var _a; const animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated; - return this.nativeChannel(context, 'scrollToItem')({ pos, animated }); + return this.nativeChannel(context, 'scrollToItem')({ index, animated, }); } reset() { this.cachedViews.clear(); diff --git a/doric-js/bundle/doric-vm.js b/doric-js/bundle/doric-vm.js index 1b80cfd9..5b070c70 100644 --- a/doric-js/bundle/doric-vm.js +++ b/doric-js/bundle/doric-vm.js @@ -2854,10 +2854,10 @@ class List extends Superview { return this.cachedViews.values(); } } - scrollToItem(context, pos, config) { + scrollToItem(context, index, config) { var _a; const animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated; - return this.nativeChannel(context, 'scrollToItem')({ pos, animated }); + return this.nativeChannel(context, 'scrollToItem')({ index, animated, }); } reset() { this.cachedViews.clear(); diff --git a/doric-js/index.d.ts b/doric-js/index.d.ts index 7b2995de..af238acc 100644 --- a/doric-js/index.d.ts +++ b/doric-js/index.d.ts @@ -523,7 +523,7 @@ declare module 'doric/lib/src/widget/list' { y: number; }) => void; scrolledPosition?: number; - scrollToItem(context: BridgeContext, pos: number, config?: { + scrollToItem(context: BridgeContext, index: number, config?: { animated?: boolean; }): Promise; reset(): void; diff --git a/doric-js/lib/src/widget/list.d.ts b/doric-js/lib/src/widget/list.d.ts index 2fd3c11b..3555b4e0 100644 --- a/doric-js/lib/src/widget/list.d.ts +++ b/doric-js/lib/src/widget/list.d.ts @@ -26,7 +26,7 @@ export declare class List extends Superview { y: number; }) => void; scrolledPosition?: number; - scrollToItem(context: BridgeContext, pos: number, config?: { + scrollToItem(context: BridgeContext, index: number, config?: { animated?: boolean; }): Promise; reset(): void; diff --git a/doric-js/lib/src/widget/list.js b/doric-js/lib/src/widget/list.js index ddde6802..ce16f632 100644 --- a/doric-js/lib/src/widget/list.js +++ b/doric-js/lib/src/widget/list.js @@ -47,10 +47,10 @@ export class List extends Superview { return this.cachedViews.values(); } } - scrollToItem(context, pos, config) { + scrollToItem(context, index, config) { var _a; const animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated; - return this.nativeChannel(context, 'scrollToItem')({ pos, animated }); + return this.nativeChannel(context, 'scrollToItem')({ index, animated, }); } reset() { this.cachedViews.clear(); diff --git a/doric-js/src/widget/list.ts b/doric-js/src/widget/list.ts index dfeb6e53..f9f5f612 100644 --- a/doric-js/src/widget/list.ts +++ b/doric-js/src/widget/list.ts @@ -67,9 +67,9 @@ export class List extends Superview { @Property scrolledPosition?: number - scrollToItem(context: BridgeContext, pos: number, config?: { animated?: boolean }) { + scrollToItem(context: BridgeContext, index: number, config?: { animated?: boolean, }) { const animated = config?.animated - return this.nativeChannel(context, 'scrollToItem')({ pos, animated }) as Promise + return this.nativeChannel(context, 'scrollToItem')({ index, animated, }) as Promise } reset() { diff --git a/doric-web/dist/index.js b/doric-web/dist/index.js index 81bff147..9f326a4a 100644 --- a/doric-web/dist/index.js +++ b/doric-web/dist/index.js @@ -2912,10 +2912,10 @@ class List extends Superview { return this.cachedViews.values(); } } - scrollToItem(context, pos, config) { + scrollToItem(context, index, config) { var _a; const animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated; - return this.nativeChannel(context, 'scrollToItem')({ pos, animated }); + return this.nativeChannel(context, 'scrollToItem')({ index, animated, }); } reset() { this.cachedViews.clear();