In my app "Tide Now WA" which I recently tested for compatibility using the new Nexus 9 tablet (Lollipop - API 21).
It writes some button text. This app writes the text correctly using Android 2.3 and Android 4.0. I.e. mixed capital and lower case letters.
When same app is run on my Nexus 9 all the letters in the text are capitalized.
FWIW my manifest contains the following statement:
uses-sdk android:minSdkVersion="10" android:targetSdkVersion="14"
Can I fix this in my code or is it a bug in the O.S. thanks
OK, just ran into this. Buttons in Lollipop come out all uppercase AND the font resets to 'normal'. But in my case (Android 5.02) it was working in one layout correctly, but not another!?
Changing APIs didn't work.
Setting to all caps requires min API 14 and the font still resets to 'normal'.
It's because the Android Material Styles forces a change to the styles if there isn't one defined (that's why it worked in one of my layout and not the other because I defined a style).
So the easy fix is to define a style in the manifest for each activity which in my case was just:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
(hope this helps someone, would have saved me a couple of hours last night)
There is an easier way which works for all buttons, just change appearance of buttons in your theme, try this:
in values-21/styles.xml
PS: it's recommended to follow material design's principles, you should show capitalized text in Buttons, http://www.google.com/design/spec/components/buttons.html
If you have arrived here because your facebook button text appears in all caps then just add this
android:textAllCaps="false"
in your xml file. It worked for me.Set android:textAllCaps="false". If you are using an appcompat style, make sure textAllCaps comes before the style. Otherwise the style will override it. For example:
Using the android.support.v7.widget.AppCompatButton in the XML layout will allow you to avoid having to have a layout-21 or programmatically changing anything. Naturally this will also work with AppCompat v7 library.
Hope this helps.
add this line in style