Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28329] Android: touchFeedback property on ListView is ignored and true by default

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2021-03-12T19:43:22.000+0000
Affected Version/sRelease 9.3.0, Release 9.2.2, Release 9.3.1
Fix Version/sRelease 10.0.0
ComponentsAndroid
Labelsn/a
ReporterRene Pot
AssigneeGary Mathews
Created2021-01-27T12:37:57.000+0000
Updated2021-03-12T19:43:22.000+0000

Description

The touchFeedback property on Android is completely ignored on any Ti.UI.ListView. The documentation also mention this property is disabled by default but this is also not the case. *Expected behaviour* - touchFeedback should be disabled by default - touchFeedback property should be toggleable - touchFeedbackColor property should be customizable Reproducable code (from ListView documentation, altered)
var win = Ti.UI.createWindow({backgroundColor: 'gray'});
var listView = Ti.UI.createListView({touchFeedback: true, backgroundColor: "#000", touchFeedbackColor: "red"});
var sections = [];
var fruitDataSet = [
    {properties: { title: 'Apple'}},
    {properties: { title: 'Banana'}},
];
var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits', items: fruitDataSet});

sections.push(fruitSection);
var vegDataSet = [
    {properties: { title: 'Carrots'}},
    {properties: { title: 'Potatoes'}},
];
var vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables', items: vegDataSet});
sections.push(vegSection);

listView.sections = sections;
win.add(listView);
win.open();
var fishDataSet = [
    {properties: { title: 'Cod'}},
    {properties: { title: 'Haddock'}},
];
var fishSection = Ti.UI.createListSection({ headerTitle: 'Fish', items: fishDataSet});
listView.appendSection(fishSection);

Comments

  1. Joshua Quick 2021-01-27

    First of all, touch feedback (ie: the touch ripple effect) should be enabled by default in ListView/TableView because that is the expected native behavior on Android. You can see this in pretty much in every native Android app. The same is true for buttons. Second, you're supposed to apply touch feedback to each individual row's view and not the entire ListView/TableView. The reason is because the touchFeedback feature is applied to a view's entire "background". Also, I'm pretty sure setting ListView property "selectedBackgroundColor" or "selectedBackgroundImage" disables the touch feedback ripple effect on all list items. You should be using those properties.
  2. Rene Pot 2021-01-28

    [~jquick] I tried setting it to different rows too, but that also doesn't remove it. I tried these methods:
       var fishDataSet = [
           {properties: { title: 'Cod'}, touchFeedback: false},
           {properties: { title: 'Haddock', touchFeedback: false}},
       ];
       
    Regarding the first point, seems valid! But then the documentation would need updating and probably needs clarification regarding the whole listview / vs items. I also tried applying selectedBackgroundColor but that doesn't do anything either. I tried applying it to both the listview and the listitem. Tried on 9.2.2.GA and 9.3.1.GA
  3. Gary Mathews 2021-02-04

    master: https://github.com/appcelerator/titanium_mobile/pull/12440
  4. Samir Mohammed 2021-03-12

    FR Passed, waiting on Jenkins build.
  5. Christopher Williams 2021-03-12

    merged to master, cherry-picked to 10_0_X for 10.0.0 target

JSON Source