Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28290] Android: Scroll events do not fire for ListView and TableView

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2021-01-27T15:29:18.000+0000
Affected Version/sRelease 9.3.0
Fix Version/sRelease 9.3.1
ComponentsAndroid
Labelsandroid, regression, tableview
ReporterAndreas Pingas
AssigneeGary Mathews
Created2020-12-15T09:26:31.000+0000
Updated2021-01-27T15:35:06.000+0000

Description

Hello, Listener scroll in tableview is not responding in the latest SDK 9.3.0 Could you please check. Thank you in advance.
var win = Ti.UI.createWindow();

var tableData = [];
for (let i =0; i <100; i++) {
  tableData.push({ title: i = ${i} });
}
var table = Ti.UI.createTableView({
  data: tableData
});
win.add(table);
table.addEventListener('scroll', () => {
  console.log('scrolling');
});
win.open();

Attachments

FileDateSize
ListViewCanScrollTest.js2020-12-17T23:02:47.000+00001206

Comments

  1. Ewan Harris 2020-12-15

    Below comment was made pre-coffee, I was testing against 9.2.2.GA... I can confirm this issue is a regression in 9.3.0.GA -[~andreas.pingas] I'm unable to reproduce your issue based on the following code, the scroll listener is firing when I scroll the TableView. Could you please provide a minimal sample to reproduce this issue-
  2. Gary Mathews 2020-12-17

    master: https://github.com/appcelerator/titanium_mobile/pull/12348
  3. Samir Mohammed 2021-01-18

    FR Passed, waiting on Jenkins build.
  4. Christopher Williams 2021-01-19

    merged to master, backport for 9_3_X merged for 9.3.1 target.
  5. martin 2021-01-27

    Note that with the fix above I get the following crash when scrolling a listview with zero items in the first section: java.lang.ClassCastException: ti.modules.titanium.ui.widget.listview.ListViewProxy cannot be cast to ti.modules.titanium.ui.widget.listview.ListSectionProxy at ti.modules.titanium.ui.widget.listview.TiListView.generateScrollPayload(TiListView.java:263)
  6. Samir Mohammed 2021-01-27

    Able to reproduce the issue mentioned above using the following test case
       const window = Ti.UI.createWindow();
       const emptySection = Ti.UI.createListSection({ headerTitle: "I'm an empty Section" });
       const listItems = [];
       for (let index = 0; index < 100; index++) {
        listItems[index] = {
        properties: {
        title: "Row " + (index + 1).toString()
        }
        };
       }
       const listSection = Ti.UI.createListSection({ headerTitle: "List Section" });
       listSection.items = listItems;
       const listView = Ti.UI.createListView({
        canScroll: true,
       });
       listView.sections = [emptySection, listSection];
       window.add(listView);
       window.open();
       
    *+Error:+*
       [ERROR]  InputEventReceiver: Exception dispatching input event.
       [INFO]   APSAnalyticsStore: crash.report
       [ERROR]  TiExceptionHandler: (main) [3,9994] ti.modules.titanium.ui.widget.listview.ListViewProxy cannot be cast to ti.modules.titanium.ui.widget.listview.ListSectionProxy
       [ERROR]  TiExceptionHandler:
       [ERROR]  TiExceptionHandler: ti.modules.titanium.ui.widget.listview.TiListView.generateScrollPayload(TiListView.java:263)
       [ERROR]  TiExceptionHandler: ti.modules.titanium.ui.widget.listview.TiListView$1.onScrolled(TiListView.java:98)
       [ERROR]  TiExceptionHandler: androidx.recyclerview.widget.RecyclerView.dispatchOnScrolled(RecyclerView.java:5173)
       [ERROR]  TiExceptionHandler: androidx.recyclerview.widget.RecyclerView.scrollByInternal(RecyclerView.java:1971)
       [ERROR]  TiExceptionHandler: androidx.recyclerview.widget.RecyclerView.onTouchEvent(RecyclerView.java:3391)
       [ERROR]  TiExceptionHandler: android.view.View.dispatchTouchEvent(View.java:13415)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3054)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2741)
       [ERROR]  TiExceptionHandler: ti.modules.titanium.ui.widget.listview.TiNestedRecyclerView.dispatchTouchEvent(TiNestedRecyclerView.java:109)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
       [ERROR]  TiExceptionHandler: com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:465)
       [ERROR]  TiExceptionHandler: com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1849)
       [ERROR]  TiExceptionHandler: android.app.Activity.dispatchTouchEvent(Activity.java:3993)
       [ERROR]  TiExceptionHandler: androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
       [ERROR]  TiExceptionHandler: com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:423)
       [ERROR]  TiExceptionHandler: android.view.View.dispatchPointerEvent(View.java:13674)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5482)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5285)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4947)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5004)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7505)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7474)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7435)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7630)
       [ERROR]  TiExceptionHandler: android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:188)
       [ERROR]  TiExceptionHandler: android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
       [ERROR]  TiExceptionHandler: android.view.I
       
  7. Samir Mohammed 2021-01-27

JSON Source