Loading src/com/android/contacts/editor/CompactPhotoEditorView.java +8 −5 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ public class CompactPhotoEditorView extends RelativeLayout implements View.OnCli private View mPhotoIcon; private View mPhotoIconOverlay; private View mPhotoTouchInterceptOverlay; private MaterialPalette mMaterialPalette; private boolean mReadOnly; private boolean mIsNonDefaultPhotoBound; Loading Loading @@ -122,12 +123,16 @@ public class CompactPhotoEditorView extends RelativeLayout implements View.OnCli } } public void setPalette(MaterialPalette palette) { mMaterialPalette = palette; } /** * Tries to bind a full size photo or a bitmap loaded from the given ValuesDelta, * and falls back to the default avatar, tinted using the given MaterialPalette (if it's not * null); */ public void setPhoto(ValuesDelta valuesDelta, MaterialPalette materialPalette) { public void setPhoto(ValuesDelta valuesDelta) { // Check if we can update to the full size photo immediately final Long photoFileId = EditorUiUtils.getPhotoFileId(valuesDelta); if (photoFileId != null) { Loading @@ -146,7 +151,7 @@ public class CompactPhotoEditorView extends RelativeLayout implements View.OnCli return; } setDefaultPhoto(materialPalette); setDefaultPhoto(mMaterialPalette); adjustDimensions(); } Loading Loading @@ -223,9 +228,7 @@ public class CompactPhotoEditorView extends RelativeLayout implements View.OnCli * Removes the current bound photo bitmap. */ public void removePhoto() { mPhotoImageView.setImageBitmap(/* bitmap =*/ null); mIsNonDefaultPhotoBound = false; setDefaultPhoto(/* materialPalette =*/ null); setDefaultPhoto(mMaterialPalette); } @Override Loading src/com/android/contacts/editor/CompactRawContactsEditorView.java +3 −1 Original line number Diff line number Diff line Loading @@ -384,6 +384,7 @@ public class CompactRawContactsEditorView extends LinearLayout implements View.O public void removePhoto() { mPhotoValuesDelta.setFromTemplate(true); mPhotoValuesDelta.put(Photo.PHOTO, (byte[]) null); mPhotoValuesDelta.put(Photo.PHOTO_FILE_ID, (String) null); mPhotoView.removePhoto(); } Loading Loading @@ -940,7 +941,8 @@ public class CompactRawContactsEditorView extends LinearLayout implements View.O return; } // Set the photo view mPhotoView.setPhoto(superPrimaryDelta, mMaterialPalette); mPhotoView.setPalette(mMaterialPalette); mPhotoView.setPhoto(superPrimaryDelta); if (isReadOnlyRawContact()) { mPhotoView.setReadOnly(true); Loading Loading
src/com/android/contacts/editor/CompactPhotoEditorView.java +8 −5 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ public class CompactPhotoEditorView extends RelativeLayout implements View.OnCli private View mPhotoIcon; private View mPhotoIconOverlay; private View mPhotoTouchInterceptOverlay; private MaterialPalette mMaterialPalette; private boolean mReadOnly; private boolean mIsNonDefaultPhotoBound; Loading Loading @@ -122,12 +123,16 @@ public class CompactPhotoEditorView extends RelativeLayout implements View.OnCli } } public void setPalette(MaterialPalette palette) { mMaterialPalette = palette; } /** * Tries to bind a full size photo or a bitmap loaded from the given ValuesDelta, * and falls back to the default avatar, tinted using the given MaterialPalette (if it's not * null); */ public void setPhoto(ValuesDelta valuesDelta, MaterialPalette materialPalette) { public void setPhoto(ValuesDelta valuesDelta) { // Check if we can update to the full size photo immediately final Long photoFileId = EditorUiUtils.getPhotoFileId(valuesDelta); if (photoFileId != null) { Loading @@ -146,7 +151,7 @@ public class CompactPhotoEditorView extends RelativeLayout implements View.OnCli return; } setDefaultPhoto(materialPalette); setDefaultPhoto(mMaterialPalette); adjustDimensions(); } Loading Loading @@ -223,9 +228,7 @@ public class CompactPhotoEditorView extends RelativeLayout implements View.OnCli * Removes the current bound photo bitmap. */ public void removePhoto() { mPhotoImageView.setImageBitmap(/* bitmap =*/ null); mIsNonDefaultPhotoBound = false; setDefaultPhoto(/* materialPalette =*/ null); setDefaultPhoto(mMaterialPalette); } @Override Loading
src/com/android/contacts/editor/CompactRawContactsEditorView.java +3 −1 Original line number Diff line number Diff line Loading @@ -384,6 +384,7 @@ public class CompactRawContactsEditorView extends LinearLayout implements View.O public void removePhoto() { mPhotoValuesDelta.setFromTemplate(true); mPhotoValuesDelta.put(Photo.PHOTO, (byte[]) null); mPhotoValuesDelta.put(Photo.PHOTO_FILE_ID, (String) null); mPhotoView.removePhoto(); } Loading Loading @@ -940,7 +941,8 @@ public class CompactRawContactsEditorView extends LinearLayout implements View.O return; } // Set the photo view mPhotoView.setPhoto(superPrimaryDelta, mMaterialPalette); mPhotoView.setPalette(mMaterialPalette); mPhotoView.setPhoto(superPrimaryDelta); if (isReadOnlyRawContact()) { mPhotoView.setReadOnly(true); Loading