Updated on 2026-08-14

This commit is contained in:
Tangem 2019-01-31 09:43:40 +03:00
commit 83aaebb422
6 changed files with 48 additions and 52 deletions

View file

@ -3,8 +3,6 @@ package com.tangem.presentation.dialog;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;

View file

@ -111,7 +111,7 @@ class LoadedWallet : androidx.fragment.app.Fragment(), NfcAdapter.ReaderCallback
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val engine=CoinEngineFactory.create(ctx)
val engine = CoinEngineFactory.create(ctx)
tvBalance.setSingleLine(!engine!!.needMultipleLinesForBalance())
@ -663,6 +663,8 @@ class LoadedWallet : androidx.fragment.app.Fragment(), NfcAdapter.ReaderCallback
requestCounter++
coinEngine!!.requestBalanceAndUnspentTransactions(
object : CoinEngine.BlockchainRequestsCallbacks {
override fun onComplete(success: Boolean) {
LOG.i(TAG, "requestBalanceAndUnspentTransactions onComplete: $success, request counter $requestCounter")
if (activity == null) return
@ -680,7 +682,12 @@ class LoadedWallet : androidx.fragment.app.Fragment(), NfcAdapter.ReaderCallback
}
override fun allowAdvance(): Boolean {
return context?.let { UtilHelper.isOnline(it) }!!
return try {
context?.let { UtilHelper.isOnline(it) }!!
} catch (e: KotlinNullPointerException) {
e.printStackTrace()
false
}
}
}
)