Make UserActionResult a class instead of interface (1/2)
In ag/25970777, we introduced a new UserActionResult interface to allow the user to specify the distance of a user action, as well as changing the transition key of a user action. This CL made the UserActionResult an interface that was implemented by SceneKey, so that the old and most common syntax userActions=mapOf(Swipe.Up to Scenes.Foo) still compiles. After some discussions with other peers, it came out the the UserActionResult being an interface implemented by SceneKey was confusing. This CL makes the UserActionResult a class and instead overloads the infix `to` function in UserAction so that `UserAction to SceneKey` returns a Pair<UserAction, UserActionResult> instead of a Pair<UserAction, SceneKey>, still allowing the shorter and most common syntax to define user actions. Bug: 321932826 Test: PlatformComposeSceneTransitionLayoutTests Flag: N/A Change-Id: I99566aee81bdd14022e0eda2af9144525d77da49
Loading
Please register or sign in to comment