feat:add onScroll and onScrollEnd for list and flowlayout

This commit is contained in:
pengfei.zhou
2020-03-11 13:41:22 +08:00
committed by osborn
parent 8db0e8e9f9
commit 7b371ca58b
16 changed files with 316 additions and 5 deletions

View File

@@ -19,6 +19,14 @@ export interface IFlowLayout extends IView {
loadMore?: boolean;
onLoadMore?: () => void;
loadMoreView?: FlowLayoutItem;
onScroll?: (offset: {
x: number;
y: number;
}) => void;
onScrollEnd?: (offset: {
x: number;
y: number;
}) => void;
}
export declare class FlowLayout extends Superview implements IFlowLayout {
private cachedViews;
@@ -33,6 +41,14 @@ export declare class FlowLayout extends Superview implements IFlowLayout {
onLoadMore?: () => void;
loadMore?: boolean;
loadMoreView?: FlowLayoutItem;
onScroll?: (offset: {
x: number;
y: number;
}) => void;
onScrollEnd?: (offset: {
x: number;
y: number;
}) => void;
reset(): void;
private getItem;
isDirty(): boolean;

View File

@@ -116,6 +116,14 @@ __decorate([
Property,
__metadata("design:type", FlowLayoutItem)
], FlowLayout.prototype, "loadMoreView", void 0);
__decorate([
Property,
__metadata("design:type", Function)
], FlowLayout.prototype, "onScroll", void 0);
__decorate([
Property,
__metadata("design:type", Function)
], FlowLayout.prototype, "onScrollEnd", void 0);
export function flowlayout(config) {
const ret = new FlowLayout;
for (let key in config) {

View File

@@ -16,6 +16,14 @@ export interface IList extends IView {
onLoadMore?: () => void;
loadMore?: boolean;
loadMoreView?: ListItem;
onScroll?: (offset: {
x: number;
y: number;
}) => void;
onScrollEnd?: (offset: {
x: number;
y: number;
}) => void;
}
export declare class List extends Superview implements IList {
private cachedViews;
@@ -27,6 +35,14 @@ export declare class List extends Superview implements IList {
onLoadMore?: () => void;
loadMore?: boolean;
loadMoreView?: ListItem;
onScroll?: (offset: {
x: number;
y: number;
}) => void;
onScrollEnd?: (offset: {
x: number;
y: number;
}) => void;
reset(): void;
private getItem;
isDirty(): boolean;

View File

@@ -106,6 +106,14 @@ __decorate([
Property,
__metadata("design:type", ListItem)
], List.prototype, "loadMoreView", void 0);
__decorate([
Property,
__metadata("design:type", Function)
], List.prototype, "onScroll", void 0);
__decorate([
Property,
__metadata("design:type", Function)
], List.prototype, "onScrollEnd", void 0);
export function list(config) {
const ret = new List;
for (let key in config) {