Profile

Cover photo
Akizuki Yojiro
2 followers|50,854 views
AboutPostsPhotosVideos

Stream

Akizuki Yojiro

Shared publicly  - 
 
 
Today's #AndroidDev #Protip on text appearance and theme attributes is by +Katherine Kuan, the newest member of Android Developer Relations (welcome, Katherine!)

When choosing font sizes for your app, using too many different sizes can be visually distracting and confuse the user as to what information is important. To be consistent with other apps on the platform, you can use the standard set of type sizes provided by the framework: small, medium, or large.

To use a standard text size (and color), instead of setting the TextView's android:textSize directly, set the android:textAppearance to a predefined theme attribute [1] such as android:textAppearanceLarge:

<TextView
    …
    android:textAppearance="?android:textAppearanceLarge" />

As of API 19 (KitKat):
?android:textAppearanceSmall is currently 14sp
?android:textAppearanceMedium is currently 18sp
?android:textAppearanceLarge is currently 22sp

These default sizes and concepts are also documented in the "Typographic scale" section of the Android Design guide [2].

Note that setting the text appearance will also affect the default values for text color attributes such as android:textColor and android:textColorHint. You can always override the default values by providing those attributes directly on the TextView element:

<TextView
    ...
    android:textAppearance="?android:textAppearanceLarge"
    android:textColor="@color/my_own_color"
    android:textColorLink="@color/my_own_link_color"/>

Also note that you don't necessarily have to use the system default appearances. You can create your own set of type sizes and colors that fits your desired visual design. For information on creating your own theme attributes, see the #Protip we posted on the topic back in October [3].

Lastly, if you want to check out the definition of these standard text appearances in the framework code, look for "textAppearanceLarge" in the Theme.Holo (or Theme.Holo.Light) definition in themes.xml [4]. The attribute values will be style resources (such as TextAppearance.Holo.Large), for which you can find definitions  in styles.xml [5]. In the example above, note that TextAppearance.Holo.Large inherits from TextAppearance.Large, which in turn inherits from the standard TextAppearance style.

[1] http://developer.android.com/reference/android/R.attr.html
[2] http://developer.android.com/design/style/typography.html 
[3] https://plus.google.com/+AndroidDevelopers/posts/3rL9cTLyuQy
[4] https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/themes.xml
[5] https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/styles.xml
116 comments on original post
1
Add a comment...

Akizuki Yojiro

Shared publicly  - 
 
#warthuder #live_wt #workshop Mig 15 Big Germany / Ussr Update 4K DDS Anime : love live / Nishikino maki#anime #mig15bis #love_live #MakiSkin Maki Outdated due to update 1.53 releasehttp://live.warthunder.com/post/208839/en/Try to download to use to see and enjoy it . Requested Other for me to try to make it fast. As far as I could, All this skin Having spent a long time Because I do it alone. All my skin can Downloaded here. Kurumi_TH If you h...
1
Add a comment...

Akizuki Yojiro

Shared publicly  - 
 
#warthuder #live_wt #workshop Erica Hartmann's F-86 (all versions)#anime #cockpit #cockpitedit #f86 #erica_hartmann #strikewitches #strike_witches NOW IN BEAUTIFUL 4k DDS! This skin is based off of the anime
1
Add a comment...

Akizuki Yojiro

Shared publicly  - 
 
F 86K (ITA) caccia ogni tempo, Istrana, anno 1965 (sullo sfondo il crew-chief Se
1
Add a comment...

Akizuki Yojiro changed his profile photo.

Shared publicly  - 
1
Add a comment...

Akizuki Yojiro

Shared publicly  - 
 
Here is a 100% historical skin, from the F86f25 sabre of the wolrd first jet ace
1
Add a comment...

Akizuki Yojiro

Shared publicly  - 
 
#warthuder #live_wt #workshop skin: http://live.warthunder.com/post/43422/en/#artisticscreenshot#screenshot#mig15
1
Add a comment...

Akizuki Yojiro

Shared publicly  - 
 
#warthuder #live_wt #workshop #mig15 #mig15bis #finland #finnish #anime #Eila_Ilmatar_Juutilainen #Strike_Witches #StrikeWitches #camouflage #splinterHello WTusers!!This time, we've created a Mig-15 of the Finnish Air Force. The Eila of StrikeWitches we have put a cockpit photo. made 4096×4096Although it is Mig-15 of the request, here has been produced previously, was priority here because the color scheme was similar. The airframe is painted gr...
1
Add a comment...

Akizuki Yojiro

Shared publicly  - 
 
De Havilland DH.112 Sea Venom FAW22, WW217 / O-351 Semi-Historical 4K DDS
1
Add a comment...

Akizuki Yojiro

Shared publicly  - 
1
Add a comment...

Akizuki Yojiro

Shared publicly  - 
1
Add a comment...

Akizuki Yojiro changed his profile photo.

Shared publicly  - 
1
Add a comment...
Basic Information
Gender
Male
Links