Skip to content

Remove the usage of deprecated methods#131

Open
nikhildahake wants to merge 26 commits intoy-polek:developfrom
nikhildahake:develop
Open

Remove the usage of deprecated methods#131
nikhildahake wants to merge 26 commits intoy-polek:developfrom
nikhildahake:develop

Conversation

@nikhildahake
Copy link

@nikhildahake nikhildahake commented May 11, 2025

This pull request reduces the number of deprecated method warnings from 66 to 3.

Here is a summary of the changes:

  1. Replace AsyncTask.
  2. Replace MockitoAnnotations.initMocks().
  3. Add a separate class(TransmissionRemotePreferenceManager) to manage application preferences.
  4. Replace getAdapterPosition() with getBindingAdapterPosition().
  5. Use getSupportFragmentManager() instead of getFragmentManager().
  6. Update deprecated method params.
  7. Remove the usage of setHasOptionsMenu().
  8. Remove the usage of startActivityForResult(). Use ActivityResultLauncher instead.
  9. Update onAttach() to use Context instead of Activity.
  10. Unable to run tests on emulator. So, changed useUnifiedTestPlatform => false
  11. Update calls to deprecated methods with their updated versions. eg:
    a) context.getResources.getColor(R.color.alternative_accent) -> context.getResources.getColor(R.color.alternative_accent, null)
  12. Update deprecated imports.

Video: https://www.loom.com/share/e084450a7e3c45eb8f0796c9b93b0f70?sid=2d8d61bd-c5e8-4d43-a668-e2206d5e872c

2. Use getSupportFragmentManager() instead of getFragmentManager()
2. Remove the usage of setTargetFragment() method
3. Use getBindingAdapterPosition instead of getAdapterPosition()
2) Remove the usage of Async task.
3) Use ActivityResultLauncher instead of startActivityForResult().
4) Remove unused methods.
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.

1 participant