com.alicizax.unity.ui.exten.../Runtime/RecyclerView/Adapter/MixedAdapter.cs

32 lines
753 B
C#
Raw Normal View History

2025-03-12 20:59:12 +08:00
using System;
using System.Collections.Generic;
namespace AlicizaX.UI.RecyclerView
{
2025-08-04 15:05:44 +08:00
public class MixedAdapter : Adapter<IMixedData>
2025-03-12 20:59:12 +08:00
{
public MixedAdapter(RecyclerView recyclerView) : base(recyclerView)
{
}
2025-08-04 15:05:44 +08:00
public MixedAdapter(RecyclerView recyclerView, List<IMixedData> list) : base(recyclerView, list)
2025-03-12 20:59:12 +08:00
{
}
2025-08-04 15:05:44 +08:00
public MixedAdapter(RecyclerView recyclerView, List<IMixedData> list, Action<IMixedData> onItemClick) : base(recyclerView, list, onItemClick)
2025-03-12 20:59:12 +08:00
{
}
public override string GetViewName(int index)
{
2025-08-04 15:05:44 +08:00
return list[index].TemplateName;
2025-03-12 20:59:12 +08:00
}
}
2025-08-04 15:05:44 +08:00
public interface IMixedData
2025-03-12 20:59:12 +08:00
{
2025-08-04 15:05:44 +08:00
string TemplateName { get; set; }
2025-03-12 20:59:12 +08:00
}
2025-08-04 15:05:44 +08:00
2025-03-12 20:59:12 +08:00
}