Updated on 2026-08-14
This commit is contained in:
parent
8b5ed4f3e9
commit
c01895f6ab
3 changed files with 23 additions and 13 deletions
|
|
@ -85,9 +85,6 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
|
||||
// val waitSecurityDelayDialogNew = WaitSecurityDelayDialogNew()
|
||||
// waitSecurityDelayDialogNew.show(supportFragmentManager, WaitSecurityDelayDialogNew.TAG)
|
||||
|
||||
App.getNavigatorComponent().inject(this)
|
||||
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
|
|
|
|||
|
|
@ -20,12 +20,14 @@ import com.tangem.domain.wallet.CoinEngineFactory
|
|||
import com.tangem.domain.wallet.TangemContext
|
||||
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog
|
||||
import com.tangem.presentation.dialog.WaitSecurityDelayDialog
|
||||
import com.tangem.presentation.dialog.WaitSecurityDelayDialogNew
|
||||
import com.tangem.tangemcard.reader.CardProtocol
|
||||
import com.tangem.tangemcard.android.reader.NfcManager
|
||||
import com.tangem.tangemcard.android.reader.NfcReader
|
||||
import com.tangem.tangemcard.data.asBundle
|
||||
import com.tangem.tangemcard.tasks.SignTask
|
||||
import com.tangem.tangemcard.util.Util
|
||||
import com.tangem.util.LOG
|
||||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.activity_sign_payment.*
|
||||
|
||||
|
|
@ -252,16 +254,29 @@ class SignPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
}, 500)
|
||||
}
|
||||
|
||||
override fun onReadWait(msec: Int) {
|
||||
WaitSecurityDelayDialog.onReadWait(this, msec)
|
||||
}
|
||||
private val waitSecurityDelayDialogNew = WaitSecurityDelayDialogNew()
|
||||
|
||||
override fun onReadBeforeRequest(timeout: Int) {
|
||||
LOG.i(TAG, "onReadBeforeRequest timeout $timeout")
|
||||
WaitSecurityDelayDialog.onReadBeforeRequest(this, timeout)
|
||||
|
||||
}
|
||||
|
||||
override fun onReadAfterRequest() {
|
||||
LOG.i(TAG, "onReadAfterRequest")
|
||||
WaitSecurityDelayDialog.onReadAfterRequest(this)
|
||||
|
||||
}
|
||||
|
||||
override fun onReadWait(msec: Int) {
|
||||
LOG.i(TAG, "onReadWait msec $msec")
|
||||
WaitSecurityDelayDialog.onReadWait(this, msec)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -7,7 +7,6 @@ import android.os.Bundle
|
|||
import android.support.v7.app.AppCompatDialogFragment
|
||||
import android.widget.ProgressBar
|
||||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.dialog_wait_pin2.*
|
||||
import java.util.*
|
||||
|
||||
class WaitSecurityDelayDialogNew : AppCompatDialogFragment() {
|
||||
|
|
@ -31,11 +30,8 @@ class WaitSecurityDelayDialogNew : AppCompatDialogFragment() {
|
|||
val inflater = activity!!.layoutInflater
|
||||
val v = inflater.inflate(R.layout.dialog_wait_pin2, null)
|
||||
|
||||
isCancelable = false
|
||||
|
||||
pb = v.findViewById(R.id.progressBar)
|
||||
|
||||
|
||||
pb.max = msTimeout
|
||||
pb.progress = msProgress
|
||||
|
||||
|
|
@ -67,7 +63,8 @@ class WaitSecurityDelayDialogNew : AppCompatDialogFragment() {
|
|||
override fun run() {
|
||||
setup(timeout, DELAY_BEFORE_SHOW_DIALOG)
|
||||
isCancelable = false
|
||||
show(activity?.supportFragmentManager, TAG)
|
||||
// if (!isVisible)
|
||||
show(activity?.supportFragmentManager, TAG)
|
||||
}
|
||||
}, DELAY_BEFORE_SHOW_DIALOG.toLong())
|
||||
|
||||
|
|
@ -96,7 +93,8 @@ class WaitSecurityDelayDialogNew : AppCompatDialogFragment() {
|
|||
// 1000ms - card delay notification interval
|
||||
setup(msec + 1000, 1000)
|
||||
isCancelable = false
|
||||
show(activity?.supportFragmentManager, TAG)
|
||||
// if (!isVisible)
|
||||
show(activity?.supportFragmentManager, TAG)
|
||||
|
||||
} else
|
||||
setRemainingTimeout(msec)
|
||||
|
|
@ -119,7 +117,7 @@ class WaitSecurityDelayDialogNew : AppCompatDialogFragment() {
|
|||
} else {
|
||||
val newProgress = pb.max - msec
|
||||
if (pb.max > progress)
|
||||
progressBar.progress = newProgress
|
||||
pb.progress = newProgress
|
||||
else
|
||||
pb.max = progress + msec
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue