Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28308] Android: ListView "noresults" event no longer fired as of 9.3.0

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionUnresolved
Affected Version/sRelease 9.3.0
Fix Version/sRelease 9.3.1
ComponentsAndroid
LabelsListView, SearchBar, android, regression, searchview
ReporterJoshua Quick
AssigneeGary Mathews
Created2021-01-04T20:53:04.000+0000
Updated2021-01-21T18:18:56.000+0000

Description

*Summary:* As of Titanium 9.3.0, Android's ListView no longer fires a "noresults" event when the text you enter into the SearchBar/SearchView shows no results in the list. https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ListView-event-noresults *Steps to reproduce:*

Build and run the below on Android.

Tap on the top search bar.

Enter "x" into the search.

Notice that "@@@ noresults" is not logged when it should.

function createListViewSectionItems() {
	var items = [];
	for (var index = 1; index <= 100; index++) {
//		items.push({ properties: { title: "Row " + index } });
		items.push({ properties: { title: "Row " + index, searchableText: "Row " + index } });
//		items.push({ properties: { title: "Row " + index, searchableText: "Test " + index } });
	}
	return items;
}

var window = Ti.UI.createWindow();
var listView = Ti.UI.createListView({
	sections: [Ti.UI.createListSection({
		headerTitle: "ListView",
		items: createListViewSectionItems(),
	})],
	searchView: Ti.UI.createSearchBar({ showCancel: true }),
//	searchView: Ti.UI.Android.createSearchView(),
});
listView.addEventListener("noresults", () => {
	Ti.API.info("@@@ noresults");
});
window.add(listView);
window.open();
*Note:* This is the code we lost since upgrading to RecyclerView in 9.3.0. https://github.com/appcelerator/titanium_mobile/blob/9_2_X/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiListView.java#L729-L744

Comments

  1. Gary Mathews 2021-01-07

    master: https://github.com/appcelerator/titanium_mobile/pull/12363
  2. Samir Mohammed 2021-01-21

    FR Passed, Waiting on Jenkins build and backport.
  3. Christopher Williams 2021-01-21

    squash merged to master, backport PR to 9_3_X is merged for 9.3.1 target.

JSON Source