コード例 #1
0
ファイル: SubmissionsView.java プロジェクト: KonradIT/Slide
  public void doAdapter(boolean force18) {
    mSwipeRefreshLayout.post(
        new Runnable() {
          @Override
          public void run() {
            if (posts == null || (posts != null && !posts.offline))
              mSwipeRefreshLayout.setRefreshing(true);
          }
        });

    posts = new SubredditPosts(id, getContext(), force18);
    adapter = new SubmissionAdapter(getActivity(), posts, rv, id, this);
    rv.setAdapter(adapter);
    posts.loadMore(mSwipeRefreshLayout.getContext(), this, true);
    mSwipeRefreshLayout.setOnRefreshListener(
        new SwipeRefreshLayout.OnRefreshListener() {
          @Override
          public void onRefresh() {
            refresh();
          }
        });
  }
コード例 #2
0
ファイル: SubmissionsView.java プロジェクト: KonradIT/Slide
 private void refresh() {
   posts.forced = true;
   forced = true;
   posts.loadMore(mSwipeRefreshLayout.getContext(), this, true, id);
 }