[TIMOB-28329] Android: touchFeedback property on ListView is ignored and true by default
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-03-12T19:43:22.000+0000 |
Affected Version/s | Release 9.3.0, Release 9.2.2, Release 9.3.1 |
Fix Version/s | Release 10.0.0 |
Components | Android |
Labels | n/a |
Reporter | Rene Pot |
Assignee | Gary Mathews |
Created | 2021-01-27T12:37:57.000+0000 |
Updated | 2021-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);
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.
[~jquick] I tried setting it to different rows too, but that also doesn't remove it. I tried these methods:
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.GAmaster: https://github.com/appcelerator/titanium_mobile/pull/12440
FR Passed, waiting on Jenkins build.
merged to master, cherry-picked to 10_0_X for 10.0.0 target