Esempio n. 1
0
 private void setBroadcastRefreshing(boolean refreshing) {
   mSwipeRefreshLayout.setEnabled(!refreshing);
   if (!refreshing) {
     mSwipeRefreshLayout.setRefreshing(false);
   }
   ViewUtils.setVisibleOrGone(mProgress, refreshing && mBroadcastAdapter.getItemCount() == 0);
 }
Esempio n. 2
0
  @Override
  public void onStart() {
    super.onStart();

    // Only auto-load when initially empty, not loaded but empty.
    boolean autoLoadComments = mCommentAdapter.getItemCount() == 0 && mCanLoadMoreComments;
    if (mBroadcastAdapter.getItemCount() == 0) {
      loadBroadcast(autoLoadComments);
    } else if (autoLoadComments) {
      loadCommentList(false);
    }

    EventBus.getDefault().register(this);
  }