Skip to content
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

Use RxJava instead of AsyncTask. #4499

Merged

Conversation

Isira-Seneviratne
Copy link
Member

@Isira-Seneviratne Isira-Seneviratne commented Oct 12, 2020

What is it?

  • Bug fix (user facing)
  • Feature (user facing)
  • Code base improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Use RxJava instead of AsyncTask to execute asynchronous code, as AsyncTask has been deprecated starting with API level 30.

Testing apk

debug.zip

Agreement

@Isira-Seneviratne Isira-Seneviratne marked this pull request as ready for review October 12, 2020 07:30
@Isira-Seneviratne Isira-Seneviratne changed the title WIP: Use RxJava instead of AsyncTask. Use RxJava instead of AsyncTask. Oct 12, 2020
@wb9688
Copy link
Contributor

wb9688 commented Oct 12, 2020

Could you fix the Checkstyle error: [ant:checkstyle] [ERROR] /home/travis/build/TeamNewPipe/NewPipe/app/src/main/java/org/schabi/newpipe/about/LicenseFragmentHelper.java:25:1: Class LicenseFragmentHelper should be declared as final. [FinalClass]? Did you test that everything still works?

@Isira-Seneviratne
Copy link
Member Author

Isira-Seneviratne commented Oct 12, 2020

Could you fix the Checkstyle error: [ant:checkstyle] [ERROR] /home/travis/build/TeamNewPipe/NewPipe/app/src/main/java/org/schabi/newpipe/about/LicenseFragmentHelper.java:25:1: Class LicenseFragmentHelper should be declared as final. [FinalClass]?

Done.

Did you test that everything still works?

The license fragment doesn't appear to have any issues. I'll upload a test APK.

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me, thank you!

@Isira-Seneviratne Isira-Seneviratne force-pushed the Replace_AsyncTasks_with_ReactiveX branch 3 times, most recently from 38ec288 to f08ac8a Compare October 25, 2020 23:36
Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Every time you call subscribe() you obtain a Disposable which should be saved somewhere, because it has to be dispose()d when the activity/app closes.

@Isira-Seneviratne Isira-Seneviratne force-pushed the Replace_AsyncTasks_with_ReactiveX branch 3 times, most recently from b55a57e to eb629ca Compare November 2, 2020 02:11
Stypox
Stypox previously approved these changes Nov 4, 2020
Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Code looks good to me, and it also solves many leaks. Could you provide an updated APK? Thank you ;-)

@Isira-Seneviratne
Copy link
Member Author

I uploaded a new APK.

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Everything works as expected. Thank you!

@Stypox Stypox merged commit c193b4f into TeamNewPipe:dev Nov 5, 2020
@Isira-Seneviratne Isira-Seneviratne deleted the Replace_AsyncTasks_with_ReactiveX branch November 5, 2020 12:04
This was referenced Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants