0

I just developed an app on Android Studio and I used normal default grey button of kitkat. But some time later I made a copy of that app (to make another project) and now in this copied app, new buttons as well as those old buttons are shown with some different style. I am confused as to where I got that new style. It looks cool but I don't want to lose it as automatically as I got it. I am attaching an image, this will show the changes in design.differences

Usman
  • 2,331
  • 2
  • 21
  • 29

2 Answers2

1

Either you are using Theme.Material or Theme.AppCompat, or something that inherits from those (e.g., Theme.AppCompat.Light), as the basis for your app's theme. Or, you have no theme, and you are running on an Android 5.0+ device, and so you get Theme.Material by default.

Both Theme.Material and Theme.AppCompat (the latter in conjunction with AppCompatActivity and the rest of the appcompat-v7 library) aim to implement the Material Design aesthetic, and Material Design says that button captions are in all caps.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Any easy way to tell the appcompat library to leave my buttons(and buttons only) alone? (some attribute?) – Selvin Jun 12 '15 at 11:50
  • @Selvin: You can do it in your theme: http://stackoverflow.com/questions/26958909/why-is-my-button-text-coerced-to-all-caps-on-lollipop – CommonsWare Jun 12 '15 at 11:53
  • Problem is, that in fact it is not a normal Button class but TintButton ... i changed the style but on some device (3.2, yeah i know deprecated but still we use it) it is not working ... so I'm using `MyButton extends Button` in layouts ... also i don't care about CAPS :) – Selvin Jun 12 '15 at 11:55
  • @Selvin: "that in fact it is not a normal Button class but TintButton" -- yeah, IIRC, that's `appcompat-v7`'s class for handling the `colorAccent` stuff. However, if you apply your own `style` to it, inheriting from something like `Widget.AppCompat.Button`, you should still be able to affect it. – CommonsWare Jun 12 '15 at 11:59
  • Thanks a lot! Yes I am using AppCompat copuled with `compile 'com.android.support:appcompat-v7:22.0.0'` in gradle. In the previous app, I was compiling `com.android.support:appcompat-v7:21.0.3` – Usman Jun 12 '15 at 14:32
0

add this line in style

<item name="android:textAllCaps">false</item>
Ashish Chaugule
  • 1,526
  • 11
  • 9