openMF / android-client

An android client for the MifosX platform
https://openmf.github.io/mobileapps.github.io/
Mozilla Public License 2.0
196 stars 581 forks source link

Swipe to refresh stops working after going to another fragment and coming back - clientListFragment #587

Closed meghalagrawal closed 5 years ago

meghalagrawal commented 7 years ago

Summary:

Swipe to refresh should work in all cases.It's not working when we switched to another fragment ( ex-create client or client details) or when we rotate the Screen and it keeps on showing progress bar.

OnRefresh method is called but none of onNext onComplete or onError is called from observable as the method onDestroyView() and its body calling unsubscribe for Observable.

Steps to reproduce:

How can we reproduce the issue?

We will need to retain fragment state or use cache operator for Saving our observable that will be useful in case of Screen Rotation and in any other case when we need to re-subscribe to our Observable.

Expected behaviour:

What did you expect the app to do?

The Swipe to refresh should work properly in all cases and should call the API in all cases reloading the list of Clients.

The Observable should unsubscribe when OnViewDestroyed is called but it should again be subscribed when View is again Shown.

Observed behaviour:

What did you see instead? Describe your issue in detail here.

The Swipe to refresh is working in normal case but when suppose we are going to create new Client from ClientListFragment's menu and pressing back to come back to ClientListFragment then its showing loader and trying to load new Client list but Loader keeps rotating as none of onNext, onCompleted, onError is called from ClientListPresenter's loadClients() method.

OnRefresh method is called but none of onNext, onComplete or onError is called from observable as the method onDestroyView() and its body calling unsubscribe for Observable.

Once Observable is Unsubscribed we are unable to subscribe it again.

Device and Android version:

version from the manufacturer or a custom ROM?

Android 6.0.1 - MI NOTE 4

Screenshots: screenshot_2017-03-15-03-01-38-533_com mifos mifosxdroid

Can be created by pressing the Volume Down and Power Button at the same time on Android 4.0 and higher.

meghalagrawal commented 7 years ago

Fixed this issue in Pull Request #588

Please Review Once.