summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/app/contactinfo/ContactPhotoLoader.java
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2017-12-27 17:02:37 -0800
committerCopybara-Service <copybara-piper@google.com>2017-12-27 17:03:47 -0800
commit183cb71663320f16149d83eeebaff7795a4b55f2 (patch)
treebc8bfcce809257b3ddbb423a9808082292b9f6a3 /java/com/android/dialer/app/contactinfo/ContactPhotoLoader.java
parentfc81a030a7b4f6d4a497f71aed593d398795e7da (diff)
Remove field prefixes.
Test: Existing tests PiperOrigin-RevId: 180230450 Change-Id: I0b2589cfeeaef81e42a04efa48af24b4e4d0e95f
Diffstat (limited to 'java/com/android/dialer/app/contactinfo/ContactPhotoLoader.java')
-rw-r--r--java/com/android/dialer/app/contactinfo/ContactPhotoLoader.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/java/com/android/dialer/app/contactinfo/ContactPhotoLoader.java b/java/com/android/dialer/app/contactinfo/ContactPhotoLoader.java
index 537acd060..be143bbca 100644
--- a/java/com/android/dialer/app/contactinfo/ContactPhotoLoader.java
+++ b/java/com/android/dialer/app/contactinfo/ContactPhotoLoader.java
@@ -43,12 +43,12 @@ import java.util.Objects;
*/
public class ContactPhotoLoader {
- private final Context mContext;
- private final ContactInfo mContactInfo;
+ private final Context context;
+ private final ContactInfo contactInfo;
public ContactPhotoLoader(Context context, ContactInfo contactInfo) {
- mContext = Objects.requireNonNull(context);
- mContactInfo = Objects.requireNonNull(contactInfo);
+ this.context = Objects.requireNonNull(context);
+ this.contactInfo = Objects.requireNonNull(contactInfo);
}
private static Bitmap drawableToBitmap(Drawable drawable, int width, int height) {
@@ -62,7 +62,7 @@ public class ContactPhotoLoader {
/** Create a contact photo icon bitmap appropriate for the ContactInfo. */
public Bitmap loadPhotoIcon() {
Assert.isWorkerThread();
- int photoSize = mContext.getResources().getDimensionPixelSize(R.dimen.contact_photo_size);
+ int photoSize = context.getResources().getDimensionPixelSize(R.dimen.contact_photo_size);
return drawableToBitmap(getIcon(), photoSize, photoSize);
}
@@ -81,11 +81,11 @@ public class ContactPhotoLoader {
*/
@Nullable
private Drawable createPhotoIconDrawable() {
- if (mContactInfo.photoUri == null) {
+ if (contactInfo.photoUri == null) {
return null;
}
try {
- InputStream input = mContext.getContentResolver().openInputStream(mContactInfo.photoUri);
+ InputStream input = context.getContentResolver().openInputStream(contactInfo.photoUri);
if (input == null) {
LogUtil.w(
"ContactPhotoLoader.createPhotoIconDrawable",
@@ -102,7 +102,7 @@ public class ContactPhotoLoader {
return null;
}
final RoundedBitmapDrawable drawable =
- RoundedBitmapDrawableFactory.create(mContext.getResources(), bitmap);
+ RoundedBitmapDrawableFactory.create(context.getResources(), bitmap);
drawable.setAntiAlias(true);
drawable.setCircular(true);
return drawable;
@@ -115,13 +115,13 @@ public class ContactPhotoLoader {
/** @return a {@link LetterTileDrawable} based on the ContactInfo. */
private Drawable createLetterTileDrawable() {
ContactInfoHelper helper =
- new ContactInfoHelper(mContext, GeoUtil.getCurrentCountryIso(mContext));
- LetterTileDrawable drawable = new LetterTileDrawable(mContext.getResources());
+ new ContactInfoHelper(context, GeoUtil.getCurrentCountryIso(context));
+ LetterTileDrawable drawable = new LetterTileDrawable(context.getResources());
drawable.setCanonicalDialerLetterTileDetails(
- mContactInfo.name,
- mContactInfo.lookupKey,
+ contactInfo.name,
+ contactInfo.lookupKey,
LetterTileDrawable.SHAPE_CIRCLE,
- helper.isBusiness(mContactInfo.sourceType)
+ helper.isBusiness(contactInfo.sourceType)
? LetterTileDrawable.TYPE_BUSINESS
: LetterTileDrawable.TYPE_DEFAULT);
return drawable;