summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramVertexFixedFunction.java
diff options
context:
space:
mode:
authorAndrei Stingaceanu <stg@google.com>2017-05-11 15:32:37 +0100
committerAndrei Stingaceanu <stg@google.com>2017-05-11 15:49:02 +0100
commitd4082bb9ad0ee58af5ae2c9b274730158747ba1d (patch)
treeaa9f53f8346da1f27d51ba859859f7d48c74472c /rs/java/android/renderscript/ProgramVertexFixedFunction.java
parentab516db3e62058cfc7102048a3d5550b3287bc23 (diff)
AutoSize TextView - correct pixel transformations
When configuring a TextView to auto-size via min/max/granularity do the calculations in float pixels and only convert to int (via rounding, see TypedArray#getDimensionPixelSize) to produce the final text size values to be used by the auto-size algorithm. This is because the previous version where the values were initially directly converted to pixels and only after used in calculations was losing precision and was not consistent with how we deal with preset configuration (and the developer expectations). Practically textView1.setAutoSizeTextTypeUniformWithConfiguration(10, 20, 2, TypedValue.COMPLEX_UNIT_SP) and textView2.setAutoSizeTextTypeUniformWithPresetSizes( new int[] {10, 12, 14, 16, 18, 20}, TypedValue.COMPLEX_UNIT_SP); produce exactly the same values in pixels to choose from when auto-sizing (on any device) => (TextView#getAutoSizeTextAvailableSizes()) Bug: 38185233 Bug: 37265610 Test: attached in the same topic Change-Id: I95cbbf4674e98f080d7752ae350df26b4adf31b4
Diffstat (limited to 'rs/java/android/renderscript/ProgramVertexFixedFunction.java')
0 files changed, 0 insertions, 0 deletions