[Catalyst] Refactor some Text Reading items

Test: atest TextReadingPreferenceFragment
Bug: 372776688
Flag: com.android.settings.flags.catalyst_text_reading_screen
Change-Id: I49aa91ca6f441814d6aaeb86826291a155a306f1
This commit is contained in:
Sunny Shao
2024-12-06 21:13:05 +08:00
parent dc1a52a2ee
commit a02483adc9
3 changed files with 55 additions and 14 deletions

View File

@@ -56,10 +56,10 @@ public class LabeledSeekBarPreference extends SeekBarPreference {
private final int mTextStartId;
private final int mTextEndId;
private final int mTickMarkId;
private final int mIconStartId;
private final int mIconEndId;
private final int mIconStartContentDescriptionId;
private final int mIconEndContentDescriptionId;
private int mIconStartId;
private int mIconEndId;
private int mIconStartContentDescriptionId;
private int mIconEndContentDescriptionId;
private OnPreferenceChangeListener mStopListener;
private SeekBar.OnSeekBarChangeListener mSeekBarChangeListener;
@@ -110,6 +110,38 @@ public class LabeledSeekBarPreference extends SeekBarPreference {
return mSeekBar;
}
/** Set the start icon of the Seekbar. */
public void setIconStart(int iconStartId) {
if (mIconStartId != iconStartId) {
mIconStartId = iconStartId;
notifyChanged();
}
}
/** Set the description resource id of the start icon. */
public void setIconStartContentDescription(int iconStartContentDescriptionId) {
if (mIconStartContentDescriptionId != iconStartContentDescriptionId) {
mIconStartContentDescriptionId = iconStartContentDescriptionId;
notifyChanged();
}
}
/** Set the end icon of the Seekbar. */
public void setIconEnd(int iconEndId) {
if (mIconEndId != iconEndId) {
mIconEndId = iconEndId;
notifyChanged();
}
}
/** Set the description resource id of the end icon. */
public void setIconEndContentDescription(int iconEndContentDescriptionId) {
if (mIconEndContentDescriptionId != iconEndContentDescriptionId) {
mIconEndContentDescriptionId = iconEndContentDescriptionId;
notifyChanged();
}
}
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);