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

Commit fabc3279 authored by Beverly's avatar Beverly
Browse files

Add label for owner info EditText view in a dialog

Since the EditText uses the "hint" attribute
as an example of text that could be input into
the EditText, we cannot use contentDescription
(hints override it). Therefore, we must use
the title of the dialog to provide the label for
the EditText.

Fixes: 418746868
Test: enable talkback; Settings > Display > Lock screen >
Add text on lock screen > swipe right, then swipe left
to refocus on EditText; hear label being read for the
EditText box
Flag: EXEMPT bugfix

Change-Id: I4c63308be0ecc99b41430d9377e04fcfc718fea2
parent 6f402db6
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2025 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingStart="?android:attr/dialogPreferredPadding"
    android:paddingEnd="?android:attr/dialogPreferredPadding"
    android:paddingTop="@*android:dimen/dialog_padding_top_material">

    <TextView
        android:id="@+id/ownerinfo_title"
        android:singleLine="true"
        android:ellipsize="end"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="?android:attr/windowTitleStyle"
        android:text="@string/owner_info_settings_title"
        android:labelFor="@id/owner_info_edit_text" />
</LinearLayout>
+2 −1
Original line number Diff line number Diff line
@@ -56,7 +56,8 @@ public class OwnerInfoSettings extends InstrumentedDialogFragment implements OnC
        mView = LayoutInflater.from(getActivity()).inflate(R.layout.ownerinfo, null);
        initView();
        return new AlertDialog.Builder(getActivity())
                .setTitle(R.string.owner_info_settings_title)
                .setCustomTitle(LayoutInflater.from(
                        getActivity()).inflate(R.layout.ownerinfo_title, null))
                .setView(mView)
                .setPositiveButton(R.string.save, this)
                .setNegativeButton(R.string.cancel, this)