Updated on 2026-08-14
This commit is contained in:
parent
ebc3abcfe1
commit
10c0b8e680
10 changed files with 66 additions and 66 deletions
|
|
@ -7,6 +7,7 @@ import android.nfc.Tag
|
|||
import android.os.Bundle
|
||||
import android.support.v7.app.AppCompatActivity
|
||||
import com.tangem.App
|
||||
import com.tangem.Constant
|
||||
import com.tangem.di.Navigator
|
||||
import com.tangem.presentation.fragment.LoadedWallet
|
||||
import com.tangem.wallet.R
|
||||
|
|
@ -20,7 +21,7 @@ class LoadedWalletActivity : AppCompatActivity() {
|
|||
companion object {
|
||||
fun callingIntent(context: Context, lastTag: Tag, cardInfo: Bundle): Intent {
|
||||
val intent = Intent(context, LoadedWalletActivity::class.java)
|
||||
intent.putExtra(MainActivity.EXTRA_LAST_DISCOVERED_TAG, lastTag)
|
||||
intent.putExtra(Constant.EXTRA_LAST_DISCOVERED_TAG, lastTag)
|
||||
intent.putExtras(cardInfo)
|
||||
return intent
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import android.widget.RelativeLayout
|
|||
import android.widget.Toast
|
||||
import com.scottyab.rootbeer.RootBeer
|
||||
import com.tangem.App
|
||||
import com.tangem.Constant
|
||||
import com.tangem.data.Logger
|
||||
import com.tangem.data.db.PINStorage
|
||||
import com.tangem.data.network.ServerApiCommon
|
||||
|
|
@ -52,13 +53,6 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
companion object {
|
||||
val TAG: String = MainActivity::class.java.simpleName
|
||||
|
||||
private const val REQUEST_CODE_SEND_EMAIL = 3
|
||||
private const val REQUEST_CODE_ENTER_PIN_ACTIVITY = 2
|
||||
const val REQUEST_CODE_SHOW_CARD_ACTIVITY = 1
|
||||
private const val REQUEST_CODE_REQUEST_CAMERA_PERMISSIONS = 3
|
||||
|
||||
const val EXTRA_LAST_DISCOVERED_TAG = "extra_last_tag"
|
||||
|
||||
fun callingIntent(context: Context) = Intent(context, MainActivity::class.java)
|
||||
|
||||
fun commonInit(context: Context) {
|
||||
|
|
@ -155,7 +149,7 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
// check if root device
|
||||
val rootBeer = RootBeer(this)
|
||||
if (rootBeer.isRootedWithoutBusyBoxCheck && !BuildConfig.DEBUG)
|
||||
RootFoundDialog().show(fragmentManager, RootFoundDialog.TAG)
|
||||
RootFoundDialog().show(supportFragmentManager, RootFoundDialog.TAG)
|
||||
|
||||
// set listeners
|
||||
fab.setOnClickListener { showMenu(it) }
|
||||
|
|
@ -180,19 +174,19 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
NfcManager.verifyPermissions(this)
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
|
||||
Log.e("QRScanActivity", "User hasn't granted permission to use camera")
|
||||
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.CAMERA), REQUEST_CODE_REQUEST_CAMERA_PERMISSIONS)
|
||||
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.CAMERA), Constant.REQUEST_CODE_REQUEST_CAMERA_PERMISSIONS)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
when (requestCode) {
|
||||
REQUEST_CODE_SEND_EMAIL -> {
|
||||
Constant.REQUEST_CODE_SEND_EMAIL -> {
|
||||
if (zipFile != null) {
|
||||
zipFile!!.delete()
|
||||
zipFile = null
|
||||
}
|
||||
}
|
||||
REQUEST_CODE_ENTER_PIN_ACTIVITY -> {
|
||||
Constant.REQUEST_CODE_ENTER_PIN_ACTIVITY -> {
|
||||
if (resultCode == Activity.RESULT_OK && lastTag != null)
|
||||
onTagDiscovered(lastTag!!)
|
||||
else
|
||||
|
|
@ -454,7 +448,7 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
private fun doEnterPIN() {
|
||||
val intent = Intent(this, PinRequestActivity::class.java)
|
||||
intent.putExtra("mode", PinRequestActivity.Mode.RequestPIN.toString())
|
||||
startActivityForResult(intent, REQUEST_CODE_ENTER_PIN_ACTIVITY)
|
||||
startActivityForResult(intent, Constant.REQUEST_CODE_ENTER_PIN_ACTIVITY)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -19,13 +19,11 @@ class VerifyCardActivity : AppCompatActivity() {
|
|||
lateinit var navigator: Navigator
|
||||
|
||||
companion object {
|
||||
fun callingIntent(context: Context, card: TangemCard, coinData: CoinData, message: String, error: String): Intent {
|
||||
fun callingIntent(context: Context, card: TangemCard, coinData: CoinData): Intent {
|
||||
val intent = Intent(context, VerifyCardActivity::class.java)
|
||||
intent.putExtra(TangemCard.EXTRA_UID, card.uid)
|
||||
intent.putExtra(TangemCard.EXTRA_CARD, card.asBundle)
|
||||
intent.putExtra(Constant.EXTRA_BLOCKCHAIN_DATA, coinData.asBundle())
|
||||
intent.putExtra(Constant.MESSAGE, message)
|
||||
intent.putExtra(Constant.ERROR, error)
|
||||
return intent
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue