Updated on 2026-08-14
This commit is contained in:
parent
3c8806f9c7
commit
77c2ff30e5
6 changed files with 38 additions and 36 deletions
|
|
@ -53,6 +53,7 @@ dependencies {
|
|||
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
|
||||
implementation 'androidx.biometric:biometric:1.0.0-alpha03'
|
||||
implementation 'com.google.android.material:material:1.1.0-alpha02'
|
||||
implementation 'com.google.dagger:dagger:2.16'
|
||||
implementation 'com.google.zxing:core:3.3.3'
|
||||
|
|
|
|||
|
|
@ -173,8 +173,7 @@ class PinRequestActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Finge
|
|||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
if (fingerprintHelper != null)
|
||||
fingerprintHelper!!.cancel()
|
||||
fingerprintHelper?.cancel()
|
||||
|
||||
if (startFingerprintReaderTask != null) {
|
||||
startFingerprintReaderTask!!.cancel(true)
|
||||
|
|
@ -184,8 +183,7 @@ class PinRequestActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Finge
|
|||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
if (fingerprintHelper != null)
|
||||
fingerprintHelper!!.cancel()
|
||||
fingerprintHelper?.cancel()
|
||||
|
||||
if (startFingerprintReaderTask != null) {
|
||||
startFingerprintReaderTask!!.cancel(true)
|
||||
|
|
@ -214,7 +212,7 @@ class PinRequestActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Finge
|
|||
|
||||
@TargetApi(Build.VERSION_CODES.M)
|
||||
override fun authenticationSucceeded(result: FingerprintManager.AuthenticationResult) {
|
||||
LOG.i(TAG,"Authentication succeeded!")
|
||||
LOG.i(TAG, "Authentication succeeded!")
|
||||
val cipher = result.cryptoObject.cipher
|
||||
|
||||
if (mode == Mode.RequestNewPIN || mode == Mode.ConfirmNewPIN) {
|
||||
|
|
@ -242,34 +240,33 @@ class PinRequestActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Finge
|
|||
finish()
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun buttonClick(button: Button) {
|
||||
tvPin!!.text = tvPin!!.text.toString() + button.text as String
|
||||
tvPin.text = tvPin.text.toString() + button.text.toString()
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private fun testFingerPrintSettings(): Boolean {
|
||||
LOG.i(TAG,"Testing Fingerprint Settings")
|
||||
LOG.i(TAG, "Testing Fingerprint Settings")
|
||||
|
||||
val keyguardManager = getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
|
||||
fingerprintManager = getSystemService(Context.FINGERPRINT_SERVICE) as FingerprintManager
|
||||
|
||||
if (!keyguardManager.isKeyguardSecure) {
|
||||
LOG.i(TAG,"User hasn't enabled Lock Screen")
|
||||
LOG.i(TAG, "User hasn't enabled Lock Screen")
|
||||
return false
|
||||
}
|
||||
|
||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
|
||||
LOG.i(TAG,"User hasn't granted permission to use Fingerprint")
|
||||
LOG.i(TAG, "User hasn't granted permission to use Fingerprint")
|
||||
return false
|
||||
}
|
||||
|
||||
if (!fingerprintManager!!.hasEnrolledFingerprints()) {
|
||||
LOG.i(TAG,"User hasn't registered any fingerprints")
|
||||
LOG.i(TAG, "User hasn't registered any fingerprints")
|
||||
return false
|
||||
}
|
||||
|
||||
LOG.i(TAG,"Fingerprint authentication is set.\n")
|
||||
LOG.i(TAG, "Fingerprint authentication is set.\n")
|
||||
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import android.text.Html
|
|||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.tangem.App
|
||||
import com.tangem.Constant
|
||||
|
|
@ -20,6 +21,7 @@ import com.tangem.domain.wallet.CoinEngineFactory
|
|||
import com.tangem.domain.wallet.TangemContext
|
||||
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
|
||||
import com.tangem.tangemcard.android.reader.NfcManager
|
||||
import com.tangem.util.UtilHelper
|
||||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.activity_prepare_transaction.*
|
||||
import java.io.IOException
|
||||
|
|
@ -89,8 +91,12 @@ class PrepareTransactionActivity : AppCompatActivity(), NfcAdapter.ReaderCallbac
|
|||
}
|
||||
|
||||
btnVerify.setOnClickListener {
|
||||
val engine1 = CoinEngineFactory.create(ctx)
|
||||
if (!UtilHelper.isOnline(this)) {
|
||||
Toast.makeText(this, R.string.no_connection, Toast.LENGTH_LONG).show()
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
val engine1 = CoinEngineFactory.create(ctx)
|
||||
val strAmount: String = etAmount.text.toString().replace(",", ".")
|
||||
val amount = engine1!!.convertToAmount(etAmount.text.toString(), tvCurrency.text.toString())
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.tangem.presentation.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.tangem.util
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Color
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.tangem.presentation.activity.PrepareTransactionActivity">
|
||||
tools:context="com.tangem.presentation.activity.PrepareTransactionActivity"
|
||||
tools:ignore="contentDescription">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/maax"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/send_transaction"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="@dimen/text_size_large"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llFrom"
|
||||
|
|
@ -28,10 +28,10 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="@color/btn_light"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="24dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="24dp"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
android:fontFamily="@font/maax"
|
||||
android:text="@string/from_banknote"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="@dimen/text_size_medium"/>
|
||||
android:textSize="@dimen/text_size_medium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCardID"
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/text_size_medium"
|
||||
android:textStyle="bold"
|
||||
tools:text="BB00 0000 1210 0233"/>
|
||||
tools:text="BB00 0000 1210 0233" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
android:fontFamily="@font/maax"
|
||||
android:text="@string/with_balance"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="@dimen/text_size_medium"/>
|
||||
android:textSize="@dimen/text_size_medium" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
|
@ -78,14 +78,14 @@
|
|||
android:id="@+id/tvBalance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:fontFamily="@font/maax"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/text_size_medium"
|
||||
android:textStyle="bold"
|
||||
tools:text="4.51735 Btc"/>
|
||||
tools:text="4.51735 Btc" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -119,7 +119,7 @@
|
|||
android:textSize="@dimen/text_size_medium"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCamera"
|
||||
|
|
@ -129,7 +129,7 @@
|
|||
android:src="@drawable/qr_scan"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -137,12 +137,12 @@
|
|||
android:id="@+id/etWallet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:fontFamily="@font/maax"
|
||||
android:hint="@string/enter_wallet_address"
|
||||
android:inputType="text|textMultiLine|textNoSuggestions"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="text|textMultiLine|textNoSuggestions"
|
||||
android:padding="12dp"
|
||||
android:singleLine="false"
|
||||
android:textColor="@color/colorPrimaryDark"
|
||||
|
|
@ -150,7 +150,7 @@
|
|||
android:textSize="@dimen/text_size_medium"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/ivCamera"
|
||||
tools:layout_editor_absoluteY="2dp"/>
|
||||
tools:layout_editor_absoluteY="2dp" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -160,16 +160,16 @@
|
|||
android:id="@+id/textView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:fontFamily="@font/maax"
|
||||
android:text="@string/amount"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="@dimen/text_size_medium"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
@ -194,14 +194,14 @@
|
|||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_min="150dp"/>
|
||||
app:layout_constraintWidth_min="150dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCurrency"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:fontFamily="@font/maax"
|
||||
android:text="@string/m_btc"
|
||||
android:textColor="@color/primary"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue