Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27504] Android: touchFeedback / ripple does not work when tapped from child view

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2021-03-12T19:43:25.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.0.0
ComponentsAndroid
Labelsn/a
ReporterHans Knöchel
AssigneeGary Mathews
Created2019-10-25T17:43:53.000+0000
Updated2021-03-12T19:43:25.000+0000

Description

On Android, the touchFeedback property aka ripple does not work when tapped from child view. This is a common issue especially for list views, since Titanium now behaves very different to the native default behavior which handles ripple automatically. Please fix this basic issue. See the below code for details. Expected: The ripple color is shown for all touches. Actual: It only applies the ripple when tapped on the view itself. Bubbling does also not work.
var win = Ti.UI.createWindow();

var myTemplate = {
    childTemplates: [{
        type: 'Ti.UI.Label',
        bindId: 'title',
        properties: {
            left: 20
        }
    }]
};

var list = Ti.UI.createListView({
    templates: {
        'template': myTemplate
    },
    defaultItemTemplate: 'template',
    sections: [
        Ti.UI.createListSection({
            items: [{
                properties: {
                    backgroundColor: '#fff',
                    touchFeedback: true,
                    touchFeedbackColor: 'red',
                    height: 50,
                    itemId: 'my_cell'
                },
                title: {
                    text: 'My Title (click here)',
                    color: '#000'
                }
            }]
        })
    ]
});

win.add(list);
win.open();

Attachments

FileDateSize
bug.mov2019-10-25T18:17:25.000+0000314483

Comments

  1. Alan Hutton 2019-10-25

    [~hknoechel] I am able to reproduce in the emulator or on device configuration below. Axway Appcelerator Studio, build: 5.1.4.201909061933  macOS : 10.15 Node.js Version : 8.9.1 npm Version : 5.5.1 Appcelerator CLI : 7.1.1 Titanium CLI CLI Version : 5.2.1 node-appc Version : 0.2.49 Titanium SDKs : 8.2.0.GA Pixel 3a Android API 29 (device and emulator) Pixel 3a Android API 28 (emulator)
  2. Hans Knöchel 2019-10-25

    Alan (I cannot link others anymore btw): I attached an example video of the issue. If you click on the label, it does not apply the ripple. If you click on the free area around the label, it does. Tested on 8.2.0 as well as latest master.
  3. Alan Hutton 2019-10-25

    [~hknoechel] Updated my finding. Clicked not exactly on the right area apparently, and touch overlapped. Thanks for the clarification.
  4. Gary Mathews 2021-02-04

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

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

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

JSON Source