Comments (4)
@danielpassos how do you get RuntimeException? In my example if I remove the call from updateDataset (the only point where is called) it simply doesn't filter anymore.
filterItems is a new function, but it's an option for the developer to call it if he wants to use the search, but being protected it cannot be called from the Activity and it must be called from the adapter implementation.
You also say that the constructor should accept the list and assign it to mItems?
from flexibleadapter.
how do you get RuntimeException? In my example if I remove the call from updateDataset (the only point where is called) it simply doesn't filter anymore.
I mean if you don't call updateDataset
nor filterItems
you got a NPE. I'll create a new blank project to show you the problem.
You also say that the constructor should accept the list and assign it to mItems?
Yes. I think it's more natural/intuitive/commons for developer. In 100% of adapters, we pass the list of data in constructor (like in ArrayAdapter). It make sure we always will have the data set
from flexibleadapter.
The reason the constructor doesn't accept the list, it's that updateDataset is called often in the Activity, so it's nice to centralize the point where the data is loaded and I've identified that method.
I can try but I need some time to apply the changes in a convenient way.
PS. Better if you keep tabulation to indent the code.
from flexibleadapter.
For the moment I added a constructor that accept the list and initialize mItems.
Then, it's always the developer that should call super(List) or still initialize mItems by himself in his Adapter implementation.
from flexibleadapter.
Related Issues (20)
- Sticky headers lag when using beginDelayedTransition()
- Sticky header item view
- Double sticky header
- Support theme refences on fast scroller
- Probable major bug in private filterItemsAsync() method.
- Items are not deleted after filter
- Elevation is not applied correctly with getActivationElevation HOT 1
- Comment of return value of 'OnItemClickListener.onItemClick()' may mislead.
- 'SelectableAdapter.toggleSelection()' doesn't toggle selection in SINGLE mode. HOT 1
- FastScroller - setHandleAlwaysVisible does not effect
- Example of eu.davidea.flexibleadapter.FlexibleAdapter.DiffUtilCallback implementation HOT 1
- [Sticky headers]The real Header is invisiable
- How to collapse all items at start? HOT 1
- FYI: Bintray is shutting down on February 1st 2022 HOT 17
- Adding random text to item when scroll list
- flexibleadapter with sqlite
- AndroidX - Layout Inflation Failing on dependency later than com.google.android.material:material:1.0.0
- Further support? HOT 4
- Trying to get in touch regarding a security issue
- Sticky header items [Image Views, Text views with clicks] with expand/collapse feature
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flexibleadapter.