From 639031737f6cbfd2c9cf3bcede8d1c85e9ddac67 Mon Sep 17 00:00:00 2001 From: zeapo Date: Sun, 19 Oct 2014 18:14:35 +0200 Subject: nicer layout for pass list --- .../java/com/zeapo/pwdstore/PasswordFragment.java | 4 +++- .../java/com/zeapo/pwdstore/crypto/PgpHandler.java | 7 +++--- .../pwdstore/utils/PasswordRecyclerAdapter.java | 26 ++++++++++++++++++++-- 3 files changed, 30 insertions(+), 7 deletions(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java b/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java index 67e3e858..615087c8 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.java @@ -74,7 +74,7 @@ public class PasswordFragment extends Fragment{ } @Override - public void onAttach(Activity activity) { + public void onAttach(final Activity activity) { super.onAttach(activity); try { mListener = new OnFragmentInteractionListener() { @@ -89,6 +89,8 @@ public class PasswordFragment extends Fragment{ ((ActionBarActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true); + } else { + ((PasswordStore) getActivity()).decryptPassword(item); } } diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java index efeabc3e..39010a53 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java @@ -31,6 +31,7 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.SystemClock; import android.preference.PreferenceManager; +import android.support.v7.app.ActionBarActivity; import android.text.TextUtils; import android.util.Log; import android.view.Menu; @@ -46,7 +47,7 @@ import com.zeapo.pwdstore.R; import com.zeapo.pwdstore.UserPreference; import com.zeapo.pwdstore.utils.PasswordRepository; -public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnBound{ +public class PgpHandler extends ActionBarActivity implements OpenPgpServiceConnection.OnBound{ private OpenPgpServiceConnection mServiceConnection; @@ -109,9 +110,7 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB bindingDialog.show(); registered = true; - - ActionBar actionBar = getActionBar(); - actionBar.setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); } } 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 47bcb41b..eb611995 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRecyclerAdapter.java +++ b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRecyclerAdapter.java @@ -1,5 +1,6 @@ package com.zeapo.pwdstore.utils; +import android.graphics.Color; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; @@ -57,8 +58,29 @@ public class PasswordRecyclerAdapter extends RecyclerView.Adapter