Updated on 2026-08-14

This commit is contained in:
Tangem 2019-01-26 19:03:06 +03:00
parent 40393e71b5
commit a6bb38ba64
3 changed files with 92 additions and 24 deletions

View file

@ -93,26 +93,6 @@ class CreateNewWalletActivity : AppCompatActivity(), NfcAdapter.ReaderCallback,
animate()
}
private fun animate() {
val lp = llHand.layoutParams as RelativeLayout.LayoutParams
val lp2 = llNfc.layoutParams as RelativeLayout.LayoutParams
val dp = resources.displayMetrics.density
val lm = dp * (69 + antenna.x * 75)
lp.topMargin = (dp * (-100 + antenna.y * 250)).toInt()
lp2.topMargin = (dp * (-125 + antenna.y * 250)).toInt()
llNfc.layoutParams = lp2
val a = object : Animation() {
override fun applyTransformation(interpolatedTime: Float, t: Transformation) {
lp.leftMargin = (lm * interpolatedTime).toInt()
llHand.layoutParams = lp
}
}
a.duration = 2000
a.interpolator = DecelerateInterpolator()
llHand.startAnimation(a)
}
override fun onTagDiscovered(tag: Tag) {
try {
// get IsoDep handle and run cardReader thread
@ -259,4 +239,24 @@ class CreateNewWalletActivity : AppCompatActivity(), NfcAdapter.ReaderCallback,
WaitSecurityDelayDialog.onReadAfterRequest(this)
}
private fun animate() {
val lp = llHand.layoutParams as RelativeLayout.LayoutParams
val lp2 = llNfc.layoutParams as RelativeLayout.LayoutParams
val dp = resources.displayMetrics.density
val lm = dp * (69 + antenna.x * 75)
lp.topMargin = (dp * (-100 + antenna.y * 250)).toInt()
lp2.topMargin = (dp * (-125 + antenna.y * 250)).toInt()
llNfc.layoutParams = lp2
val a = object : Animation() {
override fun applyTransformation(interpolatedTime: Float, t: Transformation) {
lp.leftMargin = (lm * interpolatedTime).toInt()
llHand.layoutParams = lp
}
}
a.duration = 2000
a.interpolator = DecelerateInterpolator()
llHand.startAnimation(a)
}
}