[TIMOB-4648] Android: TableViewRow opacity ignored when a backgroundSelectedColor is also set
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-01-04T15:25:16.000+0000 |
Affected Version/s | Release 1.7.2 |
Fix Version/s | Sprint 2011-29, Release 1.8.0, Release 1.7.6 |
Components | Android |
Labels | module_tableviewrow, qe-testadded |
Reporter | Bill Dawson |
Assignee | Vikramjeet Singh |
Created | 2011-07-13T09:06:40.000+0000 |
Updated | 2012-01-04T15:25:16.000+0000 |
Description
Using this test app:
Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({
title:'Test',
backgroundColor:'green',
exitOnClose: true
});
var cb, btn;
var tv = null;
win.add(cb = Ti.UI.createSwitch({
value: true,
style: Ti.UI.Android.SWITCH_STYLE_CHECKBOX,
title: "Give one row backgroundSelectedColor",
top: "5dp", left: "5dp", right: "5dp", height: "60dp"
}));
win.add(btn = Ti.UI.createButton({
title: "Create TableView",
top: "65dp", left: "5dp", width: "200dp", height: "40dp"
}));
btn.addEventListener('click', function(e) {
if (tv !== null) {
win.remove(tv);
}
win.add(tv = Ti.UI.createTableView({
top: "110dp", left: "0dp", right: "0dp", bottom: "0dp",
backgroundColor: "blue", opacity: 0.8
}));
var rows = [];
for (var i = 0; i < 10; i++) {
var row = Ti.UI.createTableViewRow();
row.title = "Row " + (i + 1);
if (i === 4) {
row.title = "Evil row";
row.backgroundColor = "yellow";
if (cb.value) {
row.backgroundSelectedColor = "red";
}
}
if (i === 5) {
row.title = "With opacity";
row.backgroundColor = "yellow";
row.opacity=0.8;
if (cb.value) {
row.backgroundSelectedColor = "red";
}
}
if (i === 8) {
// Just testing standard background
row.backgroundColor = "yellow";
row.title = "I am yellow";
}
rows.push(row);
}
tv.setData(rows);
});
win.open();
If you UNcheck the top checkbox and create the tableview, you'll see that "Evil Row" and "With Opacity" row look different because the "With Opacity" row has an opacity of 0.8 set on it.
If you then check the top checkbox and do it again, the two rows will look the same, when they should NOT look the same (since one of them has 0.8 opacity set.)
Resolved. Tested On: Mac OSX Lion TiMob: 1.8.0.v20110906155354 TiStud: 1.0.5.201109091616 Devices Used: Android Emulator 2.2 Droid1 Droid3
updating fixed version for merge
Tested on Ti Studio 1.0.7.201112080131 Ti Mob SDK 1.8.0.1.v20111209011840 OSX Lion Nexus S OS 2.3.6 Expected behavior is shown of the opacity being correctly set
Reopening/closing to add/remove labels