void SuperSwipeRefreshLayout.IOnPushLoadMoreListener.OnLoadMore() { _context._footerTextView.Text = "讀取更多資料中..."; _context._footerImageView.Visibility = ViewStates.Gone; _context._footerProgressBar.Visibility = ViewStates.Visible; Action myAction = () => { _context._footerImageView.Visibility = ViewStates.Visible; _context._progressBar.Visibility = ViewStates.Gone; _context._swipeRefreshLayout.SetLoadMore(false); //資料讀取更多資料完成後,需更新畫面 _context._myRecyclerAdapter.NotifyDataSetChanged(); }; new Handler().PostDelayed(myAction, 5000); //模擬讀取更多資料 //Begin _context.BuildDatas(); //End }
void SuperSwipeRefreshLayout.IOnPullRefreshListener.OnRefresh() { _context._textView.Text = "資料更新中..."; _context._imageView.Visibility = ViewStates.Gone; _context._progressBar.Visibility = ViewStates.Visible; Action myAction = () => { _context._swipeRefreshLayout.SetRefreshing(false); _context._progressBar.Visibility = ViewStates.Gone; //更新資料完成後,需更新畫面 _context._myRecyclerAdapter.NotifyDataSetChanged(); }; new Handler().PostDelayed(myAction, 2000); //模擬更新資料 //Begin _context._dataList.Clear(); _context.BuildDatas(); //End }