Updated on 2026-08-14
This commit is contained in:
parent
82d085161e
commit
6343890eb5
6 changed files with 41 additions and 16 deletions
|
|
@ -63,6 +63,7 @@ class IdFragment : BaseFragment(), NfcAdapter.ReaderCallback,
|
|||
private var cardProtocol: CardProtocol? = null
|
||||
private var refreshAction: Runnable? = null
|
||||
private var hasIdInfo: Boolean? = null
|
||||
private var toast: Toast? = null
|
||||
|
||||
private var requestCounter: Int = 0
|
||||
set(value) {
|
||||
|
|
@ -172,6 +173,7 @@ class IdFragment : BaseFragment(), NfcAdapter.ReaderCallback,
|
|||
|
||||
override fun onStop() {
|
||||
srl?.removeCallbacks(refreshAction)
|
||||
toast?.cancel()
|
||||
super.onStop()
|
||||
}
|
||||
|
||||
|
|
@ -203,7 +205,6 @@ class IdFragment : BaseFragment(), NfcAdapter.ReaderCallback,
|
|||
if (cardProtocol.card.isIDCard) {
|
||||
if (cardProtocol.card.hasIDCardData()) {
|
||||
|
||||
Toast.makeText(activity, "ID card: ${cardProtocol.card.idCardData.fullName}", Toast.LENGTH_SHORT).show()
|
||||
ctx.card = cardProtocol.card
|
||||
|
||||
tvBalanceLine1?.visibility = View.VISIBLE
|
||||
|
|
@ -221,9 +222,8 @@ class IdFragment : BaseFragment(), NfcAdapter.ReaderCallback,
|
|||
refresh()
|
||||
|
||||
} else {
|
||||
Toast.makeText(activity, "Empty ID card", Toast.LENGTH_SHORT).show()
|
||||
rlToolButtons?.visibility = View.VISIBLE
|
||||
tvBalanceLine1?.text = "Empty ID card".toUpperCase()
|
||||
tvBalanceLine1?.text = resources.getString(R.string.id_empty).toUpperCase(Locale.ENGLISH)
|
||||
tvBalanceLine1?.setTextSize(18F)
|
||||
tvBalanceLine1?.visibility = View.VISIBLE
|
||||
hasIdInfo = false
|
||||
|
|
@ -239,8 +239,10 @@ class IdFragment : BaseFragment(), NfcAdapter.ReaderCallback,
|
|||
if (cardProtocol.error is CardProtocol.TangemException_ExtendedLengthNotSupported)
|
||||
if (!NoExtendedLengthSupportDialog.allReadyShowed)
|
||||
activity?.supportFragmentManager?.let { NoExtendedLengthSupportDialog().show(it, NoExtendedLengthSupportDialog.TAG) }
|
||||
else
|
||||
Toast.makeText(activity, R.string.general_notification_scan_again, Toast.LENGTH_SHORT).show()
|
||||
else {
|
||||
toast = Toast.makeText(activity, R.string.general_notification_scan_again, Toast.LENGTH_SHORT)
|
||||
toast?.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ class WriteIdFragment : BaseFragment(), NavigationResultListener,
|
|||
private lateinit var ctx: TangemContext
|
||||
private lateinit var tx: ByteArray
|
||||
private lateinit var mpFinishSignSound: MediaPlayer
|
||||
private var toast: Toast? = null
|
||||
|
||||
private var idWasWritten = false
|
||||
|
||||
|
|
@ -92,6 +93,7 @@ class WriteIdFragment : BaseFragment(), NavigationResultListener,
|
|||
|
||||
override fun onStop() {
|
||||
writeIDCardTask?.cancel(true)
|
||||
toast?.cancel()
|
||||
super.onStop()
|
||||
}
|
||||
|
||||
|
|
@ -170,8 +172,10 @@ class WriteIdFragment : BaseFragment(), NavigationResultListener,
|
|||
override fun onComplete(success: Boolean) {
|
||||
if (success) {
|
||||
navigateUp(R.id.main)
|
||||
} else
|
||||
} else {
|
||||
toast?.cancel()
|
||||
navigateUp(R.id.issueNewIdFragment)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onProgress() {
|
||||
|
|
@ -224,7 +228,10 @@ class WriteIdFragment : BaseFragment(), NavigationResultListener,
|
|||
NoExtendedLengthSupportDialog().show(requireFragmentManager(), NoExtendedLengthSupportDialog.TAG)
|
||||
}
|
||||
} else {
|
||||
if (!idWasWritten) Toast.makeText(context, R.string.general_notification_scan_again, Toast.LENGTH_LONG).show()
|
||||
if (!idWasWritten) {
|
||||
toast = Toast.makeText(context, R.string.general_notification_scan_again, Toast.LENGTH_SHORT)
|
||||
toast?.show()
|
||||
}
|
||||
}
|
||||
progressBar?.progress = 100
|
||||
progressBar?.progressTintList = ColorStateList.valueOf(Color.RED)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class EthIdEngine extends CoinEngine {
|
|||
|
||||
private static final String TAG = com.tangem.wallet.eth.EthEngine.class.getSimpleName();
|
||||
public EthIdData coinData = null;
|
||||
byte[] approvalPubKey = Util.hexToBytes("04EAD74FEEE4061044F46B19EB654CEEE981E9318F0C8FE99AF5CDB9D779D2E52BB51EA2D14545E0B323F7A90CF4CC72753C973149009C10DB2D83DCEC28487729"); //TODO
|
||||
private byte[] approvalPubKey = Util.hexToBytes("04EAD74FEEE4061044F46B19EB654CEEE981E9318F0C8FE99AF5CDB9D779D2E52BB51EA2D14545E0B323F7A90CF4CC72753C973149009C10DB2D83DCEC28487729"); //TODO
|
||||
public String approvalAddress = calculateAddress(approvalPubKey); //TODO
|
||||
|
||||
public EthIdEngine(TangemContext ctx) throws Exception {
|
||||
|
|
@ -232,12 +232,12 @@ public class EthIdEngine extends CoinEngine {
|
|||
public boolean validateBalance(BalanceValidator balanceValidator) {
|
||||
if (coinData != null && coinData.isHasApprovalTx()) {
|
||||
balanceValidator.setScore(100);
|
||||
balanceValidator.setFirstLine(R.string.verified);
|
||||
balanceValidator.setFirstLine(R.string.id_verified);
|
||||
balanceValidator.setSecondLine(R.string.balance_validator_second_line_unverified_balance);
|
||||
return false;
|
||||
} else {
|
||||
balanceValidator.setScore(0);
|
||||
balanceValidator.setFirstLine(R.string.not_registered);
|
||||
balanceValidator.setFirstLine(R.string.id_not_registered);
|
||||
balanceValidator.setSecondLine(R.string.balance_validator_second_line_unverified_balance);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.4" />
|
||||
app:layout_constraintGuide_percent="0.3" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/loIdentificationData"
|
||||
|
|
@ -90,6 +90,19 @@
|
|||
app:layout_constraintHeight_min="wrap"
|
||||
app:layout_constraintTop_toBottomOf="@+id/guideline">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDemoWarning"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:fontFamily="@font/maaxmedium"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/card_state_empty"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="normal"
|
||||
android:text="@string/id_demo"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvIdNumber"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/loCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="400dp"
|
||||
android:maxHeight="400dp"
|
||||
android:layout_height="300dp"
|
||||
android:maxHeight="300dp"
|
||||
android:padding="3dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintHeight_max="350dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="contentDescription"
|
||||
|
|
@ -15,7 +16,7 @@
|
|||
<ImageView
|
||||
android:id="@+id/ivPhoto"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="400dp"
|
||||
android:layout_height="300dp"
|
||||
android:src="@drawable/id_card_default"
|
||||
android:layout_centerInParent="true"/>
|
||||
|
||||
|
|
|
|||
|
|
@ -271,8 +271,10 @@
|
|||
<string name="tag_claimed">ALREADY CLAIMED</string>
|
||||
|
||||
<!-- Id Card -->
|
||||
<string name="verified">VERIFIED</string>
|
||||
<string name="not_registered">NOT REGISTERED</string>
|
||||
<string name="id_verified">VERIFIED</string>
|
||||
<string name="id_not_registered">NOT REGISTERED</string>
|
||||
<string name="id_demo">ID DEMO</string>
|
||||
<string name="id_empty">Empty ID card</string>
|
||||
|
||||
<!-- PinSave -->
|
||||
<string name="pin_save_btn_save">Save</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue