From 184c30d46e5e2a0125053882b82b659e96241af8 Mon Sep 17 00:00:00 2001 From: sohotz Date: Tue, 3 Dec 2024 18:27:49 +0800 Subject: [PATCH 1/4] feat(ohos): fix OH_JSVM_Init --- driver/js/src/vm/jsh/jsh_vm.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/driver/js/src/vm/jsh/jsh_vm.cc b/driver/js/src/vm/jsh/jsh_vm.cc index 0c0b6c6efba..fc86d7ca8f6 100644 --- a/driver/js/src/vm/jsh/jsh_vm.cc +++ b/driver/js/src/vm/jsh/jsh_vm.cc @@ -61,8 +61,9 @@ JSHVM::JSHVM(const std::shared_ptr& param) : VM(param) { JSVM_InitOptions init_options; memset(&init_options, 0, sizeof(init_options)); + // 说明:这里init返回结果不需要判断,有可能App其它地方已经init过JSVM,这里会返回错误码9,但没影响。 auto status = OH_JSVM_Init(&init_options); - FOOTSTONE_CHECK(status == JSVM_OK); + FOOTSTONE_LOG(INFO) << "JSHVM OH_JSVM_Init result: " << status; platform_initted = true; #ifdef ENABLE_INSPECTOR auto trace = reinterpret_cast(platform->GetTracingController()); @@ -79,7 +80,7 @@ JSHVM::JSHVM(const std::shared_ptr& param) : VM(param) { FOOTSTONE_CHECK(status == JSVM_OK); enable_v8_serialization_ = param->enable_v8_serialization; - FOOTSTONE_DLOG(INFO) << "V8VM end"; + FOOTSTONE_DLOG(INFO) << "JSHVM end"; } static void UncaughtExceptionMessageCallback(JSVM_Env env, JSVM_Value error, void *external_data) { From 33b37124a7c7ffa52abea1d056af4ea6b6a91987 Mon Sep 17 00:00:00 2001 From: sohotz Date: Fri, 6 Dec 2024 16:50:45 +0800 Subject: [PATCH 2/4] feat(ohos): fix TODO --- .../native/include/renderer/components/text_input_view.h | 4 ++-- .../cpp/impl/renderer/native/src/components/base_view.cc | 2 +- .../cpp/impl/renderer/native/src/components/list_view.cc | 2 +- .../impl/renderer/native/src/components/pull_header_view.cc | 2 -- .../renderer/native/src/components/refresh_wrapper_view.cc | 5 ++--- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/components/text_input_view.h b/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/components/text_input_view.h index 1ee711e729c..cef3348b44a 100644 --- a/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/components/text_input_view.h +++ b/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/components/text_input_view.h @@ -130,8 +130,8 @@ class TextInputView : public BaseView, public TextInputNodeDelegate,public TextA bool isListenEndEditing_ = false; bool isListenFocus_ = false; bool isListenBlur_ = false; - bool isListenKeyboardWillShow_ = false; // TODO(hot): - bool isListenKeyboardWillHide_ = false; // TODO(hot): + bool isListenKeyboardWillShow_ = false; // TODO: 如果有业务需求,再评估鸿蒙上实现方案。 + bool isListenKeyboardWillHide_ = false; bool isListenContentSizeChange_ = false; bool focus_ = false; diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/src/components/base_view.cc b/framework/ohos/src/main/cpp/impl/renderer/native/src/components/base_view.cc index f36ed5d2230..b3a9ee9e1f7 100644 --- a/framework/ohos/src/main/cpp/impl/renderer/native/src/components/base_view.cc +++ b/framework/ohos/src/main/cpp/impl/renderer/native/src/components/base_view.cc @@ -750,7 +750,7 @@ void BaseView::SetInterceptPullUp(bool flag) { } void BaseView::HandleInterceptPullUp() { - // TODO(hot): + // TODO: 如果有业务需求,再评估鸿蒙上实现方案。 } void BaseView::SetAttachedToWindowHandle(bool flag) { diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/src/components/list_view.cc b/framework/ohos/src/main/cpp/impl/renderer/native/src/components/list_view.cc index 72325acccbe..63650aaaea0 100644 --- a/framework/ohos/src/main/cpp/impl/renderer/native/src/components/list_view.cc +++ b/framework/ohos/src/main/cpp/impl/renderer/native/src/components/list_view.cc @@ -61,7 +61,7 @@ void ListView::Init() { listView->HandleOnChildrenUpdated(); listView->CheckInitOffset(); - // TODO(hot): rowShouldSticky + // TODO: rowShouldSticky 吸顶逻辑,如果有业务需求,再评估鸿蒙上实现方案。 } }); } diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/src/components/pull_header_view.cc b/framework/ohos/src/main/cpp/impl/renderer/native/src/components/pull_header_view.cc index 815df2b4a42..717ffa86564 100644 --- a/framework/ohos/src/main/cpp/impl/renderer/native/src/components/pull_header_view.cc +++ b/framework/ohos/src/main/cpp/impl/renderer/native/src/components/pull_header_view.cc @@ -55,7 +55,6 @@ void PullHeaderView::CallImpl(const std::string &method, const std::vector 0) { auto collapseTime = HRValueUtils::GetInt32(map["time"]); if (collapseTime > 0) { - // TODO(hot): OnHeadRefreshFinish(collapseTime); } else { OnHeadRefreshFinish(); @@ -76,7 +75,6 @@ void PullHeaderView::OnHeadRefreshFinish(int32_t delay) { listView->ScrollToIndex(1, true); } else if (parentView->GetViewType() == "WaterfallView") { auto waterView = std::static_pointer_cast(parentView); - // TODO(hot): waterView->OnHeadRefreshFinish(delay); } } diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/src/components/refresh_wrapper_view.cc b/framework/ohos/src/main/cpp/impl/renderer/native/src/components/refresh_wrapper_view.cc index a9c4f6807d4..7b4ed5c8a48 100644 --- a/framework/ohos/src/main/cpp/impl/renderer/native/src/components/refresh_wrapper_view.cc +++ b/framework/ohos/src/main/cpp/impl/renderer/native/src/components/refresh_wrapper_view.cc @@ -118,6 +118,7 @@ void RefreshWrapperView::OnRefreshing() { void RefreshWrapperView::OnStateChange(int32_t state) { FOOTSTONE_DLOG(INFO) << "Refresh wrapper view, OnStateChange: " << state; + } void RefreshWrapperView::OnOffsetChange(float_t offset) { @@ -137,12 +138,10 @@ void RefreshWrapperView::SetRefreshOffset(float offset) { void RefreshWrapperView::BounceToHead() { refreshNode_->SetRefreshRefreshing(false); - - // TODO(hot): setTimeout bounceTime } void RefreshWrapperView::StartRefresh() { - HREventUtils::SendComponentEvent(ctx_, tag_, HREventUtils::EVENT_REFRESH_WRAPPER_REFRESH, nullptr); + // 鸿蒙不支持程序开始刷新 } void RefreshWrapperView::RefreshComplected() { From 014ba3d9ef5dc48ded5bad6d3182df2aa043a011 Mon Sep 17 00:00:00 2001 From: sohotz Date: Mon, 9 Dec 2024 18:01:23 +0800 Subject: [PATCH 3/4] feat(ohos): update demo and doc --- docs/development/native-integration.md | 2 +- framework/examples/ohos-har-demo/oh-package.json5 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/development/native-integration.md b/docs/development/native-integration.md index 63b8e113705..00923c24ef4 100644 --- a/docs/development/native-integration.md +++ b/docs/development/native-integration.md @@ -298,7 +298,7 @@ Ohos Demo:源码依赖 Hippy。体验方法:DevEco 打开 hippy 项目根目 ```json "dependencies": { - "hippy": "1.0.0" + "hippy": "1.1.0" } ``` diff --git a/framework/examples/ohos-har-demo/oh-package.json5 b/framework/examples/ohos-har-demo/oh-package.json5 index 48b13aa4d45..7c56d1dd419 100644 --- a/framework/examples/ohos-har-demo/oh-package.json5 +++ b/framework/examples/ohos-har-demo/oh-package.json5 @@ -6,7 +6,7 @@ "author": "", "license": "", "dependencies": { - "hippy": "1.0.0" + "hippy": "1.1.0" }, "devDependencies": {}, "dynamicDependencies": {} From f1c6f8926384b5ae2ed999a870c4bf2bd3aa4666 Mon Sep 17 00:00:00 2001 From: sohotz Date: Mon, 9 Dec 2024 18:20:50 +0800 Subject: [PATCH 4/4] feat(ohos): publish to ohpm new version 1.2.0 --- docs/development/native-integration.md | 2 +- framework/examples/ohos-har-demo/oh-package.json5 | 2 +- framework/ohos/CHANGELOG.md | 4 ++++ framework/ohos/oh-package.json5 | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/development/native-integration.md b/docs/development/native-integration.md index 00923c24ef4..6e4e8006d5a 100644 --- a/docs/development/native-integration.md +++ b/docs/development/native-integration.md @@ -298,7 +298,7 @@ Ohos Demo:源码依赖 Hippy。体验方法:DevEco 打开 hippy 项目根目 ```json "dependencies": { - "hippy": "1.1.0" + "hippy": "1.2.0" } ``` diff --git a/framework/examples/ohos-har-demo/oh-package.json5 b/framework/examples/ohos-har-demo/oh-package.json5 index 7c56d1dd419..f8a39abaaf0 100644 --- a/framework/examples/ohos-har-demo/oh-package.json5 +++ b/framework/examples/ohos-har-demo/oh-package.json5 @@ -6,7 +6,7 @@ "author": "", "license": "", "dependencies": { - "hippy": "1.1.0" + "hippy": "1.2.0" }, "devDependencies": {}, "dynamicDependencies": {} diff --git a/framework/ohos/CHANGELOG.md b/framework/ohos/CHANGELOG.md index 9c4ea475e7b..d2c891699a8 100644 --- a/framework/ohos/CHANGELOG.md +++ b/framework/ohos/CHANGELOG.md @@ -7,3 +7,7 @@ ## Version 1.1.0 ### Features - Improve the list component, improve the details of JSVM usage, optimize memory, and so on. + +## Version 1.2.0 +### Fix +- Some bugs. diff --git a/framework/ohos/oh-package.json5 b/framework/ohos/oh-package.json5 index e824aa75c01..987da845b46 100644 --- a/framework/ohos/oh-package.json5 +++ b/framework/ohos/oh-package.json5 @@ -6,7 +6,7 @@ "repository": "https://github.com/sohotz/Hippy.git", "homepage": "https://openhippy.com/", "keywords": ["hippy", "cross-platform"], - "version": "1.1.0", + "version": "1.2.0", "dependencies": {}, "devDependencies": {}, }