MCPcopy Create free account
hub / github.com/callstack/agent-device / toNativeScrollView

Function toNativeScrollView

src/platforms/android/scroll-hints.ts:268–289  ·  view source on GitHub ↗
(node: ViewNode)

Source from the content-addressed store, hash-verified

266}
267
268function toNativeScrollView(node: ViewNode): NativeScrollView | null {
269 const contentRoot = node.children[0];
270 if (!contentRoot) {
271 return null;
272 }
273 const contentExtent = Math.max(
274 contentRoot.rect.height,
275 ...contentRoot.children.map((child) => child.rect.y + child.rect.height),
276 );
277 const contentBlocks = contentRoot.children
278 .filter((child) => hasPositiveVerticalExtent(child.rect))
279 .map((child) => toFlowBlock(child.rect, node.rect))
280 .sort((left, right) => left.start - right.start);
281 if (contentBlocks.length === 0) {
282 return null;
283 }
284 return {
285 rect: node.rect,
286 contentExtent,
287 contentBlocks,
288 };
289}
290
291function matchNativeScrollView(
292 rect: Rect,

Callers 1

collectNativeScrollViewsFunction · 0.85

Calls 2

toFlowBlockFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…