-
-
Notifications
You must be signed in to change notification settings - Fork 365
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
Empty state for payloads #325
Conversation
// Invalidating menu, because we need to hide menu items for empty payloads | ||
requireActivity().invalidateOptionsMenu() | ||
|
||
payloadBinding.loadingProgress.visibility = 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.
I'm not really sure what is going here. Why is this view first set to VISIBLE
and then to GONE
in the same lambda?
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.
It is a ProgressBar. We show it when trying to fetch the payload and hide when it is fetched.
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.
But is it suspended or something? Wouldn't it result always in GONE
since the code is executed in one function?
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, it works fine with showing progress on screen opening and hiding it properly.
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.
Ahh… I checked the code out in the IDE. Process payload suspends so it allows for changing progress visibility. Too bad it is not that obvious via GH. :(
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.
Generally looks good 👍 Just a couple of minor comments.
The UI looks awesome btw!
...y/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadAdapter.kt
Show resolved
Hide resolved
library/src/main/res/layout/chucker_fragment_transaction_payload.xml
Outdated
Show resolved
Hide resolved
.../src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadFragment.kt
Outdated
Show resolved
Hide resolved
Co-Authored-By: Nicola Corti <corti.nico@gmail.com>
What about the idea of moving |
Yeah definitely 👍 Are you going to take care of this? |
Yes |
📷 Screenshots
📄 Context
This PR closes #276 by checking request or response payload and showing corresponding state in case any of them is empty.
📝 Changes
TransactionPayloadAdater
is declared and gets its items.RecyclerView
toonViewCreated
, so we could get rid of logcat messagesNo adapter attached
.📎 Related PR
This PR would require some updates in #305 and #323, since there were changes in same classes.
⏱️ Next steps
While working on this PR I came to conclusion that we should move
processPayload
method toTransactionViewModel
, because it is left from times when we had noViewModel
s at all and because transformation of items into view items looks like a job forViewModel
.However, I would postpone it till #305, #323 and my planned PR with search improvement gets merged to avoid too much updates requirements for those PRs.