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

Commit daf8a41b authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Correct content description of labels spinner and delete button in editor

Now, pressing on the labels spinner, Talkback will say "<Kind> drop down
list"; pressing on the delete button of editor with labels, Talkback will
say "Delete <Type> <Kind>"; pressing on the delete button of editor without
labels, Talkback will say "Delete <Kind>".

Bug: 11553536
Bug: 25499016
Change-Id: Ibb57ee2226c4eea159e75c7cf901c3febd83fa82
parent e43354f1
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -882,4 +882,12 @@
    <!-- Message below contact name, showing from which account [CHAR LIMIT=NONE]-->
    <string name="contact_from_account_name">From <xliff:g id="account_name">%s</xliff:g></string>

    <!-- Content description of delete button to the right of each section in editor, including
    data type. For example: Delete Home Phone, Delete Work Email, etc [CHAR LIMIT=30]-->
    <string name="editor_delete_view_description">Delete <xliff:g id="data_type">%s </xliff:g><xliff:g id="data_kind">%s</xliff:g></string>

    <!-- Content description of delete button to the right of each section in editor, without data
    type. For example: Delete Website, Delete SIP, etc [CHAR LIMIT=30]-->
    <string name="editor_delete_view_description_short">Delete <xliff:g id="data_kind">%s</xliff:g></string>

</resources>
+17 −0
Original line number Diff line number Diff line
@@ -308,8 +308,23 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor,
        mLabel.setAdapter(mEditTypeAdapter);
        if (mEditTypeAdapter.hasCustomSelection()) {
            mLabel.setSelection(mEditTypeAdapter.getPosition(CUSTOM_SELECTION));
            mDeleteContainer.setContentDescription(
                    getContext().getString(R.string.editor_delete_view_description,
                            mEntry.getAsString(mType.customColumn),
                            getContext().getString(mKind.titleRes)));
        } else {
            mLabel.setSelection(mEditTypeAdapter.getPosition(mType));
            if (mType != null) {
                mDeleteContainer.setContentDescription(
                        getContext().getString(R.string.editor_delete_view_description,
                                getContext().getString(mType.labelRes),
                                getContext().getString(mKind.titleRes)));
            } else {
                mDeleteContainer.setContentDescription(
                        getContext().getString(R.string.editor_delete_view_description_short,
                                getContext().getString(mKind.titleRes)));
            }

        }
    }

@@ -404,6 +419,8 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor,
        final boolean hasTypes = RawContactModifier.hasEditTypes(kind);
        setupLabelButton(hasTypes);
        mLabel.setEnabled(!readOnly && isEnabled());
        mLabel.setContentDescription(getContext().getResources().getString(mKind.titleRes));

        if (hasTypes) {
            mType = RawContactModifier.getCurrentType(entry, kind);
            rebuildLabel();