[TIMOB-19780] Android: Button title stays uppercased even if the text is in lowercase in the app.js
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Invalid |
| Resolution Date | 2015-10-28T17:32:12.000+0000 |
| Affected Version/s | Release 5.1.0 |
| Fix Version/s | n/a |
| Components | Android |
| Labels | qe-5.1.0, regression |
| Reporter | Lokesh Choudhary |
| Assignee | Srikanth Sombhatla |
| Created | 2015-10-23T20:58:55.000+0000 |
| Updated | 2015-10-28T17:32:17.000+0000 |
Description
*Note: This is a regression but don't know when this broke. I went back till SDK 4.1.1.GA & could still see the issue.*
Steps To Reproduce:
1. Use the following code in your app.js :
var win = Ti.UI.createWindow({});
var but = Ti.UI.createButton({
title:"lokesh"
});
win.add(but);
win.open();
2. Build for android device.
3. After the app launches check the button title.
Actual Results:
1. The button title stays uppercased even if the text is in lowercase in the app.js. NOTE: attached the screenshot for android & IOS for this issue.Expected Results:
1. The button title should respect the case in the code.Attachments
| File | Date | Size |
|---|---|---|
| Android_button_case.png | 2015-10-23T20:58:43.000+0000 | 41816 |
| IOS_button_title.png | 2015-10-23T20:58:46.000+0000 | 24331 |
Button text is automatically changed to ALLCAPS in material design. See https://www.google.com/design/spec/components/buttons.html# So the behaviour is according to the Android version the device is running. But in case you want to override this - provide your own style in Appc Studio. You can try something like this: In platform/android/res/values/mytheme.xml
And use this theme in tiapp.xml as described here http://docs.appcelerator.com/platform/latest/#!/guide/Android_Themes<resources> <!-- Base application theme. --> <style name="Theme.MyTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="buttonStyle">@style/MyButton</item> </style> <style name="MyButton" parent="Widget.AppCompat.Button"> <item name="android:textAllCaps">false</item> </style> </resources>[~sriks], With the custom theme the button title is lower cased, that's great. However, when I run the app without the custom theme on android 4.4.4 (which does not have material theme) I still see the button title as uppercased. Is this expected with android versions below 5.0 ?
[~lchoudhary] Yes. Thats the expected behaviour because Android TiSDK uses AppCompact with Material theme support. So any widgets are automatically styled as material design.
[~ssombhatla], thanks for the clarification. Resolving this as invalid from above comments as this is an expected behaviour in material theme & when using appcompat with TiSDK.