Updated on 2026-08-14
This commit is contained in:
parent
452c5511bc
commit
cd34e37675
6 changed files with 46 additions and 35 deletions
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.tangem.wallet">
|
||||
|
||||
<uses-feature
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
<uses-permission android:name="android.permission.NFC" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
|
||||
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
|
|
@ -20,11 +21,13 @@
|
|||
<application
|
||||
android:name="com.tangem.App"
|
||||
android:allowBackup="true"
|
||||
android:fullBackupContent="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
android:theme="@style/AppTheme"
|
||||
tools:ignore="GoogleAppIndexingWarning">
|
||||
<provider
|
||||
android:name="com.tangem.data.LogFileProvider"
|
||||
android:authorities="@string/log_file_provider_authorities"
|
||||
|
|
|
|||
|
|
@ -27,5 +27,10 @@ object Constant {
|
|||
const val REQUEST_CODE_REQUEST_CAMERA_PERMISSIONS = 3
|
||||
|
||||
const val EXTRA_LAST_DISCOVERED_TAG = "extra_last_tag"
|
||||
const val EXTRA_PIN2 = "PIN2"
|
||||
|
||||
// LogoActivity
|
||||
const val EXTRA_AUTO_HIDE = "extra_auto_hide"
|
||||
const val MILLIS_AUTO_HIDE = 1000
|
||||
|
||||
}
|
||||
|
|
@ -6,10 +6,7 @@ import android.os.Bundle
|
|||
import com.tangem.Constant
|
||||
import com.tangem.domain.wallet.CoinData
|
||||
import com.tangem.domain.wallet.TangemCard
|
||||
import com.tangem.presentation.activity.EmptyWalletActivity
|
||||
import com.tangem.presentation.activity.LoadedWalletActivity
|
||||
import com.tangem.presentation.activity.MainActivity
|
||||
import com.tangem.presentation.activity.VerifyCardActivity
|
||||
import com.tangem.presentation.activity.*
|
||||
import com.tangem.presentation.fragment.LoadedWallet
|
||||
|
||||
class Navigator {
|
||||
|
|
@ -18,6 +15,14 @@ class Navigator {
|
|||
context.startActivity(MainActivity.callingIntent(context))
|
||||
}
|
||||
|
||||
fun showLogo(context: Activity, autoHide: Boolean) {
|
||||
context.startActivity(LogoActivity.callingIntent(context, autoHide))
|
||||
}
|
||||
|
||||
fun showPinSave(context: Activity, hasPin2: Boolean) {
|
||||
context.startActivity(PinSaveActivity.callingIntent(context, hasPin2))
|
||||
}
|
||||
|
||||
fun showLoadedWallet(context: Activity, lastTag: Tag, cardInfo: Bundle) {
|
||||
context.startActivityForResult(LoadedWalletActivity.callingIntent(context, lastTag, cardInfo), Constant.REQUEST_CODE_SHOW_CARD_ACTIVITY)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
package com.tangem.presentation.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
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.wallet.BuildConfig
|
||||
import com.tangem.wallet.R
|
||||
|
|
@ -15,8 +18,11 @@ class LogoActivity : AppCompatActivity() {
|
|||
companion object {
|
||||
val TAG: String = LogoActivity::class.java.simpleName
|
||||
|
||||
const val EXTRA_AUTO_HIDE = "extra_auto_hide"
|
||||
const val MILLIS_AUTO_HIDE = 1000
|
||||
fun callingIntent(context: Context, autoHide: Boolean): Intent {
|
||||
val intent = Intent(context, LogoActivity::class.java)
|
||||
intent.putExtra(Constant.EXTRA_AUTO_HIDE, autoHide)
|
||||
return intent
|
||||
}
|
||||
}
|
||||
|
||||
private val hideRunnable = Runnable { this.hide() }
|
||||
|
|
@ -42,8 +48,8 @@ class LogoActivity : AppCompatActivity() {
|
|||
else
|
||||
tvAppVersion.text = "BETA v." + BuildConfig.VERSION_NAME
|
||||
|
||||
if (intent.getBooleanExtra(EXTRA_AUTO_HIDE, true))
|
||||
ivLogo.postDelayed(hideRunnable, MILLIS_AUTO_HIDE.toLong())
|
||||
if (intent.getBooleanExtra(Constant.EXTRA_AUTO_HIDE, true))
|
||||
ivLogo.postDelayed(hideRunnable, Constant.MILLIS_AUTO_HIDE.toLong())
|
||||
}
|
||||
|
||||
private fun hide() {
|
||||
|
|
|
|||
|
|
@ -210,7 +210,6 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
val id = item.itemId
|
||||
|
||||
when (id) {
|
||||
R.id.sendLogs -> {
|
||||
var f: File? = null
|
||||
|
|
@ -231,17 +230,17 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
return true
|
||||
}
|
||||
R.id.managePIN -> {
|
||||
showSavePinActivity()
|
||||
navigator.showPinSave(this, false)
|
||||
return true
|
||||
}
|
||||
|
||||
R.id.managePIN2 -> {
|
||||
showSavePin2Activity()
|
||||
navigator.showPinSave(this, true)
|
||||
return true
|
||||
}
|
||||
|
||||
R.id.about -> {
|
||||
showLogoActivity()
|
||||
navigator.showLogo(this, false)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
@ -391,13 +390,6 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
onNfcReaderCallback = callback
|
||||
}
|
||||
|
||||
private fun showLogoActivity() {
|
||||
val intent = Intent(baseContext, LogoActivity::class.java)
|
||||
intent.putExtra(LogoActivity.TAG, true)
|
||||
intent.putExtra(LogoActivity.EXTRA_AUTO_HIDE, false)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
private fun animate() {
|
||||
val lp = llHand.layoutParams as RelativeLayout.LayoutParams
|
||||
val lp2 = llNfc.layoutParams as RelativeLayout.LayoutParams
|
||||
|
|
@ -418,18 +410,6 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
llHand.startAnimation(a)
|
||||
}
|
||||
|
||||
private fun showSavePinActivity() {
|
||||
val intent = Intent(baseContext, PinSaveActivity::class.java)
|
||||
intent.putExtra("PIN2", false)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
private fun showSavePin2Activity() {
|
||||
val intent = Intent(baseContext, PinSaveActivity::class.java)
|
||||
intent.putExtra("PIN2", true)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
private fun showMenu(v: View) {
|
||||
val popup = PopupMenu(this, v)
|
||||
val inflater = popup.menuInflater
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import android.annotation.TargetApi
|
|||
import android.app.Dialog
|
||||
import android.app.KeyguardManager
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.hardware.fingerprint.FingerprintManager
|
||||
import android.os.Build
|
||||
|
|
@ -19,9 +20,10 @@ import android.text.TextUtils
|
|||
import android.view.View
|
||||
import android.widget.Button
|
||||
import android.widget.Toast
|
||||
import com.tangem.Constant
|
||||
import com.tangem.data.db.PINStorage
|
||||
import com.tangem.data.fingerprint.ConfirmWithFingerprintTask
|
||||
import com.tangem.data.fingerprint.FingerprintHelper
|
||||
import com.tangem.data.db.PINStorage
|
||||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.activity_pin_save.*
|
||||
import kotlinx.android.synthetic.main.layout_pin_buttons.*
|
||||
|
|
@ -38,6 +40,16 @@ import javax.crypto.spec.IvParameterSpec
|
|||
|
||||
class PinSaveActivity : AppCompatActivity(), FingerprintHelper.FingerprintHelperListener {
|
||||
|
||||
companion object {
|
||||
val TAG: String = PinSaveActivity::class.java.simpleName
|
||||
|
||||
fun callingIntent(context: Context, hasPin2: Boolean): Intent {
|
||||
val intent = Intent(context, PinSaveActivity::class.java)
|
||||
intent.putExtra(Constant.EXTRA_PIN2, hasPin2)
|
||||
return intent
|
||||
}
|
||||
}
|
||||
|
||||
private var confirmWithFingerprintTask: ConfirmWithFingerprintTask? = null
|
||||
private var keyStore: KeyStore? = null
|
||||
private var cipher: Cipher? = null
|
||||
|
|
@ -58,7 +70,7 @@ class PinSaveActivity : AppCompatActivity(), FingerprintHelper.FingerprintHelper
|
|||
|
||||
// MainActivity.commonInit(applicationContext)
|
||||
|
||||
usePIN2 = intent.getBooleanExtra("PIN2", false)
|
||||
usePIN2 = intent.getBooleanExtra(Constant.EXTRA_PIN2, false)
|
||||
|
||||
if (usePIN2)
|
||||
tvPinPrompt.text = getString(R.string.enter_pin2_and_use_fingerprint_to_save_it)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue