Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 880e981fef4f128359924cc208c9528f9f4d4cfd
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue May 26 13:37:39 2020
Rename invoke() to onLaunch()
Since ActivityResultLauncher now uses launch() instead of the kotlin
invoke(), we should change the name for the invoke() method in
ActivityResultRegistry to reflect the relationship.
Since the method in ActivityResultRegistry is called in response to the
launch() of the ActivityResultLauncher, it is fitting to rename invoke()
to onLaunch().
Test: ./gradlew checkApi
Bug: 157496491
Change-Id: I5c0a5f0604d74a39337a8fe2f3f708238c3d5725
M activity/activity/api/1.2.0-alpha06.txt
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_1.2.0-alpha06.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_1.2.0-alpha06.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/result/ActivityResultLauncherTest.kt
M activity/activity/src/androidTest/java/androidx/activity/result/ActivityResultRegistryTest.kt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
M activity/activity/src/main/java/androidx/activity/result/ActivityResultRegistry.java
https://android-review.googlesource.com/1318078
Branch: androidx-master-dev
commit 880e981fef4f128359924cc208c9528f9f4d4cfd
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue May 26 13:37:39 2020
Rename invoke() to onLaunch()
Since ActivityResultLauncher now uses launch() instead of the kotlin
invoke(), we should change the name for the invoke() method in
ActivityResultRegistry to reflect the relationship.
Since the method in ActivityResultRegistry is called in response to the
launch() of the ActivityResultLauncher, it is fitting to rename invoke()
to onLaunch().
Test: ./gradlew checkApi
Bug: 157496491
Change-Id: I5c0a5f0604d74a39337a8fe2f3f708238c3d5725
M activity/activity/api/1.2.0-alpha06.txt
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_1.2.0-alpha06.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_1.2.0-alpha06.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/result/ActivityResultLauncherTest.kt
M activity/activity/src/androidTest/java/androidx/activity/result/ActivityResultRegistryTest.kt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
M activity/activity/src/main/java/androidx/activity/result/ActivityResultRegistry.java
jb...@google.com <jb...@google.com> #3
This has been fixed internally and will be available in the Activity 1.2.0-alpha06 release.
Description
The
invoke()
method is the only API exposed fromActivityResultRegistry
. This used to make since becauseActivityResultLauncher
used the kotlininvoke()
and invoking the launcher would callinvoke()
on the registry. SinceActivityResultLauncher
has moved to usinglaunch()
this connection is no longer clear.We should change the
invoke()
inActivityResultRegistry
to beonLaunch()
so it is clear that it is executed once the call tolaunch()
is made.