Change TabStop type from int to float
This is from API council feedback.
Bug: 124794899
Test: atest CtsTextTestCases
Test: atest CtsGraphicsTestCases
Change-Id: Ifa95f87067239cca9c0791bf079045e4f645c3ad
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java
index defe2ce..dd37c7a 100644
--- a/core/java/android/text/StaticLayout.java
+++ b/core/java/android/text/StaticLayout.java
@@ -737,14 +737,14 @@
}
}
// tab stop locations
- int[] variableTabStops = null;
+ float[] variableTabStops = null;
if (spanned != null) {
TabStopSpan[] spans = getParagraphSpans(spanned, paraStart,
paraEnd, TabStopSpan.class);
if (spans.length > 0) {
- int[] stops = new int[spans.length];
+ float[] stops = new float[spans.length];
for (int i = 0; i < spans.length; i++) {
- stops[i] = spans[i].getTabStop();
+ stops[i] = (float) spans[i].getTabStop();
}
Arrays.sort(stops, 0, stops.length);
variableTabStops = stops;
@@ -1396,7 +1396,7 @@
private static final int TAB_MASK = 0x20000000;
private static final int HYPHEN_MASK = 0xFF;
- private static final int TAB_INCREMENT = 20; // same as Layout, but that's private
+ private static final float TAB_INCREMENT = 20; // same as Layout, but that's private
private static final char CHAR_NEW_LINE = '\n';