diff options
Diffstat (limited to 'OpenKeychain')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java | 8 | ||||
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java | 17 | ||||
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyKeysFragment.java | 8 | ||||
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java | 8 | ||||
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java (renamed from OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java) | 4 | ||||
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java (renamed from OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java) | 23 | ||||
-rw-r--r-- | OpenKeychain/src/main/res/layout/edit_key_fragment.xml | 64 |
7 files changed, 103 insertions, 29 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java index 6c74818a5..db00d5f69 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java @@ -53,7 +53,7 @@ import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds; import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.PassphraseCacheService; -import org.sufficientlysecure.keychain.ui.adapter.ViewKeyUserIdsAdapter; +import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter; import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment; import org.sufficientlysecure.keychain.util.Log; @@ -75,7 +75,7 @@ public class CertifyKeyActivity extends ActionBarActivity implements private long mMasterKeyId = 0; private ListView mUserIds; - private ViewKeyUserIdsAdapter mUserIdsAdapter; + private UserIdsAdapter mUserIdsAdapter; private static final int LOADER_ID_KEYRING = 0; private static final int LOADER_ID_USER_IDS = 1; @@ -143,7 +143,7 @@ public class CertifyKeyActivity extends ActionBarActivity implements mUserIds = (ListView) findViewById(R.id.view_key_user_ids); - mUserIdsAdapter = new ViewKeyUserIdsAdapter(this, null, 0, true); + mUserIdsAdapter = new UserIdsAdapter(this, null, 0, true); mUserIds.setAdapter(mUserIdsAdapter); mUserIds.setOnItemClickListener(mUserIdsAdapter); @@ -175,7 +175,7 @@ public class CertifyKeyActivity extends ActionBarActivity implements case LOADER_ID_USER_IDS: { Uri uri = UserIds.buildUserIdsUri(mDataUri); return new CursorLoader(this, uri, - ViewKeyUserIdsAdapter.USER_IDS_PROJECTION, USER_IDS_SELECTION, null, null); + UserIdsAdapter.USER_IDS_PROJECTION, USER_IDS_SELECTION, null, null); } } return null; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java index 9231ce142..b3516f5d6 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java @@ -34,9 +34,8 @@ import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.helper.ActionBarHelper; import org.sufficientlysecure.keychain.provider.KeychainContract; -import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; -import org.sufficientlysecure.keychain.ui.adapter.ViewKeyKeysAdapter; -import org.sufficientlysecure.keychain.ui.adapter.ViewKeyUserIdsAdapter; +import org.sufficientlysecure.keychain.ui.adapter.SubkeysAdapter; +import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter; import org.sufficientlysecure.keychain.util.Log; public class EditKeyFragment extends LoaderFragment implements @@ -50,8 +49,8 @@ public class EditKeyFragment extends LoaderFragment implements private static final int LOADER_ID_USER_IDS = 0; private static final int LOADER_ID_KEYS = 1; - private ViewKeyUserIdsAdapter mUserIdsAdapter; - private ViewKeyKeysAdapter mKeysAdapter; + private UserIdsAdapter mUserIdsAdapter; + private SubkeysAdapter mKeysAdapter; private Uri mDataUri; @@ -128,9 +127,9 @@ public class EditKeyFragment extends LoaderFragment implements // }); - mUserIdsAdapter = new ViewKeyUserIdsAdapter(getActivity(), null, 0); + mUserIdsAdapter = new UserIdsAdapter(getActivity(), null, 0); mUserIds.setAdapter(mUserIdsAdapter); - mKeysAdapter = new ViewKeyKeysAdapter(getActivity(), null, 0); + mKeysAdapter = new SubkeysAdapter(getActivity(), null, 0); mKeys.setAdapter(mKeysAdapter); // Prepare the loaders. Either re-connect with an existing ones, @@ -146,13 +145,13 @@ public class EditKeyFragment extends LoaderFragment implements case LOADER_ID_USER_IDS: { Uri baseUri = KeychainContract.UserIds.buildUserIdsUri(mDataUri); return new CursorLoader(getActivity(), baseUri, - ViewKeyUserIdsAdapter.USER_IDS_PROJECTION, null, null, null); + UserIdsAdapter.USER_IDS_PROJECTION, null, null, null); } case LOADER_ID_KEYS: { Uri baseUri = KeychainContract.Keys.buildKeysUri(mDataUri); return new CursorLoader(getActivity(), baseUri, - ViewKeyKeysAdapter.KEYS_PROJECTION, null, null, null); + SubkeysAdapter.KEYS_PROJECTION, null, null, null); } default: diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyKeysFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyKeysFragment.java index e01a0140c..4be572b4e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyKeysFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyKeysFragment.java @@ -31,7 +31,7 @@ import android.widget.ListView; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.provider.KeychainContract.Keys; -import org.sufficientlysecure.keychain.ui.adapter.ViewKeyKeysAdapter; +import org.sufficientlysecure.keychain.ui.adapter.SubkeysAdapter; import org.sufficientlysecure.keychain.util.Log; @@ -42,7 +42,7 @@ public class ViewKeyKeysFragment extends LoaderFragment implements private ListView mKeys; - private ViewKeyKeysAdapter mKeysAdapter; + private SubkeysAdapter mKeysAdapter; private Uri mDataUri; @@ -75,7 +75,7 @@ public class ViewKeyKeysFragment extends LoaderFragment implements Log.i(Constants.TAG, "mDataUri: " + mDataUri.toString()); - mKeysAdapter = new ViewKeyKeysAdapter(getActivity(), null, 0); + mKeysAdapter = new SubkeysAdapter(getActivity(), null, 0); mKeys.setAdapter(mKeysAdapter); // Prepare the loaders. Either re-connect with an existing ones, @@ -87,7 +87,7 @@ public class ViewKeyKeysFragment extends LoaderFragment implements setContentShown(false); Uri baseUri = Keys.buildKeysUri(mDataUri); return new CursorLoader(getActivity(), baseUri, - ViewKeyKeysAdapter.KEYS_PROJECTION, null, null, null); + SubkeysAdapter.KEYS_PROJECTION, null, null, null); } public void onLoadFinished(Loader<Cursor> loader, Cursor data) { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java index bd29f3820..dd48f193c 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java @@ -38,7 +38,7 @@ import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds; import org.sufficientlysecure.keychain.provider.ProviderHelper; -import org.sufficientlysecure.keychain.ui.adapter.ViewKeyUserIdsAdapter; +import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter; import org.sufficientlysecure.keychain.util.Log; import java.util.Date; @@ -63,7 +63,7 @@ public class ViewKeyMainFragment extends LoaderFragment implements // conservative attitude private boolean mHasEncrypt = true; - private ViewKeyUserIdsAdapter mUserIdsAdapter; + private UserIdsAdapter mUserIdsAdapter; private Uri mDataUri; @@ -124,7 +124,7 @@ public class ViewKeyMainFragment extends LoaderFragment implements } }); - mUserIdsAdapter = new ViewKeyUserIdsAdapter(getActivity(), null, 0); + mUserIdsAdapter = new UserIdsAdapter(getActivity(), null, 0); mUserIds.setAdapter(mUserIdsAdapter); // Prepare the loaders. Either re-connect with an existing ones, @@ -154,7 +154,7 @@ public class ViewKeyMainFragment extends LoaderFragment implements case LOADER_ID_USER_IDS: { Uri baseUri = UserIds.buildUserIdsUri(mDataUri); return new CursorLoader(getActivity(), baseUri, - ViewKeyUserIdsAdapter.USER_IDS_PROJECTION, null, null, null); + UserIdsAdapter.USER_IDS_PROJECTION, null, null, null); } default: diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java index dae287bbc..6d8455589 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java @@ -35,7 +35,7 @@ import org.sufficientlysecure.keychain.provider.KeychainContract.Keys; import java.util.Date; -public class ViewKeyKeysAdapter extends CursorAdapter { +public class SubkeysAdapter extends CursorAdapter { private LayoutInflater mInflater; private int mIndexKeyId; @@ -69,7 +69,7 @@ public class ViewKeyKeysAdapter extends CursorAdapter { Keys.FINGERPRINT }; - public ViewKeyKeysAdapter(Context context, Cursor c, int flags) { + public SubkeysAdapter(Context context, Cursor c, int flags) { super(context, c, flags); mInflater = LayoutInflater.from(context); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java index 763752edc..77da1d0e3 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java @@ -34,10 +34,11 @@ import org.sufficientlysecure.keychain.helper.OtherHelper; import org.sufficientlysecure.keychain.pgp.KeyRing; import org.sufficientlysecure.keychain.provider.KeychainContract.Certs; import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds; +import org.sufficientlysecure.keychain.service.SaveKeyringParcel; import java.util.ArrayList; -public class ViewKeyUserIdsAdapter extends CursorAdapter implements AdapterView.OnItemClickListener { +public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemClickListener { private LayoutInflater mInflater; private int mIndexUserId, mIndexRank; @@ -45,6 +46,8 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter implements AdapterView. private final ArrayList<Boolean> mCheckStates; + private SaveKeyringParcel mSaveKeyringParcel; + public static final String[] USER_IDS_PROJECTION = new String[]{ UserIds._ID, UserIds.USER_ID, @@ -54,18 +57,27 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter implements AdapterView. UserIds.IS_REVOKED }; - public ViewKeyUserIdsAdapter(Context context, Cursor c, int flags, boolean showCheckBoxes) { + public UserIdsAdapter(Context context, Cursor c, int flags, boolean showCheckBoxes, + SaveKeyringParcel saveKeyringParcel) { super(context, c, flags); - mInflater = LayoutInflater.from(context); mCheckStates = showCheckBoxes ? new ArrayList<Boolean>() : null; + mSaveKeyringParcel = saveKeyringParcel; initIndex(c); } - public ViewKeyUserIdsAdapter(Context context, Cursor c, int flags) { - this(context, c, flags, false); + public UserIdsAdapter(Context context, Cursor c, int flags, boolean showCheckBoxes) { + this(context, c, flags, showCheckBoxes, null); + } + + public UserIdsAdapter(Context context, Cursor c, int flags, SaveKeyringParcel saveKeyringParcel) { + this(context, c, flags, false, saveKeyringParcel); + } + + public UserIdsAdapter(Context context, Cursor c, int flags) { + this(context, c, flags, false, null); } @Override @@ -181,7 +193,6 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter implements AdapterView. } }); vCheckBox.setClickable(false); - } public void onItemClick(AdapterView<?> adapter, View view, int position, long id) { diff --git a/OpenKeychain/src/main/res/layout/edit_key_fragment.xml b/OpenKeychain/src/main/res/layout/edit_key_fragment.xml index dbc0c3941..9d63ea38a 100644 --- a/OpenKeychain/src/main/res/layout/edit_key_fragment.xml +++ b/OpenKeychain/src/main/res/layout/edit_key_fragment.xml @@ -15,6 +15,30 @@ android:layout_height="0dp" android:layout_marginBottom="4dp" android:layout_marginTop="8dp" + android:text="Passphrase" + android:layout_weight="1" /> + + <TextView + android:id="@+id/edit_key_action_change_passphrase" + android:paddingLeft="8dp" + android:paddingRight="8dp" + android:textAppearance="?android:attr/textAppearanceMedium" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:text="change passphrase" + android:minHeight="?android:attr/listPreferredItemHeight" + android:drawableRight="@drawable/ic_action_edit" + android:drawablePadding="8dp" + android:gravity="center_vertical" + android:clickable="true" + style="@style/SelectableItem" /> + + <TextView + style="@style/SectionHeader" + android:layout_width="wrap_content" + android:layout_height="0dp" + android:layout_marginBottom="4dp" + android:layout_marginTop="8dp" android:text="@string/section_user_ids" android:layout_weight="1" /> @@ -25,6 +49,26 @@ android:layout_marginBottom="4dp" android:layout_weight="1" /> + <View + android:layout_width="match_parent" + android:layout_height="1dip" + android:background="?android:attr/listDivider" /> + + <TextView + android:id="@+id/edit_key_add_user_id" + android:paddingLeft="8dp" + android:paddingRight="8dp" + android:textAppearance="?android:attr/textAppearanceMedium" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:text="add identity" + android:minHeight="?android:attr/listPreferredItemHeight" + android:drawableRight="@drawable/ic_action_add_person" + android:drawablePadding="8dp" + android:gravity="center_vertical" + android:clickable="true" + style="@style/SelectableItem" /> + <TextView style="@style/SectionHeader" android:layout_width="wrap_content" @@ -39,6 +83,26 @@ android:layout_height="wrap_content" android:layout_marginBottom="8dp" /> + <View + android:layout_width="match_parent" + android:layout_height="1dip" + android:background="?android:attr/listDivider" /> + + <TextView + android:id="@+id/edit_key_action_add_key" + android:paddingLeft="8dp" + android:paddingRight="8dp" + android:textAppearance="?android:attr/textAppearanceMedium" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:text="add key" + android:minHeight="?android:attr/listPreferredItemHeight" + android:drawableRight="@drawable/ic_action_add_person" + android:drawablePadding="8dp" + android:gravity="center_vertical" + android:clickable="true" + style="@style/SelectableItem" /> + </LinearLayout> </ScrollView> |