Updated on 2026-08-14
This commit is contained in:
parent
51644f496e
commit
3be1a1e694
33 changed files with 638 additions and 289 deletions
|
|
@ -6,8 +6,8 @@ import android.widget.CompoundButton
|
|||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.tangem.SessionEnvironment
|
||||
import com.tangem.SessionError
|
||||
import com.tangem.TangemSdk
|
||||
import com.tangem.TangemSdkError
|
||||
import com.tangem.common.CompletionResult
|
||||
import com.tangem.tangem_sdk_new.extensions.init
|
||||
import kotlinx.android.synthetic.main.activity_test_user_data.*
|
||||
|
|
@ -92,8 +92,8 @@ class TestUserDataActivity : AppCompatActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun handleError(tv: TextView, error: SessionError) {
|
||||
if (error is SessionError.UserCancelled) return
|
||||
private fun handleError(tv: TextView, error: TangemSdkError) {
|
||||
if (error is TangemSdkError.UserCancelled) return
|
||||
|
||||
runOnUiThread { tv.text = error::class.simpleName }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import android.view.View
|
|||
import androidx.annotation.UiThread
|
||||
import androidx.lifecycle.*
|
||||
import com.google.gson.Gson
|
||||
import com.tangem.SessionError
|
||||
import com.tangem.TangemSdk
|
||||
import com.tangem.TangemSdkError
|
||||
import com.tangem.commands.Card
|
||||
import com.tangem.commands.CommandResponse
|
||||
import com.tangem.common.CompletionResult
|
||||
|
|
@ -133,7 +133,7 @@ class ActionViewModel(private val itemsManager: ItemsManager) : ViewModel(), Lif
|
|||
|
||||
internal class Notifier(private val vm: ActionViewModel) {
|
||||
|
||||
private var notShowedError: SessionError? = null
|
||||
private var notShowedError: TangemSdkError? = null
|
||||
private val gson: Gson = ResponseJsonConverter().gson
|
||||
|
||||
fun handleActionResult(result: CompletionResult<*>, list: List<Item>) {
|
||||
|
|
@ -163,10 +163,10 @@ internal class Notifier(private val vm: ActionViewModel) {
|
|||
}
|
||||
}
|
||||
|
||||
private fun handleError(error: SessionError) {
|
||||
private fun handleError(error: TangemSdkError) {
|
||||
Log.d(this, "error = $error")
|
||||
when (error) {
|
||||
is SessionError.UserCancelled -> {
|
||||
is TangemSdkError.UserCancelled -> {
|
||||
if (notShowedError == null) {
|
||||
vm.seError.postValue("User canceled the action")
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue