浏览代码

Update chat_list.cs

/add_hero_sample
guanghuispark 3 年前
当前提交
769e64a7
共有 1 个文件被更改,包括 14 次插入14 次删除
  1. 28
      AwesomeUIWidgets/Assets/Scripts/Widgets/chat_list.cs

28
AwesomeUIWidgets/Assets/Scripts/Widgets/chat_list.cs


var message1 = ((Dictionary<string, object>)item)["message"] as ChatComponents.Message;
if (message1 != null)
{
if (_oldIndex != null && _oldIndex.Count != 0 && !_oldIndex.Contains(message1.id))
if (oldList != null && oldList.Count != 0 && !oldList.Contains(message1.id))
_listKey.currentState?.insertItem(_oldIndex.Count -1);
_listKey.currentState?.insertItem(oldList.Count -1);
}
}
}

_oldData = new List<object>(widget.items);
List<string> _newIndex = new List<string>();
foreach (var item in widget.items)
{
if (item is Dictionary<string, object> )
{
var message1 = ((Dictionary<string, object>)item)["message"] as ChatComponents.Message;
if (message1 != null)
_newIndex.Add(message1.id);
}
}
_oldIndex = _newIndex;
// List<string> _newIndex = new List<string>();
// foreach (var item in widget.items)
// {
// if (item is Dictionary<string, object> )
// {
// var message1 = ((Dictionary<string, object>)item)["message"] as ChatComponents.Message;
// if (message1 != null)
// _newIndex.Add(message1.id);
// }
// }
//
// _oldIndex = _newIndex;
}

正在加载...
取消
保存