position in `fun isStickyHead(position: Int)` larger than models size.
See original GitHub issueI want a summary model to be the sticky header so I added the following check.
override fun isStickyHeader(position: Int): Boolean {
return adapter.getModelAtPosition(position).let { it is SummaryModel }
}
I noticed that after the state of this view changed, under some circumstances the view would crash. Through debugging I found that the position that passed into this function was larger than the count of the models. I have to do a check like this:
override fun isStickyHeader(position: Int): Boolean {
return position < adapter.copyOfModels.size && adapter.getModelAtPosition(position).let { it is SummaryModel }
}
However, I feel pretty weird about it. I wonder if it is a bug in this library?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Int) larger than models size in Epoxy android? - Stack Overflow
Position in fun isStickyHead(position: Int) larger than models size ... override fun buildModels(data: DataModel) { RoleHeader(interactor, ...
Read more >Modify a bit at a given position - GeeksforGeeks
We first create a mask that has set bit only at given position using bit wise shift. mask = 1 << position Then...
Read more >C++ Programming Review 3 Answers
For example, write code to dynamically allocate an array of 5 integers, initialize the array to { 10, 20, 30, 40, 50 },...
Read more >C# Decimal vs Double and Other Tips About Number Types
Learn about precision vs accuracy and when to use int, double, ... In other words, the range of double is several times larger...
Read more >Numeric Data Types - Snowflake Documentation
Snowflake also supports the FLOAT data type, which allows a wider range of values, although with less precision. DECIMAL , NUMERIC¶. Synonymous with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I encountered the similar problem, except when
isStickyHeader
is called, theposition
value it passed is negative.I’m using Epoxy
4.6.4
.So I decided to use more safe-condition in
isStickyHeader
:I’ll just leave it here to warn future users. (And to wait for fix, of course.)
Hello ! Any news on this particular bug ?