Updated on 2026-08-14

This commit is contained in:
Tangem 2018-09-28 10:23:03 +03:00
parent 8f77a7ab99
commit cd6da4efe7
8 changed files with 56 additions and 46 deletions

View file

@ -160,13 +160,12 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
val apiHelper = ServerApiHelper()
apiHelper.setLastVersionListener { response ->
try {
val responseVersionName=response.trim(' ','\n','\r','\t')
val responseBuildVersion=responseVersionName.split('.').last()
val appBuildVersion=BuildConfig.VERSION_NAME.split('.').last()
if (responseBuildVersion.toInt()>appBuildVersion.toInt()) Toast.makeText(this, "There is a new application version: $responseVersionName", Toast.LENGTH_LONG).show()
}
catch (E: Exception)
{
if (response.isNullOrEmpty()) return@setLastVersionListener
val responseVersionName = response.trim(' ', '\n', '\r', '\t')
val responseBuildVersion = responseVersionName.split('.').last()
val appBuildVersion = BuildConfig.VERSION_NAME.split('.').last()
if (responseBuildVersion.toInt() > appBuildVersion.toInt()) Toast.makeText(this, "There is a new application version: $responseVersionName", Toast.LENGTH_LONG).show()
} catch (E: Exception) {
E.printStackTrace()
}
}