Skip to content

Commit 4097f82

Browse files
committed
[BugFix] remove TemplateBundle field in LynxViewBuilder
1. remove templateBundle field in LynxViewBuilder, it should be a member in LynxViewGroup, we add it to lynxViewBuilder to support engine reuse, and now we can remove it. 2. do not block ui thread when templateBundle is not ready in lynxViewGroup, as we will correctly fallback to loadTemplate if bundle is not ready here. issue: f-98236756 AutoSubmit: true
1 parent 4895f92 commit 4097f82

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

platform/android/api/lynx_android.api

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7083,7 +7083,6 @@ public class com::lynx::tasm::LynxViewBuilder : LynxBaseConfigurator< LynxViewBu
70837083
public LynxViewBuilder com.lynx.tasm.LynxViewBuilder.setLynxViewConfig(Map< String, String > map);
70847084
public Map< String, String > com.lynx.tasm.LynxViewBuilder.getLynxViewConfig();
70857085
public LynxViewBuilder com.lynx.tasm.LynxViewBuilder.setLynxBackgroundRuntime(LynxBackgroundRuntime runtime);
7086-
public LynxViewBuilder com.lynx.tasm.LynxViewBuilder.setTemplateBundle(TemplateBundle templateBundle);
70877086
public BehaviorRegistry com.lynx.tasm.LynxViewBuilder.getBehaviorRegistry();
70887087
public boolean com.lynx.tasm.LynxViewBuilder.isEnableAutoExpose();
70897088
public Float com.lynx.tasm.LynxViewBuilder.getDensity();

platform/android/lynx_android/src/main/java/com/lynx/tasm/LynxTemplateRender.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,15 +312,10 @@ private void init(@Nullable Context context, UIBodyView bodyView, LynxViewBuilde
312312
}
313313

314314
mLynxViewBuilder = builder;
315-
if (mLynxViewGroup != null) {
315+
if (mLynxViewGroup != null && mLynxViewGroup.isTemplateBundleReady()) {
316316
mTemplateBundle = mLynxViewGroup.getTemplateBundle();
317317
}
318318

319-
// fallback to use `builder.templateBundle`, delete it later;
320-
if (mTemplateBundle == null) {
321-
mTemplateBundle = mLynxViewBuilder.templateBundle;
322-
}
323-
324319
mEmbeddedMode = mLynxViewConfigProvider.getEmbeddedMode();
325320

326321
// Set embedded mode for PerformanceController

platform/android/lynx_android/src/main/java/com/lynx/tasm/LynxViewBuilder.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public class LynxViewBuilder
4242
LynxFontFaceLoader.Loader fontLoader;
4343
LynxImageFetcher imageFetcher;
4444

45-
TemplateBundle templateBundle;
4645
boolean enableLayoutOnly = LynxEnv.inst().isLayoutOnlyEnabled();
4746
Map<String, String> mImageCustomParam;
4847
Map<String, String> lynxViewConfig;
@@ -351,11 +350,6 @@ public LynxViewBuilder setLynxBackgroundRuntime(LynxBackgroundRuntime runtime) {
351350
return this;
352351
}
353352

354-
public LynxViewBuilder setTemplateBundle(TemplateBundle templateBundle) {
355-
this.templateBundle = templateBundle;
356-
return this;
357-
}
358-
359353
@Override
360354
public BehaviorRegistry getBehaviorRegistry() {
361355
if (lynxViewGroup != null) {

0 commit comments

Comments
 (0)