-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix eternal loading progress #719 #697 #814
base: main
Are you sure you want to change the base?
Conversation
Thanks for opening this. |
} | ||
} | ||
|
||
private fun setNoFiltersEmptyTextVisibility(visibility: Int) { | ||
noFiltersEmptyText.visibility = visibility | ||
private fun setEmptyStateVisibility(progressBar: Int, noData: Int, noFilter: Int) { |
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.
@QArtur99 Please use default value for params. this will avoid setEmptyStateVisibility(View.GONE, View.GONE, View.GONE)
it will become a simple call setEmptyStateVisibility() and as most of the params value is View.GONE we will not have to pass that again.
Thanks
loading.visibility = View.VISIBLE | ||
setNoFiltersEmptyTextVisibility(View.GONE) | ||
if (filtersAdapter.getEnabledFilterCount() > 0) { | ||
setEmptyStateVisibility(View.GONE, View.VISIBLE, View.GONE) |
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.
@QArtur99 Please consider creating extension function for view i.e fun View.visible() = visibility == View.VISIBLE
and fun View.gone() = visibility == View.GONE
this will be more readable.
Thanks
📢 Type of change
📜 Description
Fix eternal refreshing and empty state in HomeActivity
Fix eternal refreshing in Search
Feat placeholder when data are not available same like for no filters
💡 Motivation and Context
When only "Product Hunt" filter was selected and no data was available from the response, the progress was showing infinitely, also function onLoadMore in InfiniteScrollListener was refreshing infinitely when data was not available.
#719
if searched data was not available, LiveData didn't trigger because data loading function didn't assign an empty list to searchResult
#697
💚 How did you test it?
Manually
📝 Checklist
./gradlew spotlessApply
before submitting the PR🔮 Next steps
📸 Screenshots / GIFs
Edit