forked from thijooree/android
new nfc icon, hide cards, removed offline nfc payments
This commit is contained in:
@@ -9,7 +9,6 @@ import sh.sar.basedbank.ui.onboarding.OnboardingActivity
|
||||
import sh.sar.basedbank.util.CredentialStore
|
||||
import sh.sar.basedbank.BasedBankApp
|
||||
import sh.sar.basedbank.R
|
||||
import sh.sar.basedbank.nfc.BmlTapToPayActivity
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
@@ -22,20 +21,15 @@ class MainActivity : AppCompatActivity() {
|
||||
val store = CredentialStore(this)
|
||||
val hasCredentials = store.hasMibCredentials() || store.hasBmlCredentials() || store.hasFahipayCredentials()
|
||||
|
||||
// Tap to Pay shortcut: go straight to the standalone payment activity
|
||||
if (intent?.action == "sh.sar.basedbank.TAP_TO_PAY") {
|
||||
startActivity(Intent(this, BmlTapToPayActivity::class.java))
|
||||
finish()
|
||||
return
|
||||
}
|
||||
|
||||
val navDestination = when (intent?.action) {
|
||||
"sh.sar.basedbank.OPEN_TRANSFER" -> R.id.nav_transfer
|
||||
"sh.sar.basedbank.OPEN_SCAN_QR" -> R.id.nav_transfer
|
||||
"sh.sar.basedbank.OPEN_PAY_WITH_CARD" -> R.id.nav_pay_with_card
|
||||
"sh.sar.basedbank.TAP_TO_PAY" -> R.id.nav_pay_with_card
|
||||
else -> -1
|
||||
}
|
||||
val autoScan = intent?.action == "sh.sar.basedbank.OPEN_SCAN_QR"
|
||||
val autoTapMode = intent?.action == "sh.sar.basedbank.TAP_TO_PAY"
|
||||
|
||||
val target = when {
|
||||
!onboardingDone -> OnboardingActivity::class.java
|
||||
@@ -51,6 +45,7 @@ class MainActivity : AppCompatActivity() {
|
||||
startActivity(Intent(this, target).apply {
|
||||
if (navDestination != -1) putExtra("nav_destination", navDestination)
|
||||
if (autoScan) putExtra("auto_scan", true)
|
||||
if (autoTapMode) putExtra("auto_tap_mode", true)
|
||||
})
|
||||
finish()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user