-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert
BrowserSwitchResult
to Sealed Class (#88)
* Rename BrowserSwitchResult * Add BrowserSwitchResult sealed class * Update result returned from parseResult * Update demo activity * Remove BrowserSwitchStatus * Update CHANGELOG, README, and MIGRATION_GUIDE * Update doc strings Co-authored-by: sshropshire <[email protected]>
- Loading branch information
1 parent
5d0c40c
commit 0ab5c35
Showing
15 changed files
with
87 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
browser-switch/src/main/java/com/braintreepayments/api/BrowserSwitchResult.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.braintreepayments.api | ||
|
||
/** | ||
* The result of a browser switch obtained from [BrowserSwitchClient.parseResult] | ||
*/ | ||
sealed class BrowserSwitchResult { | ||
|
||
/** | ||
* The browser switch was successfully completed. See [resultInfo] for details. | ||
*/ | ||
class Success(val resultInfo: BrowserSwitchResultInfo) : BrowserSwitchResult() | ||
|
||
/** | ||
* No browser switch result was found. This is the expected result when a user cancels the | ||
* browser switch flow without completing by closing the browser, or navigates back to the app | ||
* without completing the browser switch flow. | ||
*/ | ||
object NoResult : BrowserSwitchResult() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
browser-switch/src/main/java/com/braintreepayments/api/BrowserSwitchStatus.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
demo/src/main/java/com/braintreepayments/api/demo/viewmodel/UiState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package com.braintreepayments.api.demo.viewmodel | ||
|
||
import com.braintreepayments.api.BrowserSwitchResult | ||
import com.braintreepayments.api.BrowserSwitchResultInfo | ||
|
||
data class UiState ( | ||
val browserSwitchResult: BrowserSwitchResult? = null, | ||
val browserSwitchResult: BrowserSwitchResultInfo? = null, | ||
val browserSwitchError: Exception? = null, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters