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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user