Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(superapp): AND-6173 Add ctas for dashboard (#4094)
* add buttons * add buttons and fix couple of bugs * make buttons flow+eligibility * button clicks * button clicks * button clicks * button clicks * button clicks * buy * ktlint * fix tests
- Loading branch information
1 parent
073d3b8
commit 1abd620
Showing
24 changed files
with
502 additions
and
14 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
37 changes: 37 additions & 0 deletions
37
app/src/main/java/piuk/blockchain/android/ui/home/AssetActionsNavigationImpl.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,37 @@ | ||
package piuk.blockchain.android.ui.home | ||
|
||
import androidx.activity.ComponentActivity | ||
import com.blockchain.coincore.AssetAction | ||
import com.blockchain.home.presentation.navigation.AssetActionsNavigation | ||
import org.koin.androidx.compose.get | ||
import piuk.blockchain.android.campaign.CampaignType | ||
import piuk.blockchain.android.ui.kyc.navhost.KycNavHostActivity | ||
|
||
class AssetActionsNavigationImpl(private val activity: ComponentActivity?) : AssetActionsNavigation { | ||
private val actionsResultContract = | ||
activity?.registerForActivityResult(ActionActivity.BlockchainActivityResultContract()) { | ||
when (it) { | ||
ActionActivity.ActivityResult.StartKyc -> launchKyc() | ||
is ActionActivity.ActivityResult.StartReceive -> launchReceive() | ||
ActionActivity.ActivityResult.StartBuyIntro -> launchBuy() | ||
null -> { | ||
} | ||
} | ||
} | ||
|
||
private fun launchBuy() { | ||
actionsResultContract!!.launch(ActionActivity.ActivityArgs(action = AssetAction.Buy, null)) | ||
} | ||
|
||
private fun launchReceive() { | ||
actionsResultContract!!.launch(ActionActivity.ActivityArgs(AssetAction.Receive)) | ||
} | ||
|
||
private fun launchKyc() { | ||
KycNavHostActivity.start(activity!!, campaignType = CampaignType.None) | ||
} | ||
|
||
override fun navigate(assetAction: AssetAction) { | ||
return actionsResultContract!!.launch(ActionActivity.ActivityArgs(action = assetAction, 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
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
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
Oops, something went wrong.