1 /* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.settings.accessibility 17 18 import android.content.Context 19 import com.android.settings.R 20 import com.android.settings.flags.Flags 21 import com.android.settingslib.metadata.preferenceHierarchy 22 import com.android.settingslib.preference.PreferenceScreenCreator 23 24 // @ProvidePreferenceScreen(TextReadingScreen.KEY) 25 class TextReadingScreen : PreferenceScreenCreator { 26 override val key: String 27 get() = KEY 28 29 override val title: Int 30 get() = R.string.accessibility_text_reading_options_title 31 isFlagEnablednull32 override fun isFlagEnabled(context: Context) = Flags.catalystTextReadingScreen() 33 34 override fun fragmentClass() = TextReadingPreferenceFragment::class.java 35 36 override fun getPreferenceHierarchy(context: Context) = 37 preferenceHierarchy(context, this) { 38 +TextReadingPreview() 39 +TextReadingFontSizePreference() 40 +TextReadingDisplaySizePreference() 41 } 42 43 companion object { 44 const val KEY = "text_reading_screen" 45 } 46 } 47