[TIMOB-19506] Android: Use AppCompatButton for Ti.UI.Button
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-09-14T05:11:46.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 5.1.0 |
Components | Android |
Labels | android |
Reporter | Manuel Lehner |
Assignee | Ashraf Abu |
Created | 2015-09-11T08:52:59.000+0000 |
Updated | 2015-11-10T15:02:34.000+0000 |
Description
As you may have noticed Buttons look different on Android 4.x and 5.x. / 6.x
In order to make the Material Design available on older platforms Titanium should also use the AppCompatButton for a consistent look&feel across these Android versions. This also gives developers the opportunity to create common styles for buttons in a Theme (
parent="Base.TextAppearance.AppCompat.Button"
).
More info: http://android-developers.blogspot.in/2015/04/android-support-library-221.html {quote}The ability to tint widgets automatically when using AppCompat is incredibly helpful in keeping strong branding and consistency throughout your app. This is done automatically when inflating layouts - replacing Button with AppCompatButton, TextView with AppCompatTextView, etc. to ensure that each could support tinting. In this release, those tint aware widgets are now publicly available, allowing you to keep tinting support even if you need to subclass one of the supported widgets. The full list of tint aware widgets at this time is: AppCompatAutoCompleteTextView AppCompatButton AppCompatCheckBox AppCompatCheckedTextView AppCompatEditText AppCompatMultiAutoCompleteTextView AppCompatRadioButton AppCompatRatingBar AppCompatSpinner AppCompatTextView{quote}
PR: https://github.com/appcelerator/titanium_mobile/pull/7166 Test code in app.js:
PR merged.
Verified the improvement. Buttons look same in appearance across android 4.X, 5.X & 6.X Verified by testing on android 4.1.1, 4.4.4, 5.1.1 & 6.0 devices. Closing. Environment: Appc Studio : 4.3.1.201509302304 Ti SDK : 5.1.0.v20151014101225 Ti CLI : 5.0.5 Alloy : 1.7.16 MAC Yosemite : 10.10.5 Appc NPM : 4.2.1-1 Appc CLI : 5.1.0-38 Node: v0.10.37 Nexus 6 - Android 6.0 Nexus 5 - Android 5.1.1 Android Emulator : Android 4.4.4 , 4.1.1