aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java11
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/PasswordStore.java2
2 files changed, 9 insertions, 4 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java b/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java
index 07ed9895..7d54edf2 100644
--- a/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java
+++ b/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java
@@ -5,6 +5,7 @@ import android.app.Fragment;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
+import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
@@ -13,7 +14,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import com.melnykov.fab.FloatingActionButton;
import com.zeapo.pwdstore.utils.PasswordItem;
import com.zeapo.pwdstore.utils.PasswordRecyclerAdapter;
import com.zeapo.pwdstore.utils.PasswordRepository;
@@ -78,8 +78,13 @@ public class PasswordFragment extends Fragment{
// // Set the adapter
recyclerView.setAdapter(recyclerAdapter);
- FloatingActionButton fab = (FloatingActionButton) view.findViewById(R.id.fab);
- fab.attachToRecyclerView(recyclerView);
+ final FloatingActionButton fab = (FloatingActionButton) view.findViewById(R.id.fab);
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ((PasswordStore) getActivity()).createPassword();
+ }
+ });
registerForContextMenu(recyclerView);
return view;
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java
index 5562f0b9..57386c00 100644
--- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java
+++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java
@@ -353,7 +353,7 @@ public class PasswordStore extends AppCompatActivity {
startActivityForResult(intent, PgpHandler.REQUEST_CODE_DECRYPT_AND_VERIFY);
}
- public void createPassword(View v) {
+ public void createPassword() {
if (!PasswordRepository.isInitialized()) {
new AlertDialog.Builder(this)
.setMessage(this.getResources().getString(R.string.creation_dialog_text))