modify
This commit is contained in:
parent
effbc92ee3
commit
55da0d4f00
@ -9,7 +9,8 @@
|
|||||||
"GUID:198eb6af143bbc4488e2779d96697e06",
|
"GUID:198eb6af143bbc4488e2779d96697e06",
|
||||||
"GUID:80ecb87cae9c44d19824e70ea7229748",
|
"GUID:80ecb87cae9c44d19824e70ea7229748",
|
||||||
"GUID:f51ebe6a0ceec4240a699833d6309b23",
|
"GUID:f51ebe6a0ceec4240a699833d6309b23",
|
||||||
"GUID:33661e06c33d31b4c9223810bf503247"
|
"GUID:33661e06c33d31b4c9223810bf503247",
|
||||||
|
"GUID:e9c35c8938f782649bb7e670099ca425"
|
||||||
],
|
],
|
||||||
"includePlatforms": [],
|
"includePlatforms": [],
|
||||||
"excludePlatforms": [],
|
"excludePlatforms": [],
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 72a222ebb6ae56346b65b78fa3d60143
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1,19 +0,0 @@
|
|||||||
using AlicizaX.UI.RecyclerView;
|
|
||||||
using TMPro;
|
|
||||||
|
|
||||||
public sealed class SimpleViewHolder : ViewHolder
|
|
||||||
{
|
|
||||||
private TMP_Text simpleText;
|
|
||||||
|
|
||||||
public override void FindUI()
|
|
||||||
{
|
|
||||||
simpleText = transform.Find("SimpleText").GetComponent<TMP_Text>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void BindViewData<T>(T data)
|
|
||||||
{
|
|
||||||
string text = data as string;
|
|
||||||
|
|
||||||
simpleText.text = text;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 846ae5a2cd8b619459ecbadfc91e58f1
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -6,9 +6,8 @@ namespace AlicizaX.UI.RecyclerView
|
|||||||
{
|
{
|
||||||
public abstract class ViewHolder : MonoBehaviour
|
public abstract class ViewHolder : MonoBehaviour
|
||||||
{
|
{
|
||||||
private bool isStarted;
|
|
||||||
|
|
||||||
private RectTransform rectTransform;
|
private RectTransform rectTransform;
|
||||||
|
|
||||||
public RectTransform RectTransform
|
public RectTransform RectTransform
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -17,12 +16,10 @@ namespace AlicizaX.UI.RecyclerView
|
|||||||
{
|
{
|
||||||
rectTransform = GetComponent<RectTransform>();
|
rectTransform = GetComponent<RectTransform>();
|
||||||
}
|
}
|
||||||
|
|
||||||
return rectTransform;
|
return rectTransform;
|
||||||
}
|
}
|
||||||
private set
|
private set { rectTransform = value; }
|
||||||
{
|
|
||||||
rectTransform = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
@ -30,19 +27,10 @@ namespace AlicizaX.UI.RecyclerView
|
|||||||
|
|
||||||
public Vector2 SizeDelta => RectTransform.sizeDelta;
|
public Vector2 SizeDelta => RectTransform.sizeDelta;
|
||||||
|
|
||||||
public virtual void OnStart()
|
public virtual void OnStop()
|
||||||
{
|
{
|
||||||
if (!isStarted)
|
|
||||||
{
|
|
||||||
isStarted = true;
|
|
||||||
FindUI();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void OnStop() { }
|
|
||||||
|
|
||||||
public abstract void FindUI();
|
|
||||||
|
|
||||||
public abstract void BindViewData<T>(T data);
|
public abstract void BindViewData<T>(T data);
|
||||||
|
|
||||||
public virtual void BindItemClick<T>(T data, Action<T> action)
|
public virtual void BindItemClick<T>(T data, Action<T> action)
|
||||||
@ -54,6 +42,8 @@ namespace AlicizaX.UI.RecyclerView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void BindChoiceState(bool state) { }
|
public virtual void BindChoiceState(bool state)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ namespace AlicizaX.UI.RecyclerView
|
|||||||
|
|
||||||
string viewName = Adapter.GetViewName(i);
|
string viewName = Adapter.GetViewName(i);
|
||||||
var viewHolder = Allocate(viewName);
|
var viewHolder = Allocate(viewName);
|
||||||
viewHolder.OnStart();
|
// viewHolder.OnStart();
|
||||||
viewHolder.Name = viewName;
|
viewHolder.Name = viewName;
|
||||||
viewHolder.Index = i;
|
viewHolder.Index = i;
|
||||||
viewHolders.Add(viewHolder);
|
viewHolders.Add(viewHolder);
|
||||||
|
Loading…
Reference in New Issue
Block a user