Skip to content

feat: Add no internet view on TicketsFragment #1492

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

Merged
merged 2 commits into from
Apr 4, 2019
Merged

feat: Add no internet view on TicketsFragment #1492

merged 2 commits into from
Apr 4, 2019

Conversation

anhanh11001
Copy link
Contributor

Detail:
Add no internet card on Ticket Fragment and show it when there is no internet and no tickets retained in view model

Fixes: #1491

Screenshots for the change:

Detail:
Add no internet card on Ticket Fragment and show it when there is no internet and no tickets retained in view model

Fixes: #1491

private fun loadTickets() {
if (!isNetworkConnected(context) && ticketsViewModel.tickets.value.isNullOrEmpty())
showNoInternetScreen(true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you are showing no internet screen if tickets value is null or empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because if the tickets information is loaded and already retained in the ViewModel then I think we can just show that information, no need for no internet card

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anhanh11001 This is wrong. It should be shown from the ViewModel. I am merging this, but create an issue to move all network logic to VM. Use BroadcastReceiver to make it reactive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do it

liveHarshit
liveHarshit previously approved these changes Apr 1, 2019
@iamareebjamal iamareebjamal merged commit 86ee78f into fossasia:development Apr 4, 2019
@anhanh11001 anhanh11001 deleted the 1491_no_internet_tickets branch June 20, 2019 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants