mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-24 15:31:47 -05:00
cleaned up code, added comments
optimised imports
This commit is contained in:
parent
f8a6f814dd
commit
012b7e4830
@ -20,7 +20,6 @@ package org.sufficientlysecure.keychain.ui;
|
|||||||
|
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.graphics.Bitmap;
|
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_UNIFIED = 0;
|
||||||
private static final int LOADER_ID_USER_IDS = 1;
|
private static final int LOADER_ID_USER_IDS = 1;
|
||||||
private static final int LOADER_ID_SYSTEM_CONTACT = 2;
|
|
||||||
|
|
||||||
private UserIdsAdapter mUserIdsAdapter;
|
private UserIdsAdapter mUserIdsAdapter;
|
||||||
|
|
||||||
@ -98,14 +96,7 @@ public class ViewKeyFragment extends LoaderFragment implements
|
|||||||
mSystemContactLayout = (LinearLayout) view.findViewById(R.id.system_contact_layout);
|
mSystemContactLayout = (LinearLayout) view.findViewById(R.id.system_contact_layout);
|
||||||
mSystemContactName = (TextView) view.findViewById(R.id.system_contact_name);
|
mSystemContactName = (TextView) view.findViewById(R.id.system_contact_name);
|
||||||
mSystemContactPicture = (ImageView) view.findViewById(R.id.system_contact_picture);
|
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;
|
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) {
|
private void loadLinkedSystemContact(String name, final long masterKeyId) {
|
||||||
final Context context = mSystemContactName.getContext();
|
final Context context = mSystemContactName.getContext();
|
||||||
final ContentResolver resolver = context.getContentResolver();
|
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) {
|
private void launchContactActivity(final long contactId, Context context) {
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(contactId));
|
Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(contactId));
|
||||||
|
@ -270,6 +270,7 @@ public class ContactHelper {
|
|||||||
/**
|
/**
|
||||||
* returns the CONTACT_ID of the raw contact to which a masterKeyId is associated, if the
|
* returns the CONTACT_ID of the raw contact to which a masterKeyId is associated, if the
|
||||||
* raw contact has not been marked for deletion
|
* raw contact has not been marked for deletion
|
||||||
|
*
|
||||||
* @param resolver
|
* @param resolver
|
||||||
* @param masterKeyId
|
* @param masterKeyId
|
||||||
* @return CONTACT_ID (id of aggregated contact) linked to masterKeyId
|
* @return CONTACT_ID (id of aggregated contact) linked to masterKeyId
|
||||||
|
Loading…
x
Reference in New Issue
Block a user