feat: add observeScrollingInterval in coordinator plugin
This commit is contained in:
6
doric-js/lib/src/native/coordinator.d.ts
vendored
6
doric-js/lib/src/native/coordinator.d.ts
vendored
@@ -18,4 +18,10 @@ export declare function coordinator(context: BridgeContext): {
|
||||
end: number | Color;
|
||||
};
|
||||
}) => void;
|
||||
observeScrollingInterval: (argument: {
|
||||
scrollable: Scroller | List | FlowLayout;
|
||||
observingInterval: number[];
|
||||
inclusive?: "Left" | "Right" | undefined;
|
||||
onScrolledInterval: (n: number) => void;
|
||||
}) => void;
|
||||
};
|
||||
|
@@ -29,6 +29,16 @@ export function coordinator(context) {
|
||||
context.callNative("coordinator", "verticalScrolling", argument);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
observeScrollingInterval: (argument) => {
|
||||
if (context.entity instanceof Panel) {
|
||||
const panel = context.entity;
|
||||
panel.addOnRenderFinishedCallback(() => {
|
||||
argument.scrollable = viewIdChains(argument.scrollable);
|
||||
argument.onScrolledInterval = context.function2Id(argument.onScrolledInterval);
|
||||
context.callNative("coordinator", "observeScrollingInterval", argument);
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user