1 /* 2 * Copyright (C) 2025 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 17 package com.android.settings.accessibility 18 19 import android.content.Context 20 import com.android.settings.R 21 import com.android.settingslib.metadata.PreferenceMetadata 22 import com.android.settingslib.preference.PreferenceBinding 23 24 internal class TextReadingDisplaySizePreference : PreferenceMetadata, PreferenceBinding { 25 26 override val key: String 27 get() = KEY 28 29 override val title: Int 30 get() = R.string.screen_zoom_title 31 32 override val summary: Int 33 get() = R.string.screen_zoom_short_summary 34 35 override val keywords: Int 36 get() = R.string.keywords_display_size 37 createWidgetnull38 override fun createWidget(context: Context) = 39 AccessibilitySeekBarPreference(context, /* attrs= */ null).apply { 40 setIconStart(R.drawable.ic_remove_24dp) 41 setIconStartContentDescription(R.string.screen_zoom_make_smaller_desc) 42 setIconEnd(R.drawable.ic_add_24dp) 43 setIconEndContentDescription(R.string.screen_zoom_make_larger_desc) 44 } 45 46 companion object { 47 const val KEY = "display_size" 48 } 49 } 50