diff --git a/WordPress/src/main/java/org/wordpress/android/ui/reader/ReaderPostListFragment.java b/WordPress/src/main/java/org/wordpress/android/ui/reader/ReaderPostListFragment.java index e3af29ddc576..7cb81395cab2 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/reader/ReaderPostListFragment.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/reader/ReaderPostListFragment.java @@ -347,6 +347,7 @@ private void resetPostAdapter(ReaderPostListType postListType) { mPostAdapter = null; mRecyclerView.setAdapter(null); mRecyclerView.setAdapter(getPostAdapter()); + mRecyclerView.setSwipeToRefreshEnabled(isSwipeToRefreshSupported()); } @SuppressWarnings("unused") @@ -514,6 +515,8 @@ public void onShowCustomEmptyView (EmptyViewMessageType emptyViewMsgType) { setupRecyclerToolbar(); } + mRecyclerView.setSwipeToRefreshEnabled(isSwipeToRefreshSupported()); + // bar that appears at top after new posts are loaded mNewPostsBar = rootView.findViewById(R.id.layout_new_posts); mNewPostsBar.setVisibility(View.GONE); @@ -1298,10 +1301,18 @@ private void setIsUpdating(boolean isUpdating, UpdateAction updateAction) { // if swipe-to-refresh isn't active, keep it disabled during an update - this prevents // doing a refresh while another update is already in progress if (mRecyclerView != null && !mRecyclerView.isRefreshing()) { - mRecyclerView.setSwipeToRefreshEnabled(!isUpdating); + mRecyclerView.setSwipeToRefreshEnabled(!isUpdating && isSwipeToRefreshSupported()); } } + /* + * swipe-to-refresh isn't supported for search results since they're really brief snapshots + * and are unlikely to show new posts due to the way they're sorted by score + */ + private boolean isSwipeToRefreshSupported() { + return getPostListType() != ReaderPostListType.SEARCH_RESULTS; + } + /* * bar that appears at the top when new posts have been retrieved */