private async void LoadMore()
        {
            pageIndex++;
            var result = await ArticleService.ListArticle(AccessTokenUtil.GetToken(this.Activity), pageIndex, position);

            if (result.Success)
            {
                var tempList = result.Data;
                if (tempList == null || tempList.Count == 0)
                {
                    AlertUtil.ToastShort(Activity, "ÍøÂ粻̫ºÃŶ");
                }
                else
                {
                    // Thread.Sleep(2000);
                    articleList.AddRange(tempList);
                    adapter.SetNewData(articleList);
                    adapter.NotifyItemRemoved(adapter.ItemCount);
                    await SQLiteUtil.UpdateArticleList(tempList);

                    System.Diagnostics.Debug.Write("Ò³Êý:" + pageIndex + "Êý¾Ý×ÜÌõÊý£º" + articleList.Count);
                }
            }
            else
            {
                AlertUtil.ToastShort(Activity, result.Message);
            }
        }
        private async void LoadMore()
        {
            if (_swipeRefreshLayout.Refreshing)
            {
                _swipeRefreshLayout.Post(() =>
                {
                    _swipeRefreshLayout.Refreshing = false;
                });
            }
            pageIndex++;
            var result = new ApiResult <List <QuestionModel> >();

            if (isMy)
            {
                result = await QuestionService.ListQuestion(userToken, position, pageIndex, true, userInfo.SpaceUserId);
            }
            else
            {
                result = await QuestionService.ListQuestion(accessToken, position, pageIndex, false, 0);
            }
            if (result.Success)
            {
                var tempList = result.Data;
                listQuestion.AddRange(tempList);
                adapter.SetNewData(listQuestion);
            }
            else
            {
                AlertUtil.ToastShort(Activity, result.Message);
            }
        }
Beispiel #3
0
        public async void OnRefresh()
        {
            _swipeRefreshLayout.Post(() => {
                _swipeRefreshLayout.Refreshing = true;
            });
            pageIndex = 1;
            if (position == 3)
            {
                var result = await KbArticlesService.ListKbArticle(AccessTokenUtil.GetToken(this.Activity), pageIndex);

                if (result.Success)
                {
                    //var tempList = result.Data;
                    kbArticlesList = result.Data;
                    adapterKbArticles.SetNewData(kbArticlesList);
                    if (kbArticlesList != null && kbArticlesList.Count != 0)
                    {
                        await SQLiteUtil.UpdateKbArticlesList(result.Data);
                    }
                    _swipeRefreshLayout.Refreshing = false;
                }
                else
                {
                    AlertUtil.ToastShort(Activity, result.Message);
                    _swipeRefreshLayout.Refreshing = false;
                }
            }
            else
            {
                var result = await NewsService.ListNews(AccessTokenUtil.GetToken(this.Activity), pageIndex, position);

                if (result.Success)
                {
                    newsList = result.Data;
                    if (position == 1)
                    {
                        newsList.ForEach(f => f.IsHot = true);
                    }
                    if (position == 2)
                    {
                        newsList.ForEach(f => f.IsRecommend = true);
                    }
                    adapter.SetNewData(newsList);
                    if (newsList != null && newsList.Count != 0)
                    {
                        await SQLiteUtil.UpdateNewsList(newsList);
                    }
                    _swipeRefreshLayout.Refreshing = false;
                }
                else
                {
                    AlertUtil.ToastShort(Activity, result.Message);
                    _swipeRefreshLayout.Refreshing = false;
                }
            }
        }
        private async void LoadMore()
        {
            var result = await QuestionService.ListQuestionAnswer(userToken, questionId);

            if (result.Success)
            {
                var tempList = result.Data;
                answerList.AddRange(tempList);
                adapter.SetNewData(answerList);
            }
            else
            {
                AlertUtil.ToastShort(this, result.Message);
            }
        }
 //ɾ³ýÎÒµÄÉÁ´æÆÀÂÛ
 void DeleteComment(StatusCommentsModel model)
 {
     Android.Support.V7.App.AlertDialog.Builder builder = new Android.Support.V7.App.AlertDialog.Builder(this);
     builder.SetCancelable(true);
     string[] btns = Resources.GetStringArray(Resource.Array.DialogDelete);
     builder.SetItems(btns, (s, e) =>
     {
         ProgressDialog progressDialog = new ProgressDialog(this);
         progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
         progressDialog.SetMessage("ɾ³ýÖÐ....");
         progressDialog.Show();
         StatusService.DeleteComment(UserTokenUtil.GetToken(this), model.StatusId.ToString(), model.Id.ToString(), () => {
             RunOnUiThread(() =>
             {
                 progressDialog.Hide();
                 listStatusComment.Remove(model);
                 adapter.SetNewData(listStatusComment);
                 AlertUtil.ToastShort(this, "ɾ³ý³É¹¦");
             });
         },
                                     (error => {
             RunOnUiThread(() =>
             {
                 progressDialog.Hide();
                 AlertUtil.ToastShort(this, error);
             });
         }));
     }).Show();
 }
        private async void LoadMore()
        {
            pageIndex++;
            var tempList = await listKbArticlesServer();

            kbArticlesList.AddRange(tempList);
            if (tempList.Count == 0)
            {
                return;
            }
            else if (kbArticlesList != null)
            {
                adapter.SetNewData(kbArticlesList);
                System.Diagnostics.Debug.Write("页数:" + pageIndex + "数据总条数:" + kbArticlesList.Count);
            }
        }
Beispiel #7
0
        private async void LoadMore()
        {
            pageIndex++;
            var tempList = await listBookmarkServer();

            bookMarkList.AddRange(tempList);
            if (tempList.Count == 0)
            {
                //adapter.SetFooterView(Resource.Layout.item_recyclerView_footer_empty);
                return;
            }
            else if (bookMarkList != null)
            {
                adapter.SetNewData(bookMarkList);
                System.Diagnostics.Debug.Write("页数:" + pageIndex + "数据总条数:" + bookMarkList.Count);
            }
        }
Beispiel #8
0
        private async void LoadMore()
        {
            pageIndex++;
            var result = await NewsService.ListNews(AccessTokenUtil.GetToken(this.Activity), pageIndex, position);

            if (result.Success)
            {
                var tempList = result.Data;
                newsList.AddRange(tempList);
                adapter.SetNewData(newsList);
                await SQLiteUtil.UpdateNewsList(tempList);
            }
            else
            {
                AlertUtil.ToastShort(Activity, result.Message);
            }
        }
 private async void LoadMore()
 {
     pageIndex++;
     await listSearchService((list) => {
         searchList.AddRange(list);
         adapter.SetNewData(searchList);
         System.Diagnostics.Debug.Write("页数:" + pageIndex + "数据总条数:" + searchList.Count);
     });
 }
Beispiel #10
0
        private async void LoadMore()
        {
            pageIndex++;
            var result = await NewsService.ListNewsComment(accessToken, POSTID, pageIndex);

            if (result.Success)
            {
                var tempList = result.Data;
                if (tempList != null && tempList.Count != 0)
                {
                    commentList.AddRange(tempList);
                    adapter.SetNewData(commentList);
                    System.Diagnostics.Debug.Write("页数:" + pageIndex + "数据总条数:" + commentList.Count);
                }
            }
            else
            {
                AlertUtil.ToastShort(this, result.Message);
            }
        }
Beispiel #11
0
        private async void LoadMore()
        {
            pageIndex++;
            var result = new ApiResult <List <StatusModel> >();

            if (isMy)
            {
                result = await StatusService.ListStatus(UserTokenUtil.GetToken(this.Activity), position, pageIndex, true);
            }
            else
            {
                if (position == 0)
                {
                    result = await StatusService.ListStatus(AccessTokenUtil.GetToken(this.Activity), position, pageIndex, false);
                }
                else
                {
                    result = await StatusService.ListStatus(UserTokenUtil.GetToken(this.Activity), position, pageIndex, false);
                }
            }
            if (result.Success)
            {
                var tempList = result.Data;
                statusList.AddRange(tempList);
                adapter.SetNewData(statusList);
                if (isMy)
                {
                    tempList.ForEach(f => f.MySelf = true);
                }
                await SQLiteUtil.UpdateStatusList(tempList);
            }
            else
            {
                AlertUtil.ToastShort(Activity, result.Message);
            }
        }
Beispiel #12
0
        private async void LoadMore()
        {
            pageIndex++;
            var result = await UserInfoService.GetMyBlogPosts(UserTokenUtil.GetToken(this), blogApp, pageIndex);

            if (result.Success)
            {
                var tempList = result.Data;
                tempList.ForEach(f => f.MySelf = true);
                await SQLiteUtil.UpdateArticleList(tempList);

                articleList.AddRange(tempList);
                adapter.SetNewData(articleList);
            }
            else
            {
                AlertUtil.ToastShort(this, result.Message);
            }
        }