Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20467] Android: Titanium.UI.ProgressBar 'color' property has no effect on text

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-04-21T04:12:44.000+0000
Affected Version/sRelease 5.2.0
Fix Version/sRelease 5.4.0
ComponentsAndroid
Labelsandroid, defect, parity
ReporterGabriel Mario Aguirre
AssigneeSrikanth Sombhatla
Created2016-02-24T19:51:51.000+0000
Updated2016-06-10T21:57:07.000+0000

Description

The 'color' property of Titanium.UI.ProgressBar does not effect the text. The text stays "white" and thus invisible to a white background. The 'color' property only effects the color of the bar itself.

Comments

  1. Nazmus Salahin 2016-02-25

    In the documentation the color property is described as below:
       color : String
       Color of the progress bar text, as a color name or hex triplet.
       
    But changing the color property changes the color of the bar not the text and the text color remains white. In the following code sample color property of the "Titanium.UI.ProgressBar" is set to blue. The bar color then becomes blue but the text color of the message remains while.
       var pb = Ti.UI.createProgressBar({
           top: 25,
           width: 250,
           min: 0,
           max: 10,
           value: 0,
           color: 'blue',
           message: 'Downloading 0 of 10',
           font: {fontSize: 14, fontWeight: 'bold'},
           style: Titanium.UI.iPhone.ProgressBarStyle.PLAIN,
       });
       
    *Environment*: *Device info:* Nexux7 (android 6.0.1) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.2.0.v20160220080449 and 5.1.2.GA *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5
  2. Ashraf Abu 2016-02-26

    Seems that documentation was incorrectly done for this. As per TIMOB-19588, the color property exposed was for the bar.
  3. Chee Kiat Ng 2016-03-24

    This is more of a parity issue. please check if we can make android and ios consistent.
  4. Christopher Williams 2016-03-24

    PS. the issue here is that 'color' changes the text on iOS. tintColor changes the "filled" color on iOS. 'trackTintColor' changes the color of the 'not filled" portion of the bar. On Android, 'color' changes the bar and not the text. There's no tintColor or trackTintColor property on Android. Looks like tintColor maps to http://developer.android.com/reference/android/widget/ProgressBar.html#attr_android:progressTint and trackTintColor maps to http://developer.android.com/reference/android/widget/ProgressBar.html#attr_android:progressBackgroundTint Ideally color should change the text color on both; tintColor should change the bar (fill) color on both, trackTintColor should change the "unfilled" color of the bar.
  5. Srikanth Sombhatla 2016-04-20

    PR: https://github.com/appcelerator/titanium_mobile/pull/7953 This PR changes text color with color property - which is as per documentation. Can use the following app.js for testing
       // this sets the background color of the master UIView (when there are no windows/tab groups on it)
       Titanium.UI.setBackgroundColor('#000');
        
       var win1 = Titanium.UI.createWindow({
           title:'Tab 1',
           backgroundColor:'white',
           fullscreen: true
       });
       
       var pb = Ti.UI.createProgressBar({
           top: 25,
           width: 250,
           min: 0,
           max: 10,
           value: 0,
           color: 'blue',
           message: 'Downloading 0 of 10',
           style: Titanium.UI.iPhone.ProgressBarStyle.PLAIN
       });
       
       win1.add(pb);
       win1.open();
       
  6. Ashraf Abu 2016-04-21

    PR merged.
  7. Lokesh Choudhary 2016-06-10

    Verified the fix. color property now changes the color of the text as well. Closing. Environment: Appc Studio : 4.6.0.201605201934 Ti SDK : 5.4.0.v20160608165242 Ti CLI : 5.0.8 Alloy : 1.8.7 MAC El Capitan : 10.11.4 Appc NPM : 4.2.7-2 Appc CLI : 5.4.0-11 Node: 4.4.4 Nexus 6 - Android 6.0.0

JSON Source