parse-community / Parse-SDK-Android

The Android SDK for Parse Platform
https://parseplatform.org/
Other
1.88k stars 735 forks source link

refactor: replace startActivityForResult with ActivityResultLauncher #1150

Closed Shvet closed 2 years ago

Shvet commented 2 years ago

New Pull Request Checklist

Issue Description

Related issue: startActivityForReuslt was deprecated in adnroidx and replace with ActivityResultLauncher. So i have edited Login method and added ActivityResultLauncher<Intent> as a variable.

Approach

login method has new variable for ActivityResultLauncher<Intent> which can be replaced for startActivityForResult. for example:

 val launcher: ActivityResultLauncher<Intent> = registerForActivityResult(
      ActivityResultContracts.StartActivityForResult()) { result ->
      ParseGoogleUtils.onActivityResult(result.resultCode, result.data!!)
 }

 // Login Using ParseGoogleUtils
 ParseGoogleUtils.logIn(requireContext(), launcher) { user, e -> }

TODOs before merging

parse-github-assistant[bot] commented 2 years ago

Thanks for opening this pull request!

mtrezza commented 2 years ago

@Shvet can you please review all checkboxes in the description? Could you also take a look at the lint issue reported?

codecov[bot] commented 2 years ago

Codecov Report

Merging #1150 (5c2e354) into master (447f972) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1150   +/-   ##
=========================================
  Coverage     66.81%   66.81%           
  Complexity     2249     2249           
=========================================
  Files           121      121           
  Lines          9892     9892           
  Branches       1332     1332           
=========================================
  Hits           6609     6609           
  Misses         2771     2771           
  Partials        512      512           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 447f972...5c2e354. Read the comment docs.

Shvet commented 2 years ago

@Shvet can you please review all checkboxes in the description? Could you also take a look at the lint issue reported?

@mtrezza do i have to create issue for this? i didn't find any for this pull? AS for lint i have run :spotlessApply please check it.

mtrezza commented 2 years ago

do i have to create issue for this?

that would be helpful, we want to separate issue discussion from PR (solution) discussion.

AS for lint i have run :spotlessApply please check it.

passes now

Shvet commented 2 years ago

Added issue

mtrezza commented 2 years ago

@L3K0V Do you think we can merge this?

azlekov commented 2 years ago

@mtrezza LGTM

parseplatformorg commented 2 years ago

🎉 This change has been released in version 3.0.1