From c8f6bcc6fbfb2f81bb1bf49b2aab37b28eb98b2e Mon Sep 17 00:00:00 2001 From: Peter_Liang Date: Sun, 9 Jan 2022 12:28:24 +0800 Subject: [PATCH] =?UTF-8?q?New=20feature=20=E2=80=9CText=20and=20reading?= =?UTF-8?q?=20options=E2=80=9D=20for=20SetupWizard,=20Wallpaper,=20and=20S?= =?UTF-8?q?ettings=20(1/n).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create preference fragment layout. Bug: 211503117 Test: manual test Change-Id: I16c01476b75c2eb6d83759233d4cc29bddfcd4a7 --- res/xml/accessibility_settings.xml | 3 +- .../accessibility_text_reading_options.xml | 22 ++++++++ .../TextReadingPreferenceFragment.java | 51 +++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 res/xml/accessibility_text_reading_options.xml create mode 100644 src/com/android/settings/accessibility/TextReadingPreferenceFragment.java diff --git a/res/xml/accessibility_settings.xml b/res/xml/accessibility_settings.xml index 65e481a64c1..d836e24d9c7 100644 --- a/res/xml/accessibility_settings.xml +++ b/res/xml/accessibility_settings.xml @@ -38,10 +38,11 @@ + + + + diff --git a/src/com/android/settings/accessibility/TextReadingPreferenceFragment.java b/src/com/android/settings/accessibility/TextReadingPreferenceFragment.java new file mode 100644 index 00000000000..0e8457beaca --- /dev/null +++ b/src/com/android/settings/accessibility/TextReadingPreferenceFragment.java @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2022 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. + */ + +package com.android.settings.accessibility; + +import android.app.settings.SettingsEnums; + +import com.android.settings.R; +import com.android.settings.dashboard.DashboardFragment; +import com.android.settings.search.BaseSearchIndexProvider; +import com.android.settingslib.search.SearchIndexable; + +/** + * Accessibility settings for adjusting the system features which are related to the reading. For + * example, bold text, high contrast text, display size, font size and so on. + */ +@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC) +public class TextReadingPreferenceFragment extends DashboardFragment { + private static final String TAG = "TextReadingPreferenceFragment"; + + @Override + protected int getPreferenceScreenResId() { + return R.xml.accessibility_text_reading_options; + } + + @Override + protected String getLogTag() { + return TAG; + } + + @Override + public int getMetricsCategory() { + return SettingsEnums.ACCESSIBILITY_TEXT_READING_OPTIONS; + } + + public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = + new BaseSearchIndexProvider(R.xml.accessibility_text_reading_options); +}