dpi value of default "large", "medium" and "small" text views android

Vinay W picture Vinay W · Jul 21, 2012 · Viewed 143.2k times · Source

Does the documentation ( or anyone) talks about the dpi values of the default

  • Large TextView {android:textAppearance="?android:attr/textAppearanceLarge"}
  • Medium TextView {android:textAppearance="?android:attr/textAppearanceMedium"}
  • Small TextView { android:textAppearance="?android:attr/textAppearanceSmall"}

widgets in the SDK ?

The Large, medium, small and regular text views

To put it in another way, can we replicate the appearance of these text views without using the android:textAppearance attribute?

Answer

biegleux picture biegleux · Jul 21, 2012

See in the android sdk directory.

In \platforms\android-X\data\res\values\themes.xml:

    <item name="textAppearanceLarge">@android:style/TextAppearance.Large</item>
    <item name="textAppearanceMedium">@android:style/TextAppearance.Medium</item>
    <item name="textAppearanceSmall">@android:style/TextAppearance.Small</item>

In \platforms\android-X\data\res\values\styles.xml:

<style name="TextAppearance.Large">
    <item name="android:textSize">22sp</item>
</style>

<style name="TextAppearance.Medium">
    <item name="android:textSize">18sp</item>
</style>

<style name="TextAppearance.Small">
    <item name="android:textSize">14sp</item>
    <item name="android:textColor">?textColorSecondary</item>
</style>

TextAppearance.Large means style is inheriting from TextAppearance style, you have to trace it also if you want to see full definition of a style.

Link: http://developer.android.com/design/style/typography.html