Пример #1
0
 public void GetClientBlogPostsSuccess(List <ArticlesModel> lists)
 {
     recyclerView.Post(() =>
     {
         if (lists.Count > 0)
         {
             adapter.SetNewData(lists);
         }
     });
 }
Пример #2
0
 public void GetServiceArticlesSuccess(List <ArticlesModel> lists)
 {
     recyclerView.Post(() =>
     {
         if (swipeRefreshLayout.Refreshing)
         {
             swipeRefreshLayout.Refreshing = false;
         }
         if (!swipeRefreshLayout.Enabled)
         {
             swipeRefreshLayout.Enabled = true;
         }
         if (pageIndex == 1)
         {
             if (lists.Count > 0)
             {
                 adapter.SetNewData(lists);
                 if (lists.Count < 10)
                 {
                     adapter.LoadMoreEnd();
                 }
                 else
                 {
                     adapter.SetEnableLoadMore(true);
                     pageIndex++;
                 }
                 refreshTime = DateTime.Now;
             }
             else if (adapter.GetData().Count() == 0)
             {
                 adapter.SetEmptyView(notDataView);
             }
         }
         else
         {
             if (lists.Count > 0)
             {
                 adapter.AddData(lists);
                 adapter.LoadMoreComplete();
                 pageIndex++;
             }
             else
             {
                 adapter.LoadMoreEnd();
             }
         }
     });
 }