diff options
Diffstat (limited to 'app/src')
4 files changed, 12 insertions, 18 deletions
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/SelectFolderFragment.java b/app/src/main/java/com/zeapo/pwdstore/SelectFolderFragment.java index f4a91425..8f583a8a 100644 --- a/app/src/main/java/com/zeapo/pwdstore/SelectFolderFragment.java +++ b/app/src/main/java/com/zeapo/pwdstore/SelectFolderFragment.java @@ -33,9 +33,7 @@ public class SelectFolderFragment extends Fragment{ } // store the pass files list in a stack - private Stack<ArrayList<PasswordItem>> passListStack; private Stack<File> pathStack; - private Stack<Integer> scrollPosition; private FolderRecyclerAdapter recyclerAdapter; private RecyclerView recyclerView; private OnFragmentInteractionListener mListener; @@ -51,8 +49,6 @@ public class SelectFolderFragment extends Fragment{ super.onCreate(savedInstanceState); String path = getArguments().getString("Path"); - passListStack = new Stack<>(); - scrollPosition = new Stack<>(); pathStack = new Stack<>(); recyclerAdapter = new FolderRecyclerAdapter((SelectFolderActivity) getActivity(), mListener, PasswordRepository.getPasswords(new File(path), PasswordRepository.getRepositoryDirectory(getActivity()))); @@ -72,14 +68,8 @@ public class SelectFolderFragment extends Fragment{ // Set the adapter recyclerView.setAdapter(recyclerAdapter); - - final FloatingActionButton fab = (FloatingActionButton) view.findViewById(R.id.fab); - fab.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - ((PasswordStore) getActivity()).createPassword(); - } - }); + FloatingActionButton fab = (FloatingActionButton) view.findViewById(R.id.fab); + if (fab != null) fab.setVisibility(View.GONE); registerForContextMenu(recyclerView); return view; @@ -92,13 +82,8 @@ public class SelectFolderFragment extends Fragment{ mListener = new OnFragmentInteractionListener() { public void onFragmentInteraction(PasswordItem item) { if (item.getType() == PasswordItem.TYPE_CATEGORY) { - // push the current password list (non filtered plz!) - passListStack.push(pathStack.isEmpty() ? - PasswordRepository.getPasswords(PasswordRepository.getRepositoryDirectory(context)) : - PasswordRepository.getPasswords(pathStack.peek(), PasswordRepository.getRepositoryDirectory(context))); //push the category were we're going pathStack.push(item.getFile()); - scrollPosition.push(recyclerView.getVerticalScrollbarPosition()); recyclerView.scrollToPosition(0); recyclerAdapter.clear(); 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) |