Exemplo n.º 1
0
 public void InitData()
 {
     SpecialHeightDic.Clear();
     for (int i = 0; i < count; i++)
     {
         if (i % 2 == 0)
         {
             MsgOne m = new MsgOne {
                 fromWho = 1, contentOne = i.ToString()
             };
             dataList.Add(m);
         }
         else
         {
             MsgTwo m = new MsgTwo {
                 fromWho = 1, contentTwo = 0 + i.ToString()
             };
             dataList.Add(m);
         }
     }
 }
Exemplo n.º 2
0
 public void AddData()
 {
     for (int i = count; i < changIndex; i++)
     {
         if (i % 2 == 0)
         {
             MsgOne m = new MsgOne {
                 fromWho = 1, contentOne = i.ToString()
             };
             dataList.Add(m);
         }
         else
         {
             MsgTwo m = new MsgTwo {
                 fromWho = 1, contentTwo = 0 + i.ToString()
             };
             dataList.Add(m);
         }
     }
     mRecycle.UpdateData(dataList.Count);
 }
Exemplo n.º 3
0
    private void UpdateItem(ItemCtrler ctrler, int dataIndex)
    {
        var newHeight = 0;

        if (dataIndex >= dataList.Count)
        {
            return;
        }
        Msg info = dataList[dataIndex];

        if (info is MsgOne)
        {
            MsgOne mo = info as MsgOne;
            ctrler.info = mo;
            ctrler.UpdateItem();

            if (SpecialHeightDic.TryGetValue(dataIndex, out newHeight))
            {
                ctrler.UpdateHeight(newHeight);
            }
            else
            {
                ctrler.UpdateHeight();
            }
        }
        else if (info is MsgTwo)
        {
            MsgTwo mt = info as MsgTwo;
            ctrler.info = mt;
            ctrler.UpdateItem();
            if (SpecialHeightDic.TryGetValue(dataIndex, out newHeight))
            {
                ctrler.UpdateHeight(newHeight);
            }
            else
            {
                ctrler.UpdateHeight();
            }
        }
    }
Exemplo n.º 4
0
    public override void UpdateItem()
    {
        MsgTwo infoT = info as MsgTwo;

        lbl.text = infoT.contentTwo;
    }