EladKeyshawn has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/287408

Change subject: Added: action mode counter on History multiple selection 
(Google guideline)
......................................................................

Added: action mode counter on History multiple selection (Google guideline)

Change-Id: I05eb88f8adffe88b0f3c9896ce4275582dcb4555
---
M app/src/main/java/org/wikipedia/history/HistoryFragment.java
1 file changed, 13 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/08/287408/1

diff --git a/app/src/main/java/org/wikipedia/history/HistoryFragment.java 
b/app/src/main/java/org/wikipedia/history/HistoryFragment.java
index cd13c2a..02f94b2 100644
--- a/app/src/main/java/org/wikipedia/history/HistoryFragment.java
+++ b/app/src/main/java/org/wikipedia/history/HistoryFragment.java
@@ -60,7 +60,6 @@
     private HistorySearchTextWatcher textWatcher = new 
HistorySearchTextWatcher();
     private HistoryItemClickListener itemClickListener = new 
HistoryItemClickListener();
     private HistoryItemLongClickListener itemLongClickListener = new 
HistoryItemLongClickListener();
-
     private boolean firstRun = true;
 
     @Override
@@ -214,6 +213,9 @@
                 HistoryEntry newEntry = new HistoryEntry(oldEntry.getTitle(), 
HistoryEntry.SOURCE_HISTORY);
                 ((PageActivity) getActivity()).loadPage(oldEntry.getTitle(), 
newEntry);
             }
+            else{
+                actionMode.invalidate();
+            }
         }
     }
 
@@ -233,12 +235,22 @@
                 @Override
                 public boolean onCreateActionMode(ActionMode mode, Menu menu) {
                     
mode.getMenuInflater().inflate(R.menu.menu_history_context, menu);
+                    
mode.setTitle(Integer.toString(historyEntryList.getCheckedItemCount() + 1));
                     return true;
                 }
 
                 @Override
                 public boolean onPrepareActionMode(ActionMode mode, Menu menu) 
{
                     mode.setTag(actionModeTag);
+                    int count = historyEntryList.getCheckedItemCount();
+                    if ( actionMode != null) {
+                        if(count == 0){
+                            mode.finish();
+                        }
+                        else {
+                            actionMode.setTitle(Integer.toString(count));
+                        }
+                    }
                     return false;
                 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/287408
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05eb88f8adffe88b0f3c9896ce4275582dcb4555
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: EladKeyshawn <elad....@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to