Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync from main #4058

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/api/hippy-react/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ import icon from './qb_icon_new.png';
| renderPullHeader | 如何渲染 `PullHeader`,此时 `containPullHeader` 默认设置成 `true` | `() => React.ReactElement` | `Android、iOS、Voltron` |
| renderPullFooter | 如何渲染 `PullFooter`,此时 `containPullFooter` 默认设置成 `true` | `() => React.ReactElement` | `Android、iOS、Voltron` |
| onScroll | 当触发 `WaterFall` 的滑动事件时回调。`startEdgePos`表示距离 List 顶部边缘滚动偏移量;`endEdgePos`表示距离 List 底部边缘滚动偏移量;`firstVisibleRowIndex`表示当前可见区域内第一个元素的索引;`lastVisibleRowIndex`表示当前可见区域内最后一个元素的索引;`visibleRowFrames`表示当前可见区域内所有 item 的信息(x,y,width,height) | `nativeEvent: { startEdgePos: number, endEdgePos: number, firstVisibleRowIndex: number, lastVisibleRowIndex: number, visibleRowFrames: Object[] }` | `Android、iOS、Voltron`
| showScrollIndicator | 是否显示滚动条。(iOS 3.3.2版本起支持) `default: true` | `boolean` | `iOS` |

## 方法

Expand Down
1 change: 1 addition & 0 deletions docs/api/hippy-vue/external-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ export default {
| containPullFooter | 是否包含 `pull-footer` | `boolean` | `Android、iOS、Voltron` |
| numberOfColumns | 瀑布流列数量,Default: 2 | `number` | `Android、iOS、Voltron` |
| preloadItemNumber | 滑动到瀑布流底部前提前预加载的 item 数量 | `number` | `Android、iOS、Voltron` |
| showScrollIndicator | 是否显示滚动条。(iOS 3.3.2版本起支持) `default: true` | `boolean` | `iOS` |

## 事件

Expand Down
13 changes: 8 additions & 5 deletions framework/ios/base/executors/HippyJSExecutor.mm
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ - (void)executeBlockOnJavaScriptQueue:(dispatch_block_t)block {
return;
}
}
std::shared_ptr<EngineResource> engineRsc = [[HippyJSEnginesMapper defaultInstance] JSEngineResourceForKey:self.enginekey];
auto engineRsc = [[HippyJSEnginesMapper defaultInstance] JSEngineResourceForKey:self.enginekey];
if (!engineRsc) {
return;
}
Expand All @@ -670,8 +670,8 @@ - (void)executeBlockOnJavaScriptQueue:(dispatch_block_t)block {
auto runner = engine->GetJsTaskRunner();
if (footstone::Worker::IsTaskRunning() && runner == footstone::runner::TaskRunner::GetCurrentTaskRunner()) {
block();
} else {
engine->GetJsTaskRunner()->PostTask(block);
} else if (runner) {
runner->PostTask(block);
}
}
}
Expand All @@ -683,13 +683,16 @@ - (void)executeAsyncBlockOnJavaScriptQueue:(dispatch_block_t)block {
return;
}
}
std::shared_ptr<EngineResource> engineRsc = [[HippyJSEnginesMapper defaultInstance] JSEngineResourceForKey:self.enginekey];
auto engineRsc = [[HippyJSEnginesMapper defaultInstance] JSEngineResourceForKey:self.enginekey];
if (!engineRsc) {
return;
}
auto engine = engineRsc->GetEngine();
if (engine) {
engine->GetJsTaskRunner()->PostTask(block);
auto runner = engine->GetJsTaskRunner();
if (runner) {
runner->PostTask(block);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion renderer/native/ios/renderer/HippyUIManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ - (void)addEventName:(const std::string &)name
if (!bridge) {
return;
}
[bridge.javaScriptExecutor executeBlockOnJavaScriptQueue:^{
[bridge.javaScriptExecutor executeAsyncBlockOnJavaScriptQueue:^{
auto strongNode = weakNode.lock();
if (strongNode) {
strongNode->HandleEvent(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ @implementation HippyWaterfallViewManager
HIPPY_EXPORT_VIEW_PROPERTY(containPullFooter, BOOL)
HIPPY_EXPORT_VIEW_PROPERTY(scrollEventThrottle, double)
HIPPY_EXPORT_VIEW_PROPERTY(onScroll, HippyDirectEventBlock)
HIPPY_REMAP_VIEW_PROPERTY(showScrollIndicator, collectionView.showsVerticalScrollIndicator, BOOL)

- (UIView *)view {
return [[HippyWaterfallView alloc] init];
Expand Down
Loading