Add find visible items for list and flowlayout
This commit is contained in:
@@ -86,17 +86,18 @@ export class FlowLayout extends Superview {
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views for each column.
|
||||
* @returns Returns array of visible view's index.
|
||||
*/
|
||||
findVisibleItems(context: BridgeContext) {
|
||||
return this.nativeChannel(context, 'findVisibleItems')() as Promise<{ first: number, last: number }[]>
|
||||
return this.nativeChannel(context, 'findVisibleItems')() as Promise<number[]>
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the completely visible views for each column.
|
||||
* @returns Returns array of completely visible view's index.
|
||||
*/
|
||||
findCompletelyVisibleItems(context: BridgeContext) {
|
||||
return this.nativeChannel(context, 'findCompletelyVisibleItems')() as Promise<{ first: number, last: number }[]>
|
||||
return this.nativeChannel(context, 'findCompletelyVisibleItems')() as Promise<number[]>
|
||||
}
|
||||
|
||||
|
||||
|
@@ -35,12 +35,6 @@ export class ListItem extends Stack {
|
||||
}[]
|
||||
}
|
||||
|
||||
export enum OtherItems {
|
||||
LoadMore = -10,
|
||||
Header = -11,
|
||||
Footer = -12,
|
||||
}
|
||||
|
||||
export class List extends Superview {
|
||||
private cachedViews: Map<string, ListItem> = new Map
|
||||
|
||||
@@ -93,17 +87,17 @@ export class List extends Superview {
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views.
|
||||
* @returns Returns array of visible view's index.
|
||||
*/
|
||||
findVisibleItems(context: BridgeContext) {
|
||||
return this.nativeChannel(context, 'findVisibleItems')() as Promise<{ first: number, last: number }>
|
||||
return this.nativeChannel(context, 'findVisibleItems')() as Promise<number[]>
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the completely visible views.
|
||||
* @returns Returns array of completely visible view's index.
|
||||
*/
|
||||
findCompletelyVisibleItems(context: BridgeContext) {
|
||||
return this.nativeChannel(context, 'findCompletelyVisibleItems')() as Promise<{ first: number, last: number }>
|
||||
return this.nativeChannel(context, 'findCompletelyVisibleItems')() as Promise<number[]>
|
||||
}
|
||||
|
||||
reset() {
|
||||
|
Reference in New Issue
Block a user