diff options
author | Adithya Abraham Philip <adithyaphilip@gmail.com> | 2015-03-10 01:27:33 +0530 |
---|---|---|
committer | Adithya Abraham Philip <adithyaphilip@gmail.com> | 2015-03-10 01:33:55 +0530 |
commit | 012b7e4830e9a52b896c17c98af68db5ade2e333 (patch) | |
tree | 0fc9471055469eb89c480f214ad0eebd38571b02 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain | |
parent | f8a6f814dd4f4e015707085c297b91abf237ed14 (diff) | |
download | open-keychain-012b7e4830e9a52b896c17c98af68db5ade2e333.tar.gz open-keychain-012b7e4830e9a52b896c17c98af68db5ade2e333.tar.bz2 open-keychain-012b7e4830e9a52b896c17c98af68db5ade2e333.zip |
cleaned up code, added comments
optimised imports
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyFragment.java | 24 | ||||
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ContactHelper.java | 1 |
2 files changed, 16 insertions, 9 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyFragment.java index f4cbe88a9..bb3df2541 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyFragment.java @@ -20,7 +20,6 @@ package org.sufficientlysecure.keychain.ui; import android.content.ContentResolver; import android.content.Context; -import android.content.DialogInterface; import android.content.Intent; import android.database.Cursor; import android.graphics.Bitmap; @@ -62,7 +61,6 @@ public class ViewKeyFragment extends LoaderFragment implements private static final int LOADER_ID_UNIFIED = 0; private static final int LOADER_ID_USER_IDS = 1; - private static final int LOADER_ID_SYSTEM_CONTACT = 2; private UserIdsAdapter mUserIdsAdapter; @@ -98,14 +96,7 @@ public class ViewKeyFragment extends LoaderFragment implements mSystemContactLayout = (LinearLayout) view.findViewById(R.id.system_contact_layout); mSystemContactName = (TextView) view.findViewById(R.id.system_contact_name); mSystemContactPicture = (ImageView) view.findViewById(R.id.system_contact_picture); - // mLinkedSystemContact = (ListView) view.findViewById(R.id.view_key_linked_system_contact); - /* mLinkedSystemContact.setOnItemClickListener(new AdapterView.OnItemClickListener() { - @Override - public void onItemClick(AdapterView<?> parent, View view, int position, long id) { - showSystemContact(position); - } - });*/ return root; } @@ -125,6 +116,13 @@ public class ViewKeyFragment extends LoaderFragment implements } } + /** + * Checks if a system contact exists for given masterKeyId, and if it does, sets name, picture + * and onClickListener for the linked system contact's layout + * + * @param name + * @param masterKeyId + */ private void loadLinkedSystemContact(String name, final long masterKeyId) { final Context context = mSystemContactName.getContext(); final ContentResolver resolver = context.getContentResolver(); @@ -146,6 +144,14 @@ public class ViewKeyFragment extends LoaderFragment implements } } + /** + * launches the default android Contacts app to view a contact with the passed + * contactId (CONTACT_ID column from ContactsContract.RawContact table which is _ID column in + * ContactsContract.Contact table) + * + * @param contactId _ID for row in ContactsContract.Contacts table + * @param context + */ private void launchContactActivity(final long contactId, Context context) { Intent intent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(contactId)); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ContactHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ContactHelper.java index f1ed36a8d..a7b5c2983 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ContactHelper.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ContactHelper.java @@ -270,6 +270,7 @@ public class ContactHelper { /** * returns the CONTACT_ID of the raw contact to which a masterKeyId is associated, if the * raw contact has not been marked for deletion + * * @param resolver * @param masterKeyId * @return CONTACT_ID (id of aggregated contact) linked to masterKeyId |