Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86aef0cd authored by Gary Mai's avatar Gary Mai Committed by android-build-merger
Browse files

Update editor photo view green lines

am: ef6ceb27

Change-Id: Ic66b0a3c9f8165733d281610c4c0ea1d46dea493
parents 93f878f8 ef6ceb27
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -848,8 +848,11 @@
    <!-- Button to expand the contact editor to show all available input fields. [CHAR LIMIT=60] -->
    <string name="editor_more_fields">More fields</string>

    <!-- Content description for the contact editor photo overlay which, when clicked, shows a dialog with the options for changing the contact photo. [CHAR LIMIT=30] -->
    <string name="editor_change_photo_content_description">Change photo</string>
    <!-- Content description for the contact editor photo overlay which, when clicked, shows a dialog with the options for changing the contact photo. [CHAR LIMIT=NONE] -->
    <string name="editor_change_photo_content_description">Change contact photo</string>

    <!-- Content description for the contact editor photo overlay which, when clicked, shows a dialog with the options for adding a contact photo. [CHAR LIMIT=NONE] -->
    <string name="editor_add_photo_content_description">Add contact photo</string>

    <!-- Accessibility content description, describes the image as being the photo for the contact the user is viewing. [CHAR LIMIT=NONE] -->
    <string name="editor_contact_photo_content_description">Contact photo</string>
+10 −2
Original line number Diff line number Diff line
@@ -122,8 +122,7 @@ public class PhotoEditorView extends RelativeLayout implements View.OnClickListe
            mPhotoIcon.setVisibility(View.VISIBLE);
            mPhotoIconOverlay.setVisibility(View.VISIBLE);
            mPhotoTouchInterceptOverlay.setOnClickListener(this);
            mPhotoTouchInterceptOverlay.setContentDescription(getContext().getString(
                    R.string.editor_change_photo_content_description));
            updatePhotoDescription();
        }
    }

@@ -212,13 +211,21 @@ public class PhotoEditorView extends RelativeLayout implements View.OnClickListe
    private void setPhoto(Bitmap bitmap) {
        mPhotoImageView.setImageBitmap(bitmap);
        mIsNonDefaultPhotoBound = true;
        updatePhotoDescription();
    }

    private void setDefaultPhoto(MaterialPalette materialPalette) {
        mIsNonDefaultPhotoBound = false;
        updatePhotoDescription();
        EditorUiUtils.setDefaultPhoto(mPhotoImageView, getResources(), materialPalette);
    }

    private void updatePhotoDescription() {
        mPhotoTouchInterceptOverlay.setContentDescription(getContext().getString(
                mIsNonDefaultPhotoBound
                        ? R.string.editor_change_photo_content_description
                        : R.string.editor_add_photo_content_description));
    }
    /**
     * Binds a full size photo loaded from the given Uri.
     */
@@ -226,6 +233,7 @@ public class PhotoEditorView extends RelativeLayout implements View.OnClickListe
        EditorUiUtils.loadPhoto(ContactPhotoManager.getInstance(getContext()),
                mPhotoImageView, photoUri);
        mIsNonDefaultPhotoBound = true;
        updatePhotoDescription();
    }

    /**