Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18053] Android: expose the text color for the picker

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-12-07T12:32:04.000+0000
Affected Version/sRelease 3.4.1, Release 5.4.0
Fix Version/sRelease 6.1.0
ComponentsAndroid
LabelsTCSupportTriage, android, tss
ReporterRene Pot
AssigneeFrankie Merzadyan
Created2014-08-27T13:05:28.000+0000
Updated2016-12-09T18:58:13.000+0000

Description

Problem Description

I'm not able to set the text color of the picker value. Therefore, I have to use the Android theme files to set it, but this should be exposed in the API as the default color: '#hex' We have tested this issue. But Android, iOS have not text color property of pickerView or pickerRow.

Steps to Reproduce:

1. Create classic project. 3. Paste this code in app.js file. 3. Run this code with the testing environment. 4.
Ti.UI.backgroundColor = 'white';
var win = Ti.UI.createWindow({
    exitOnClose : true,
    layout : 'vertical'
});
 
var picker = Ti.UI.createPicker({
    top : 50
});
 
var data = [];
data[0] = Ti.UI.createPickerRow({
    title : 'Bananas',
    color:'red'
});
data[1] = Ti.UI.createPickerRow({
    title : 'Strawberries'
});
data[2] = Ti.UI.createPickerRow({
    title : 'Mangos'
});
data[3] = Ti.UI.createPickerRow({
    title : 'Grapes'
});
 
picker.add(data);
picker.selectionIndicator = true;
 
win.add(picker);
win.open();

Attachments

FileDateSize
2016_06_30_14_17_11.mp42016-06-30T21:23:48.000+00002950783

Comments

  1. Jason Priebe 2014-10-22

    This seems to be a pretty big deal. The picker looks OK if it has a dark background color, so that it shows white text on dark, but if you have a light background color, you can't see the text of the picker at all. Interestingly, you get the underline and triangle in the corner, like a modern Android picker. But that's in black. If you set the background to black, you can see the text, but you *can't* see the underline and the triangle. For a usable picker, we really need a lot more control over the colors of the text and the "decorators".
  2. Ygor Lemos 2015-03-12

    Please do this! It is very annoying, specially when you need more than one picker theme.
  3. Carlos Henrique Zinato 2016-04-20

    any news on that guys? Terrible to do a form and have to manage it on Android Themes =/
  4. Lokesh Choudhary 2016-06-30

    Reopening, as this does not work properly on android 6.0. Works as expected on android 5.1.1. Using the code in the description on android 6.0, after you dropdown & select a row, the selected row text as well as the original row text on which the color property is set will have the color red. Attached is a video of the issue : [^2016_06_30_14_17_11.mp4] Environment: Appc Studio : 4.7.0.201606220541 Ti SDK : 5.4.0.v20160630074247 Ti CLI : 5.0.9 Alloy : 1.9.0 MAC El Capitan : 10.11.5 Appc NPM : 4.2.7-2 Appc CLI : 5.4.0-23 Node: 4.4.4 Nexus 6 - Android 6.0.1
  5. Ashraf Abu 2016-07-04

    Clarification: Original PR for this was https://github.com/appcelerator/titanium_mobile/pull/7959
  6. Ashraf Abu 2016-07-04

    Due to time constraints, will be bumping this out of 5.4.0 and placing it in -6.0.0- 6.1.0 to be addressed.
  7. Farzad Merzadyan 2016-10-12

    I tested it on my Android 6 Galaxy S6 device. It was working for me. The text in the picker e.g. Bananas, Strawberries, etc do have text color. 3_4_1 release does not have styleTextView which is responsible for setting text color in color picker. https://github.com/appcelerator/titanium_mobile/blob/3_4_1/android/modules/ui/src/java/ti/modules/titanium/ui/widget/picker/TiUINativePicker.java#L78 This has already been addressed and merged in master. https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/picker/TiUINativePicker.java#L76
  8. Lokesh Choudhary 2016-12-01

    Reopening as I am still seeing the issue I have mentioned in my previous comment. Appc Studio : 4.8.1.201611291132 SDK Version : 6.1.0.v20161129071600 Mac OS Version : 10.12 Xcode Version : Xcode 8.1 Build version 8B62 Appc CLI AND Appc NPM : {"NPM":"4.2.9-1","CLI":"6.1.0-302"} Ti CLI : 5.0.11 Alloy : 1.9.4 Node : v4.6.0 Device: running 7.1Pixel
  9. Gary Mathews 2016-12-05

    master: https://github.com/appcelerator/titanium_mobile/pull/8651
  10. Lokesh Choudhary 2016-12-05

    Reopening as now I am seeing my previous issue when color property is set on two of the row text. Appc Studio : 4.8.1.201612050850 SDK Version : 6.1.0.v20161205102502 Mac OS Version : 10.12 Xcode Version : Xcode 8.1 Build version 8B62 Appc CLI AND Appc NPM : {"NPM":"4.2.9-1","CLI":"6.1.0-302"} Ti CLI : 5.0.11 Alloy : 1.9.4 Node : v4.6.0 Device: running 7.1Pixel
  11. Gary Mathews 2016-12-07

    master: https://github.com/appcelerator/titanium_mobile/pull/8661
  12. Samir Mohammed 2016-12-09

    Verified fixed, color property is no longer set on two rows of text when selecting to text with no color then moving to another line of text. *Environment*
        Appcelerator Command-Line Interface, version 6.0.0
        Android 7.0 (Google Nexus 6P)
        Iphone 6 plus (IOS version 9.3.4)
        Operating System Name: Mac OS X El Capitan
        Operating System Version: 10.11.6
        Node.js Version: 4.6.0
        npm: 4.2.8
        Titanium CLI Version: 5.0.10
        Titanium SDK Version: 6.1.0.v20161208114813
        Xcode: 8.0
        Appcelerator Studio: 4.8.0.201611121409
        

JSON Source