Files
app_Settings/res/layout/private_dns_mode_dialog.xml
Weng Su b3938a0244 Fix accessibility issues in Private DNS Settings
- Keep the Save button enabled at all times

- Show error in the Hostname view to remind the user
  - "The field is required" error
  - "The hostname you typed isn't valid" error

Bug: 386323822
Flag: EXEMPT bugfix
Test: Manual testing
atest -c PrivateDnsModeDialogPreferenceTest \
         PrivateDnsPreferenceControllerTest

Change-Id: I63973bd5001b838d7f27827e6a6d4ac96ac78ca9
2025-02-13 12:05:25 +08:00

75 lines
3.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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.
-->
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.AppCompat.DayNight">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp">
<RadioGroup
android:id="@+id/private_dns_radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/developer_option_dialog_margin_start">
<include
android:id="@+id/private_dns_mode_off"
layout="@layout/preference_widget_dialog_radiobutton"/>
<include
android:id="@+id/private_dns_mode_opportunistic"
layout="@layout/preference_widget_dialog_radiobutton"/>
<include
android:id="@+id/private_dns_mode_provider"
layout="@layout/preference_widget_dialog_radiobutton"/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/private_dns_mode_provider_hostname_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/private_dns_title"
android:theme="@style/Theme.Settings"
app:endIconMode="clear_text"
app:errorEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/private_dns_mode_provider_hostname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:inputType="textFilter|textUri|textMultiLine"
android:layout_marginStart="3dp"
android:layout_marginEnd="8dp"/>
</com.google.android.material.textfield.TextInputLayout>
</RadioGroup>
<include
android:id="@+id/private_dns_help_info"
layout="@layout/preference_widget_dialog_summary"/>
</LinearLayout>
</ScrollView>