Exemple #1
0
        public void AddData(int length)
        {
            Log("addData" + length);
            if (_hasMore)
            {
                if (length == 0)
                {
                    //当添加0个时,认为已结束加载到底
                    if (_status == StatusInitial || _status == StatusMore)
                    {
                        _footer.showNoMore();
                    }
                }
                else
                {
                    //当Error或初始时。添加数据,如果有More则还原。
                    if (_hasMore && (_status == StatusInitial || _status == StatusError))
                    {
                        _footer.showMore();
                    }

                    _hasData = true;
                }
            }
            else
            {
                if (_hasNoMore)
                {
                    _footer.showNoMore();
                    _status = StatusNomore;
                }
            }

            _isLoadingMore = false;
        }
 public void addData(int length)
 {
     log("addData" + length);
     if (hasMore)
     {
         if (length == 0)
         {
             //当添加0个时,认为已结束加载到底
             if (status == STATUS_INITIAL || status == STATUS_MORE)
             {
                 footer.showNoMore();
             }
         }
         else
         {
             //当Error或初始时。添加数据,如果有More则还原。
             if (hasMore && (status == STATUS_INITIAL || status == STATUS_ERROR))
             {
                 footer.showMore();
             }
             hasData = true;
         }
     }
     else
     {
         if (hasNoMore)
         {
             footer.showNoMore();
             status = STATUS_NOMORE;
         }
     }
     isLoadingMore = false;
 }