-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return SizeOnlyPlaceholder when the placeholder queue is empty #1733
Return SizeOnlyPlaceholder when the placeholder queue is empty #1733
Conversation
Co-authored-by: Jesse Wilson <[email protected]>
|
||
val visibleItemCount = localLastVisibleItemIndex - localFirstVisibleItemIndex | ||
val proposedPlaceholderPoolSize = visibleItemCount + visibleItemCount / 2 | ||
// We only ever want to increase the pool size. | ||
if (placeholderPoolSize < proposedPlaceholderPoolSize) { | ||
placeholderPoolSize = proposedPlaceholderPoolSize | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer needed
|
||
val visibleItemCount = localLastVisibleItemIndex - localFirstVisibleItemIndex | ||
val proposedPlaceholderPoolSize = visibleItemCount + visibleItemCount / 2 | ||
// We only ever want to increase the pool size. | ||
if (placeholderPoolSize < proposedPlaceholderPoolSize) { | ||
placeholderPoolSize = proposedPlaceholderPoolSize | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer needed
override fun createPlaceholder(original: View): View { | ||
return object : View(value.context) { | ||
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { | ||
setMeasuredDimension(original.width, original.height) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be implemented on emoji search compose and iOS
override fun uncaughtException(exception: Throwable) { | ||
Log.e("Treehouse", "uncaughtException", exception) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not directly related, added it to make debugging easier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that you referenced #1571. Are you implying that this PR would fix the issue?
This PR would return a |
Return a
SizeOnlyPlaceholder
when the placeholder queue is empty, which could happen when:Follow up:
createPlaceholder
for iOS and Android compose emoji searchissues: