Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19506] Android: Use AppCompatButton for Ti.UI.Button

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2015-09-14T05:11:46.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.1.0
ComponentsAndroid
Labelsandroid
ReporterManuel Lehner
AssigneeAshraf Abu
Created2015-09-11T08:52:59.000+0000
Updated2015-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").

Comments

  1. Manuel Lehner 2015-09-11

  2. Ashraf Abu 2015-09-14

    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}
  3. Ashraf Abu 2015-09-14

    PR: https://github.com/appcelerator/titanium_mobile/pull/7166 Test code in app.js:
       var win = Ti.UI.createWindow({
           title: "Test"
       });
       var button = Titanium.UI.createButton({
          title: 'Hello',
          top: 10
       });
       button.addEventListener('click',function(e)
       {
          Titanium.API.info("You clicked the button");
       });
       win.add(button);
        
       win.open();
       
  4. Ashraf Abu 2015-09-14

    PR merged.
  5. Lokesh Choudhary 2015-10-14

    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

JSON Source