Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28327] Android: Parity for ListView's "selectionStyle" and "[de]selectItem" methods

GitHub Issuen/a
TypeImprovement
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2021-09-10T09:28:30.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.1.0
ComponentsAndroid, iOS
Labelsparity
ReporterHans Knöchel
AssigneeGary Mathews
Created2021-01-25T12:33:08.000+0000
Updated2021-09-10T09:28:30.000+0000

Description

This is a conditional code scenario that we have since day one: Designing a non-clickable cell on iOS and Android, ending up doing the following:
{
    properties: {
        selectionStyle: OS_ANDROID ? undefined : Ti.UI.iOS.ListViewCellSelectionStyle.NONE
    }
}
What this ticket aims for is to move Ti.UI.iOS.ListViewCellSelectionStyle.NONE to Ti.UI.ListViewCellSelectionStyle.NONE, add Android parity and also deprecate the existing iOS constants Ti.UI.iOS.ListViewCellSelectionStyle.BLUE and Ti.UI.iOS.ListViewCellSelectionStyle.GRAY in favor of Ti.UI.ListViewCellSelectionStyle.DEFAULT (which is selectable in reflects the current behavior of iOS and Android). Finally (and less critical), Android should support the selectItem(...) and deselectItem(...) properties which is used to manually set a selection (using selectItem)) or clear a selection after tapping a selectable cell (using deselectItem). For us this would fix 39+ conditional statements immediately.

Comments

  1. Gary Mathews 2021-05-11

    master: https://github.com/appcelerator/titanium_mobile/pull/12769

JSON Source