Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27626] Android: TableView allowsSelection(true) property does not keep the row highlighted

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2019-11-27T11:25:08.000+0000
Affected Version/sRelease 6.1.0, Release 7.0.0, Release 8.0.0, Release 8.3.0
Fix Version/sn/a
ComponentsAndroid
Labels6.1.0, 8.3.0, allowsSelection, android, highlightedColor, tableview
ReporterSohail Saddique
AssigneeYordan Banev
Created2019-11-25T15:49:31.000+0000
Updated2019-11-27T11:25:56.000+0000

Description

First reported as a regression in SDK 6.1.0. Regression still exists in latest SDK build. Note that this issue only affects Android. It works as intended on iOS. When using TableView with allowsSelection set to true and rows containing labels with highlightedColor property, the row does not stay highlighted upon selection. Test Code:
var createRow = function (title) {
		var row = Ti.UI.createTableViewRow({
			accessibilityLabel: title,
			className: 'test',
			height: 80,
			selectedBackgroundColor: '#ff0000'
		});

		var titleLabel = Ti.UI.createLabel({
			accessibilityLabel: title,
			font: {
				fontFamily: 'Helvetica-Bold',
				fontSize: 20
			},
			height: 24,
			highlightedColor: '#fff',
			left: 10,
			text: title,
			touchEnabled: false
		});

		row.add(titleLabel);

		return row;
	};

	var tableData = [];

	for (var i = 0, l = 100; i < l; i++) {
		var row = createRow('Row Index # ' + i);
		tableData.push(row);
	}

	var tableView = Ti.UI.createTableView({
		accessibilityLabel: 'TableView_35',
		allowsSelection: true,
		data: tableData,
		rowHeight: 80,
		top: 0
	});

	win.add(tableView);
	win.open();
*Test steps* - Create new classic app - Copy the code above into app.js - Run the app - Click on a random row - Row will flash red *Expected result* Row should stay highlighted and should only become de-highlighted when another row is selected. *Note (unexpected result)* If you long-press a row, you will notice that the text label color stays the same, irregardless of the highlightedColor property.

Comments

  1. Yordan Banev 2019-11-27

    Closing both this and the related ticket as Invalid, since the property is an iOS only.
  2. Sohail Saddique 2019-11-27

    Looks like we should close both tickets. Upon further investigation, the highlightedColor property is indeed not working as intended on Android. I'll create a ticket for this.

JSON Source