flowlayout add header and footer:js and android implement
This commit is contained in:
4
doric-js/lib/src/widget/flowlayout.d.ts
vendored
4
doric-js/lib/src/widget/flowlayout.d.ts
vendored
@@ -8,7 +8,7 @@ export declare class FlowLayoutItem extends Stack {
|
||||
}
|
||||
export declare class FlowLayout extends Superview {
|
||||
private cachedViews;
|
||||
allSubviews(): IterableIterator<FlowLayoutItem> | FlowLayoutItem[];
|
||||
allSubviews(): FlowLayoutItem[];
|
||||
columnCount: number;
|
||||
columnSpace?: number;
|
||||
rowSpace?: number;
|
||||
@@ -31,6 +31,8 @@ export declare class FlowLayout extends Superview {
|
||||
* Take effect only on iOS
|
||||
*/
|
||||
bounces?: boolean;
|
||||
header?: FlowLayoutItem;
|
||||
footer?: FlowLayoutItem;
|
||||
reset(): void;
|
||||
private getItem;
|
||||
private renderBunchedItems;
|
||||
|
@@ -40,12 +40,17 @@ export class FlowLayout extends Superview {
|
||||
this.batchCount = 15;
|
||||
}
|
||||
allSubviews() {
|
||||
const ret = [...this.cachedViews.values()];
|
||||
if (this.loadMoreView) {
|
||||
return [...this.cachedViews.values(), this.loadMoreView];
|
||||
ret.push(this.loadMoreView);
|
||||
}
|
||||
else {
|
||||
return this.cachedViews.values();
|
||||
if (this.header) {
|
||||
ret.push(this.header);
|
||||
}
|
||||
if (this.footer) {
|
||||
ret.push(this.footer);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
reset() {
|
||||
this.cachedViews.clear();
|
||||
@@ -67,6 +72,12 @@ export class FlowLayout extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId;
|
||||
}
|
||||
if (this.header) {
|
||||
this.dirtyProps['header'] = this.header.viewId;
|
||||
}
|
||||
if (this.footer) {
|
||||
this.dirtyProps['footer'] = this.footer.viewId;
|
||||
}
|
||||
return super.toModel();
|
||||
}
|
||||
}
|
||||
@@ -122,6 +133,14 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Boolean)
|
||||
], FlowLayout.prototype, "bounces", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", FlowLayoutItem)
|
||||
], FlowLayout.prototype, "header", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", FlowLayoutItem)
|
||||
], FlowLayout.prototype, "footer", void 0);
|
||||
export function flowlayout(config) {
|
||||
const ret = new FlowLayout;
|
||||
for (let key in config) {
|
||||
|
Reference in New Issue
Block a user