[TIMOB-18069] Android: make ListSection.getItemCount() and/or getContentCount() public
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Critical |
Status | Closed |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | Release 9.3.0 |
Components | n/a |
Labels | engSchedule, listsection, listview, search, searchbar, searchview |
Reporter | Far |
Assignee | Gary Mathews |
Created | 2014-11-20T15:00:17.000+0000 |
Updated | 2020-11-20T00:25:07.000+0000 |
Description
For now it is not possible to get count if items inside list (or section) filtered by search view on android. ListSection.itemCount is avaliable for iOS (however not documented) but not for android.
It will be nice to get filtered items also.
Thank you for your suggestion. We will consider about it.
I wrote small plugin to access search item count https://github.com/farwayer/TiListSearchItems Maybe it will be useful to somebody.
PR for Android: https://github.com/appcelerator/titanium_mobile/pull/10040 It will add itemCount/getItemCount to ListSection for Android
I've rebased the PR, added unit tests, cleaned up commit messages and altered to expose as
Ti.UI.ListSection.filteredItemCount
on Android. I *did not* implement aTi.UI.ListSection.filteredItemCount
on iOS, nor did I expose anTi.UI.ListSection.itemCount
on Android. I suspect for parity we'd want both to be done. The latter is likely pretty easy, but the iOS filtered item count may be more involved as the filter results are calculated on theListView
and aren't really "shared" down to theListSection
cc [~vijaysingh]As a heads up, the Android ListView is going to be 100% rewritten to use RecyclerView in the near future, making this PR irrelevant. We can keep the feature request ticket, but it will have to be re-implemented.
master: https://github.com/appcelerator/titanium_mobile/pull/12029