From 3f5e93e5c30c937fe1efd10f947f538fcf7cb1a4 Mon Sep 17 00:00:00 2001 From: Zeapo Date: Sun, 27 Jul 2014 22:39:16 +0100 Subject: Inform the main activity that an item has been clicked, will handle it later --- app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java | 2 +- app/src/main/java/com/zeapo/pwdstore/PasswordStore.java | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java b/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java index 2f9f655b..de5b0a58 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java @@ -88,7 +88,7 @@ public class PasswordFragment extends Fragment implements AbsListView.OnItemClic if (null != mListener) { // Notify the active callbacks interface (the activity, if the // fragment is attached to one) that an item has been selected. -// mListener.onFragmentInteraction(DummyContent.ITEMS.get(position).id); + mListener.onFragmentInteraction((String) mAdapter.getItem(position)); } } diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java index a31fa50e..9e45b38a 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java @@ -50,6 +50,7 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI checkLocalRepository(); Repository repository = PasswordRepository.getRepository(new File(getFilesDir() + "/store/.git")); PasswordRepository.getFilesList(); + PasswordRepository.getPasswords(); } @Override @@ -82,11 +83,6 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI } - @Override - public void onFragmentInteraction(String id) { - - } - private void checkLocalRepository() { int status = 0; final File localDir = new File(getFilesDir() + "/store/.git"); @@ -116,4 +112,10 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI } } + /* If an item is clicked in the list of passwords, this will be triggered */ + @Override + public void onFragmentInteraction(String id) { + System.out.println(id + " Clicked"); + } + } -- cgit v1.2.3