Clean up unused PreviewSeekBarPreferenceFragment

Usage is removed in Change: I5d8027628dcf06d99274a6a7a781218d146519eb

And we can clean up its subclasses and resources also.

Bug: 234570979
Test: m Settings
Change-Id: I4a24a34e814401749894a85375a05691b537f5a3
This commit is contained in:
Chaohui Wang
2022-06-05 13:51:58 +08:00
parent d75d0609d2
commit f3f39dadc9
21 changed files with 16 additions and 1622 deletions

View File

@@ -16,8 +16,6 @@
package com.android.settings.accessibility;
import static com.android.settings.display.ToggleFontSizePreferenceFragment.fontSizeValueToIndex;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Resources;
@@ -55,4 +53,20 @@ final class FontSizeData extends PreviewSizeData<Float> {
Settings.System.putFloat(resolver, Settings.System.FONT_SCALE,
getValues().get(currentProgress));
}
/**
* Utility function that returns the index in a string array with which the represented value is
* the closest to a given float value.
*/
private static int fontSizeValueToIndex(float val, String[] indices) {
float lastVal = Float.parseFloat(indices[0]);
for (int i = 1; i < indices.length; i++) {
float thisVal = Float.parseFloat(indices[i]);
if (val < (lastVal + (thisVal - lastVal) * .5f)) {
return i - 1;
}
lastVal = thisVal;
}
return indices.length - 1;
}
}