From dd88656c0276b82063fc5b9ae25a1d2425a72e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=80=9D=E6=B5=B7?= <1464576565@qq.com> Date: Wed, 15 Apr 2026 13:18:43 +0800 Subject: [PATCH] fix --- Runtime/RecyclerView/Adapter/Adapter.cs | 4 --- Runtime/RecyclerView/Adapter/ItemRender.cs | 39 ---------------------- 2 files changed, 43 deletions(-) diff --git a/Runtime/RecyclerView/Adapter/Adapter.cs b/Runtime/RecyclerView/Adapter/Adapter.cs index 4b588ed..e777d46 100644 --- a/Runtime/RecyclerView/Adapter/Adapter.cs +++ b/Runtime/RecyclerView/Adapter/Adapter.cs @@ -78,10 +78,6 @@ namespace AlicizaX.UI { typedItemRender.BindData(data, index); } - else - { - itemRender.Bind(data, index); - } bool selected = index == choiceIndex; itemRender.SyncSelection(selected); diff --git a/Runtime/RecyclerView/Adapter/ItemRender.cs b/Runtime/RecyclerView/Adapter/ItemRender.cs index 0ad9996..9199e0c 100644 --- a/Runtime/RecyclerView/Adapter/ItemRender.cs +++ b/Runtime/RecyclerView/Adapter/ItemRender.cs @@ -11,13 +11,6 @@ namespace AlicizaX.UI /// internal interface IItemRender { - /// - /// 将指定数据绑定到当前渲染实例。 - /// - /// 待绑定的数据对象。 - /// 当前数据索引。 - void Bind(object data, int index); - /// /// 更新当前渲染实例的选中状态。 /// @@ -65,13 +58,6 @@ namespace AlicizaX.UI /// internal abstract void Detach(); - /// - /// 以对象形式绑定数据。 - /// - /// 待绑定的数据对象。 - /// 当前数据索引。 - internal abstract void BindObject(object data, int index); - /// /// 更新内部记录的选中状态。 /// @@ -85,16 +71,6 @@ namespace AlicizaX.UI /// internal abstract void UnbindInternal(); - /// - /// 由框架内部调用,将对象数据绑定到当前渲染实例。 - /// - /// 待绑定的数据对象。 - /// 当前数据索引。 - void IItemRender.Bind(object data, int index) - { - BindObject(data, index); - } - /// /// 由框架内部调用,更新当前渲染实例的选中状态。 /// @@ -206,21 +182,6 @@ namespace AlicizaX.UI /// protected virtual RecyclerNavigationOptions NavigationOptions => RecyclerNavigationOptions.Circular; - /// - /// 以对象形式绑定数据并执行强类型校验。 - /// - /// 待绑定的数据对象。 - /// 当前数据索引。 - internal override void BindObject(object data, int index) - { - if (data is not TData itemData) - { - throw new InvalidCastException( - $"ItemRender '{GetType().Name}' expected data '{typeof(TData).Name}', but got '{data?.GetType().Name ?? "null"}'."); - } - - BindCore(itemData, index); - } /// /// 由框架内部调用,使用强类型数据执行绑定。