• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 android.provider.Settings.System.FONT_SCALE
21 import com.android.settings.R
22 import com.android.settingslib.metadata.PreferenceMetadata
23 import com.android.settingslib.preference.PreferenceBinding
24 
25 internal class TextReadingFontSizePreference : PreferenceMetadata, PreferenceBinding {
26 
27     override val key: String
28         get() = KEY
29 
30     override val title: Int
31         get() = R.string.title_font_size
32 
33     override val summary: Int
34         get() = R.string.short_summary_font_size
35 
36     override val keywords: Int
37         get() = R.string.keywords_font_size
38 
createWidgetnull39     override fun createWidget(context: Context) =
40         AccessibilitySeekBarPreference(context, /* attrs= */ null).apply {
41             setIconStart(R.drawable.ic_remove_24dp)
42             setIconStartContentDescription(R.string.font_size_make_smaller_desc)
43             setIconEnd(R.drawable.ic_add_24dp)
44             setIconEndContentDescription(R.string.font_size_make_larger_desc)
45         }
46 
47     companion object {
48         const val KEY = FONT_SCALE
49     }
50 }
51