From a9f1dd021f8f6ee777bc4d27913bd40c42e753af Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 12 Aug 2009 15:00:10 -0700 Subject: Make and in string resources respect density. This unfortunately requires API changes because the existing text markup classes had no access to the screen density. TextPaint gains a "density" field so that TextView can pass the density along. AbsoluteSizeSpan gains a new flag to indicate that its argument is in dip instead of in physical pixels. LineHeightSpan gains an inner interface whose chooseHeight() method includes a TextPaint argument so it can get at the density. And when StringBlock creates the markup objects, it now uses the density-aware versions. Bug 1976971, Bug 2031746 --- api/current.xml | 68 ++++++++++++++++++++++ core/java/android/content/res/StringBlock.java | 34 +++++++---- core/java/android/text/StaticLayout.java | 8 ++- core/java/android/text/TextPaint.java | 2 + core/java/android/text/style/AbsoluteSizeSpan.java | 32 +++++++++- core/java/android/text/style/LineHeightSpan.java | 7 +++ core/java/android/widget/TextView.java | 1 + 7 files changed, 138 insertions(+), 14 deletions(-) diff --git a/api/current.xml b/api/current.xml index 397e25d..7d1e8e8 100644 --- a/api/current.xml +++ b/api/current.xml @@ -130128,6 +130128,16 @@ visibility="public" > + + + + + + + + @@ -135140,6 +135162,17 @@ visibility="public" > + + + + + + + + + + + + + + + + + + + + + +