diff options
author | Matthew Wong <wongma@protonmail.ch> | 2015-07-17 22:18:41 -0400 |
---|---|---|
committer | Matthew Wong <wongma@protonmail.ch> | 2015-07-17 22:18:41 -0400 |
commit | 395309e39e591c7ae76c27027b696456efd5b21a (patch) | |
tree | 09bfbcc587bf32f78f3629a6113f41d728e49977 /app/src/main/java/com | |
parent | 61ae170f6cef761407216dcf545ebb80410ca023 (diff) |
Use android support library (for fab)
Diffstat (limited to 'app/src/main/java/com')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java | 11 | ||||
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/PasswordStore.java | 2 |
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)) |