Updated on 2026-08-14
This commit is contained in:
parent
128b472c3f
commit
6c8c041c3d
16 changed files with 70 additions and 73 deletions
|
|
@ -36,6 +36,7 @@ import kotlinx.android.synthetic.main.layout_tangem_card.*
|
|||
import javax.inject.Inject
|
||||
import com.tangem.card_android.data.EXTRA_TANGEM_CARD
|
||||
import com.tangem.card_android.data.EXTRA_TANGEM_CARD_UID
|
||||
import com.tangem.di.ToastHelper
|
||||
|
||||
class EmptyWalletActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtocol.Notifications {
|
||||
companion object {
|
||||
|
|
@ -49,6 +50,8 @@ class EmptyWalletActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
|
||||
@Inject
|
||||
internal lateinit var navigator: Navigator
|
||||
@Inject
|
||||
internal lateinit var toastHelper: ToastHelper
|
||||
|
||||
private lateinit var nfcManager: NfcManager
|
||||
private lateinit var ctx: TangemContext
|
||||
|
|
@ -64,6 +67,7 @@ class EmptyWalletActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
setContentView(R.layout.activity_empty_wallet)
|
||||
|
||||
App.navigatorComponent.inject(this)
|
||||
App.toastHelperComponent.inject(this)
|
||||
|
||||
nfcManager = NfcManager(this, this)
|
||||
lifecycle.addObserver(NfcLifecycleObserver(nfcManager))
|
||||
|
|
@ -98,11 +102,12 @@ class EmptyWalletActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
if (cardProtocol != null)
|
||||
navigator.showVerifyCard(this, ctx)
|
||||
else
|
||||
UtilHelper.showSingleToast(this, getString(R.string.need_attach_card_again))
|
||||
toastHelper.showSingleToast(this, getString(R.string.need_attach_card_again))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (requestCode == Constant.REQUEST_CODE_CREATE_NEW_WALLET_ACTIVITY) {
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
if (data != null) {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import androidx.appcompat.app.AppCompatActivity
|
|||
import com.tangem.App
|
||||
import com.tangem.Constant
|
||||
import com.tangem.di.Navigator
|
||||
import com.tangem.di.ToastHelper
|
||||
import com.tangem.wallet.TangemContext
|
||||
import com.tangem.ui.fragment.LoadedWallet
|
||||
import com.tangem.wallet.R
|
||||
|
|
@ -18,6 +19,8 @@ class LoadedWalletActivity : AppCompatActivity() {
|
|||
|
||||
@Inject
|
||||
lateinit var navigator: Navigator
|
||||
@Inject
|
||||
internal lateinit var toastHelper: ToastHelper
|
||||
|
||||
companion object {
|
||||
fun callingIntent(context: Context, lastTag: Tag, ctx: TangemContext): Intent {
|
||||
|
|
@ -33,6 +36,7 @@ class LoadedWalletActivity : AppCompatActivity() {
|
|||
setContentView(R.layout.activity_loaded_wallet)
|
||||
|
||||
App.navigatorComponent.inject(this)
|
||||
App.toastHelperComponent.inject(this)
|
||||
|
||||
if (intent.extras!!.containsKey(NfcAdapter.EXTRA_TAG)) {
|
||||
val tag = intent.getParcelableExtra<Tag>(NfcAdapter.EXTRA_TAG)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ import com.tangem.ui.dialog.RootFoundDialog
|
|||
import com.tangem.ui.dialog.WaitSecurityDelayDialog
|
||||
import com.tangem.util.CommonUtil
|
||||
import com.tangem.util.LOG
|
||||
import com.tangem.util.PhoneUtility
|
||||
import com.tangem.util.UtilHelper
|
||||
import com.tangem.wallet.BuildConfig
|
||||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
|
|
@ -196,7 +196,7 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
f = Logger.collectLogs(this)
|
||||
if (f != null) {
|
||||
LOG.e(TAG, String.format("Collect %d log bytes", f.length()))
|
||||
CommonUtil.sendEmail(this, zipFile, TAG, "Logs", PhoneUtility.getDeviceInfo(), arrayOf(f))
|
||||
CommonUtil.sendEmail(this, zipFile, TAG, "Logs", UtilHelper.getDeviceInfo(), arrayOf(f))
|
||||
} else {
|
||||
LOG.e(TAG, "Can't create temporarily log file")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import androidx.appcompat.widget.Toolbar
|
|||
import com.tangem.wallet.R
|
||||
|
||||
class SettingsActivity : AppCompatActivity() {
|
||||
|
||||
companion object {
|
||||
fun callingIntent(context: Context) = Intent(context, SettingsActivity::class.java)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ class LoadedWallet : androidx.fragment.app.Fragment(), NfcAdapter.ReaderCallback
|
|||
intent.addCategory(Intent.CATEGORY_DEFAULT)
|
||||
startActivity(intent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
UtilHelper.showSingleToast(context, getString(R.string.no_compatible_wallet))
|
||||
(activity as LoadedWalletActivity).toastHelper.showSingleToast(context, getString(R.string.no_compatible_wallet))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -195,9 +195,9 @@ class LoadedWallet : androidx.fragment.app.Fragment(), NfcAdapter.ReaderCallback
|
|||
btnExtract.setOnClickListener {
|
||||
if (UtilHelper.isOnline(context as Activity))
|
||||
if (!engine.isExtractPossible)
|
||||
UtilHelper.showSingleToast(context, ctx.message)
|
||||
(activity as LoadedWalletActivity).toastHelper.showSingleToast(context, ctx.message)
|
||||
else if (ctx.card!!.remainingSignatures == 0)
|
||||
UtilHelper.showSingleToast(context, getString(R.string.card_has_no_remaining_signature))
|
||||
(activity as LoadedWalletActivity).toastHelper.showSingleToast(context, getString(R.string.card_has_no_remaining_signature))
|
||||
else
|
||||
(activity as LoadedWalletActivity).navigator.showPrepareTransaction(context as Activity, ctx)
|
||||
else
|
||||
|
|
@ -208,7 +208,7 @@ class LoadedWallet : androidx.fragment.app.Fragment(), NfcAdapter.ReaderCallback
|
|||
if (cardProtocol != null)
|
||||
(activity as LoadedWalletActivity).navigator.showVerifyCard(context as Activity, ctx)
|
||||
else
|
||||
UtilHelper.showSingleToast(context, getString(R.string.need_attach_card_again))
|
||||
(activity as LoadedWalletActivity).toastHelper.showSingleToast(context, getString(R.string.need_attach_card_again))
|
||||
}
|
||||
|
||||
btnNewScan.setOnClickListener { (activity as LoadedWalletActivity).navigator.showMain(context as Activity) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue