feat:slider and flowlayout add reload api

This commit is contained in:
pengfei.zhou
2022-08-16 17:57:51 +08:00
committed by osborn
parent 3de2162ef6
commit cce4148240
19 changed files with 262 additions and 22 deletions

View File

@@ -100,6 +100,14 @@ export class FlowLayout extends Superview {
return this.nativeChannel(context, 'findCompletelyVisibleItems')() as Promise<number[]>
}
/**
* Reload all list items.
* @param context
* @returns
*/
reload(context: BridgeContext) {
return this.nativeChannel(context, 'reload')() as Promise<void>
}
reset() {
this.cachedViews.clear()

View File

@@ -112,15 +112,20 @@ export class List extends Superview {
return this.nativeChannel(context, 'findCompletelyVisibleItems')() as Promise<number[]>
}
/**
* Reload all list items.
* @param context
* @returns
*/
reload(context: BridgeContext) {
return this.nativeChannel(context, 'reload')() as Promise<void>
}
reset() {
this.cachedViews.clear()
this.itemCount = 0
}
reload(context: BridgeContext) {
return this.nativeChannel(context, 'reload')() as Promise<void>
}
private getItem(itemIdx: number) {
let view = this.renderItem(itemIdx)
view.superview = this

View File

@@ -63,6 +63,20 @@ export class Slider extends Superview {
@Property
slideStyle?: "zoomOut" | { type: "zoomOut", minScale: number, maxScale: number }
/**
* Reload all list items.
* @param context
* @returns
*/
reload(context: BridgeContext) {
return this.nativeChannel(context, 'reload')() as Promise<void>
}
reset() {
this.cachedViews.clear()
this.itemCount = 0
}
private getItem(itemIdx: number) {
let view = this.renderPage(itemIdx)
view.superview = this