diff --git a/framework/android/connector/dom/src/main/cpp/src/dom_jni.cc b/framework/android/connector/dom/src/main/cpp/src/dom_jni.cc index 0c5021a3b47..750eeeaf0f2 100644 --- a/framework/android/connector/dom/src/main/cpp/src/dom_jni.cc +++ b/framework/android/connector/dom/src/main/cpp/src/dom_jni.cc @@ -163,18 +163,16 @@ jint CreateDomManager(JNIEnv* j_env, jobject j_obj, jint j_group_id, jint j_shar if (share_dom_id > 0) { flag = hippy::global_data_holder.Find(static_cast(share_dom_id), share_dom_manager); } - FOOTSTONE_DLOG(ERROR) << "CreateDomManager flag " << flag << ", dom_id " << dom_id << ", share_dom_id " << share_dom_id; + FOOTSTONE_DLOG(INFO) << "CreateDomManager flag " << flag << ", dom_id " << dom_id<< ", share_dom_id " << share_dom_id << ", group_id " << group_id; if (flag && group_id != kDefaultGroupId) { - FOOTSTONE_DLOG(ERROR) << "CreateDomManager share "; auto dom_manager_object = std::any_cast>(share_dom_manager); auto worker = dom_manager_object->GetWorker(); auto runner = dom_manager_object->GetTaskRunner(); dom_manager->SetTaskRunner(runner); dom_manager->SetWorker(worker); auto count = worker->FetchAndAddReuseCount(); - FOOTSTONE_DLOG(ERROR) << "CreateDomManager worker reuse count " << count << ", dom manager id " << dom_id; + FOOTSTONE_DLOG(INFO) << "CreateDomManager worker reuse count " << count << ", dom manager id " << dom_id; } else { - FOOTSTONE_DLOG(ERROR) << "CreateDomManager create new "; auto worker = std::make_shared(kDomWorkerName, false); auto callback = std::make_shared(j_env, j_obj); worker->BeforeStart([callback]() { diff --git a/modules/android/serialization/build.gradle b/modules/android/serialization/build.gradle index b82c85d85ff..b1dc05b618c 100644 --- a/modules/android/serialization/build.gradle +++ b/modules/android/serialization/build.gradle @@ -32,4 +32,5 @@ android { dependencies { implementation deps.annotation + implementation project(':hippy-support') } \ No newline at end of file diff --git a/modules/android/serialization/src/main/java/com/tencent/mtt/hippy/serialization/nio/writer/SafeHeapWriter.java b/modules/android/serialization/src/main/java/com/tencent/mtt/hippy/serialization/nio/writer/SafeHeapWriter.java index ebd4f5fb078..7d08fe8b402 100644 --- a/modules/android/serialization/src/main/java/com/tencent/mtt/hippy/serialization/nio/writer/SafeHeapWriter.java +++ b/modules/android/serialization/src/main/java/com/tencent/mtt/hippy/serialization/nio/writer/SafeHeapWriter.java @@ -15,6 +15,7 @@ */ package com.tencent.mtt.hippy.serialization.nio.writer; +import com.tencent.mtt.hippy.utils.LogUtils; import java.nio.ByteBuffer; @SuppressWarnings({"unused"}) @@ -73,22 +74,38 @@ public void putDouble(double d) { } @SuppressWarnings("SpellCheckingInspection") + // After upgrading to AGP version 8 or above, R8 compilation will be started. Due to the optimization + // of R8 compilation code, it will affect the logic of the code here, causing encoding and decoding + // failures and white screen problems. Therefore, it is necessary to add some logs in the implementation + // of this function to avoid R8 compilation optimization. @Override public int putVarint(long l) { if (count + 10 > value.length) { enlargeBuffer(count + 10); } - + if (LogUtils.isDebugMode()) { + LogUtils.d("CallFunction", "putVarint l " + l + ", count " + count); + } long rest = l; int bytes = 0; byte b; do { b = (byte) rest; + if (LogUtils.isDebugMode()) { + LogUtils.d("CallFunction", "putVarint origin b " + b + ", count " + count); + } b |= 0x80; + if (LogUtils.isDebugMode()) { + LogUtils.d("CallFunction", "putVarint b " + Byte.toUnsignedInt(b) + ", count " + count); + } value[count++] = b; rest >>>= 7; bytes++; } while (rest != 0); + if (LogUtils.isDebugMode()) { + LogUtils.d("CallFunction", + "putVarint bb " + Byte.toUnsignedInt((byte) (b & 0x7f)) + ", bytes " + bytes + ", count " + count); + } value[count - 1] = (byte) (b & 0x7f); return bytes; } diff --git a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/refresh/HippyPullHeaderViewController.java b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/refresh/HippyPullHeaderViewController.java index 886cc3394d1..d07422fffb9 100644 --- a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/refresh/HippyPullHeaderViewController.java +++ b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/refresh/HippyPullHeaderViewController.java @@ -27,6 +27,7 @@ import com.tencent.mtt.hippy.annotation.HippyController; import com.tencent.mtt.hippy.common.HippyArray; import com.tencent.mtt.hippy.uimanager.ControllerManager; +import com.tencent.mtt.hippy.uimanager.ControllerRegistry; import com.tencent.mtt.hippy.uimanager.HippyViewController; import com.tencent.renderer.node.PullHeaderRenderNode; import com.tencent.renderer.node.RenderNode; @@ -102,6 +103,26 @@ public void run() { } } + + @Override + public void updateLayout(int rootId, int id, int x, int y, int width, int height, + ControllerRegistry componentHolder) { + super.updateLayout(rootId, id, x, y, width, height, componentHolder); + View view = componentHolder.getView(rootId, id); + if (view instanceof HippyPullHeaderView && view.getParent() instanceof ViewGroup) { + int w = view.getWidth(); + int h = view.getHeight(); + ViewGroup.LayoutParams lp = view.getLayoutParams(); + if (lp != null) { + LogUtils.d(TAG, "updateLayout: id " + id + ", w " + w + ", h " + h + + ", width " + width + ", height " + height + ", lp.width " + lp.width + ", lp.height " + + lp.height); + lp.width = width; + lp.height = height; + } + } + } + @Override public void dispatchFunction(@NonNull HippyPullHeaderView pullHeaderView, @NonNull String functionName, @NonNull HippyArray params) {