aboutsummaryrefslogtreecommitdiff
path: root/WordPress/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'WordPress/src/main')
-rw-r--r--WordPress/src/main/java/org/wordpress/android/ui/reader/ReaderPostListFragment.java15
1 files changed, 11 insertions, 4 deletions
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 89bc772a9..aa17a871d 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
@@ -541,17 +541,20 @@ public class ReaderPostListFragment extends Fragment
mSearchView.setIconifiedByDefault(false);
mSearchView.setIconified(true);
- // toggle settings icon when search expands/collapses
MenuItemCompat.setOnActionExpandListener(mSearchMenuItem, new MenuItemCompat.OnActionExpandListener() {
@Override
public boolean onMenuItemActionExpand(MenuItem item) {
+ // hide settings icon and clear post list when search input is expanded
mSettingsMenuItem.setVisible(false);
+ getPostAdapter().clear();
return true;
}
@Override
public boolean onMenuItemActionCollapse(MenuItem item) {
+ // redisplay settings icon and reload post list when search input is collapsed
mSettingsMenuItem.setVisible(true);
+ reloadPosts();
return true;
}
});
@@ -577,6 +580,12 @@ public class ReaderPostListFragment extends Fragment
}
/*
+ * is the search input showing?
+ */
+ private boolean isSearchViewExpanded() {
+ return mSearchView != null && !mSearchView.isIconified();
+ }
+ /*
* called when user taps follow item in popup menu for a post
*/
private void toggleFollowStatusForPost(final ReaderPost post) {
@@ -1258,9 +1267,7 @@ public class ReaderPostListFragment extends Fragment
*/
@Override
public void onShowPostPopup(View view, final ReaderPost post) {
- if (view == null || post == null || !isAdded()) {
- return;
- }
+ if (view == null || post == null || !isAdded()) return;
Context context = view.getContext();
final ListPopupWindow listPopup = new ListPopupWindow(context);