Updated on 2026-08-14
This commit is contained in:
parent
c456f38210
commit
35adc604f8
8 changed files with 77 additions and 27 deletions
|
|
@ -1,13 +1,14 @@
|
|||
package com.tangem.presentation.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.support.v7.app.AppCompatActivity
|
||||
import com.tangem.data.network.ServerApiElectrum
|
||||
import com.tangem.App
|
||||
import com.tangem.di.Navigator
|
||||
import com.tangem.wallet.BuildConfig
|
||||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.activity_logo.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class LogoActivity : AppCompatActivity() {
|
||||
|
||||
|
|
@ -18,14 +19,17 @@ class LogoActivity : AppCompatActivity() {
|
|||
const val MILLIS_AUTO_HIDE = 1000
|
||||
}
|
||||
|
||||
private var serverApiElectrum: ServerApiElectrum = ServerApiElectrum()
|
||||
|
||||
private val hideRunnable = Runnable { this.hide() }
|
||||
|
||||
@Inject
|
||||
internal lateinit var navigator: Navigator
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_logo)
|
||||
|
||||
App.getNavigatorComponent().inject(this)
|
||||
|
||||
ivLogo.setOnClickListener { hide() }
|
||||
}
|
||||
|
||||
|
|
@ -43,8 +47,7 @@ class LogoActivity : AppCompatActivity() {
|
|||
}
|
||||
|
||||
private fun hide() {
|
||||
val intent = Intent(baseContext, MainActivity::class.java)
|
||||
startActivity(intent)
|
||||
navigator.showMain(this)
|
||||
finish()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,23 +53,19 @@ class PurgeActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoc
|
|||
|
||||
public override fun onResume() {
|
||||
super.onResume()
|
||||
nfcManager!!.onResume()
|
||||
nfcManager?.onResume()
|
||||
}
|
||||
|
||||
public override fun onPause() {
|
||||
nfcManager!!.onPause()
|
||||
if (purgeTask != null) {
|
||||
purgeTask!!.cancel(true)
|
||||
}
|
||||
nfcManager?.onPause()
|
||||
purgeTask?.cancel(true)
|
||||
super.onPause()
|
||||
}
|
||||
|
||||
public override fun onStop() {
|
||||
// dismiss enable NFC dialog
|
||||
nfcManager!!.onStop()
|
||||
if (purgeTask != null) {
|
||||
purgeTask!!.cancel(true)
|
||||
}
|
||||
nfcManager?.onStop()
|
||||
purgeTask?.cancel(true)
|
||||
super.onStop()
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +84,7 @@ class PurgeActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoc
|
|||
purgeTask!!.start()
|
||||
} else {
|
||||
// this Log.d(TAG, "Mismatch card UID (" + sUID + " instead of " + card.getUID() + ")");
|
||||
nfcManager!!.ignoreTag(isoDep.tag)
|
||||
nfcManager?.ignoreTag(isoDep.tag)
|
||||
}
|
||||
|
||||
} catch (e: Exception) {
|
||||
|
|
@ -109,9 +105,9 @@ class PurgeActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoc
|
|||
}
|
||||
|
||||
override fun onReadStart(cardProtocol: CardProtocol) {
|
||||
progressBar!!.post {
|
||||
progressBar!!.visibility = View.VISIBLE
|
||||
progressBar!!.progress = 5
|
||||
progressBar.post {
|
||||
progressBar.visibility = View.VISIBLE
|
||||
progressBar.progress = 5
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue