Skip to content

Commit

Permalink
[android] remove destory callback when recyclerd
Browse files Browse the repository at this point in the history
  • Loading branch information
biezhihua committed Jul 3, 2024
1 parent f963967 commit 0f0175a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -512,24 +512,6 @@ class GXContainerViewAdapter(val gxTemplateContext: GXTemplateContext, private v

override fun onViewRecycled(holder: GXViewHolder) {
super.onViewRecycled(holder)
val view = holder.itemView
if (view is ViewGroup && view.childCount > 0) {
view.getChildAt(0)?.let { gxView ->
GXTemplateContext.getContext(gxView)?.let { gxTemplateContext ->
if (Log.isLog()) {
Log.e(gxTemplateContext.tag, "traceId=${gxTemplateContext.traceId} tag=onViewRecycled $holder ${holder.itemView} $gxView")
}

// 此处不调用,因为回收之后可能还会被复用
// GXTemplateEngine.instance.destroyView(gxView)

if (gxTemplateContext.templateItem.isPageMode) {
GXRegisterCenter.instance.gxPageItemViewLifecycleListener?.onDestroy(gxView)
} else {
GXRegisterCenter.instance.gxItemViewLifecycleListener?.onDestroy(gxView)
}
}
}
}
// 此处不处理销毁逻辑,相同类型的Item,回收之后还会被复用
}
}
19 changes: 15 additions & 4 deletions GaiaXHarmony/GXStretchBinding/GXStretch/BuildProfile.ets
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
/**
* Use these variables when you tailor your ArkTS code. They must be of the const type.
*/
export const HAR_VERSION = '1.0.0';
export const BUILD_MODE_NAME = 'debug';
export const DEBUG = true;
export const TARGET_NAME = 'default';

/**
* BuildProfile Class is used only for compatibility purposes.
*/
export default class BuildProfile {
static readonly HAR_VERSION = '1.0.0';
static readonly BUILD_MODE_NAME = 'debug';
static readonly DEBUG = true;
static readonly TARGET_NAME = 'default';
static readonly HAR_VERSION = HAR_VERSION;
static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
static readonly DEBUG = DEBUG;
static readonly TARGET_NAME = TARGET_NAME;
}

0 comments on commit 0f0175a

Please sign in to comment.