From 1c43d6c7e4592b82f719cbd088961a137d498383 Mon Sep 17 00:00:00 2001 From: zeapo Date: Sun, 10 Sep 2017 16:25:54 +0200 Subject: dismiss action mode after we've finished moving passwords --- app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java | 6 ++++++ app/src/main/java/com/zeapo/pwdstore/PasswordStore.java | 3 +++ .../main/java/com/zeapo/pwdstore/utils/PasswordRecyclerAdapter.java | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java b/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java index 646e44c7..2b0fa7c1 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java @@ -217,4 +217,10 @@ public class PasswordFragment extends Fragment{ public boolean isNotEmpty() { return !passListStack.isEmpty(); } + + public void dismissActionMode() { + if (recyclerAdapter != null && recyclerAdapter.mActionMode != null) { + recyclerAdapter.mActionMode.finish(); + } + } } diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java index 5f4e3096..acfadf99 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java @@ -655,6 +655,9 @@ public class PasswordStore extends AppCompatActivity { } } updateListAdapter(); + if (plist != null) { + plist.dismissActionMode(); + } break; } } diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRecyclerAdapter.java b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRecyclerAdapter.java index 01ee0a98..3e5e1c74 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRecyclerAdapter.java +++ b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRecyclerAdapter.java @@ -17,7 +17,7 @@ import java.util.TreeSet; public class PasswordRecyclerAdapter extends EntryRecyclerAdapter { private final PasswordStore activity; private final PasswordFragment.OnFragmentInteractionListener listener; - private ActionMode mActionMode; + public ActionMode mActionMode; private Boolean canEdit; // Provide a suitable constructor (depends on the kind of dataset) -- cgit v1.2.3