added some documentation

This commit is contained in:
Adithya Abraham Philip
2015-03-13 04:49:34 +05:30
parent 759009ddb4
commit d7ef2c1b9e
2 changed files with 87 additions and 27 deletions

View File

@@ -121,6 +121,7 @@ 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
* In the case of a secret key, "me" contact details are loaded
*
* @param masterKeyId
*/
@@ -131,10 +132,10 @@ public class ViewKeyFragment extends LoaderFragment implements
long contactId;
String contactName = null;
if(mIsSecret) {
if (mIsSecret) {//all secret keys are linked to "me" profile in contacts
contactId = ContactHelper.getMainProfileContactId(resolver);
List<String> mainProfileNames = ContactHelper.getMainProfileContactName(context);
if(mainProfileNames!=null) contactName = mainProfileNames.get(0);
if (mainProfileNames != null) contactName = mainProfileNames.get(0);
} else {
contactId = ContactHelper.findContactId(resolver, masterKeyId);
@@ -145,10 +146,10 @@ public class ViewKeyFragment extends LoaderFragment implements
mSystemContactName.setText(contactName);
Bitmap picture;
if(mIsSecret) {
if (mIsSecret) {
picture = ContactHelper.loadMainProfilePhoto(resolver, false);
} else {
picture = ContactHelper.loadPhotoByMasterKeyId(resolver,masterKeyId,false);
picture = ContactHelper.loadPhotoByMasterKeyId(resolver, masterKeyId, false);
}
if (picture != null) mSystemContactPicture.setImageBitmap(picture);