Updated on 2026-08-14
This commit is contained in:
parent
aad7f48601
commit
a79b496bb6
4 changed files with 66 additions and 33 deletions
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
25
.idea/misc.xml
generated
25
.idea/misc.xml
generated
|
|
@ -1,5 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="NullableNotNullManager">
|
||||
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
||||
<option name="myNullables">
|
||||
<value>
|
||||
<list size="5">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
||||
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
|
||||
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
||||
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myNotNulls">
|
||||
<value>
|
||||
<list size="4">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ android {
|
|||
applicationId "com.tangem.wallet"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 27
|
||||
versionCode 41
|
||||
versionCode 43
|
||||
versionName "0.85.5." + generateVersionName()
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,47 +20,55 @@ public class RateInfoTask extends ExchangeTask {
|
|||
|
||||
protected void onPostExecute(List<ExchangeRequest> requests) {
|
||||
super.onPostExecute(requests);
|
||||
LoadedWallet loadedWallet = reference.get();
|
||||
|
||||
for (ExchangeRequest request : requests) {
|
||||
if (request.error == null) {
|
||||
try {
|
||||
try {
|
||||
LoadedWallet loadedWallet = reference.get();
|
||||
|
||||
JSONArray arr = request.getAnswerList();
|
||||
for (int i = 0; i < arr.length(); ++i) {
|
||||
JSONObject obj = arr.getJSONObject(i);
|
||||
String currency = obj.getString("id");
|
||||
for (ExchangeRequest request : requests) {
|
||||
if (request.error == null) {
|
||||
try {
|
||||
|
||||
boolean stop = false;
|
||||
boolean stopAlter = false;
|
||||
if (currency.equals(request.currency)) {
|
||||
String usd = obj.getString("price_usd");
|
||||
JSONArray arr = request.getAnswerList();
|
||||
for (int i = 0; i < arr.length(); ++i) {
|
||||
JSONObject obj = arr.getJSONObject(i);
|
||||
String currency = obj.getString("id");
|
||||
|
||||
boolean stop = false;
|
||||
boolean stopAlter = false;
|
||||
if (currency.equals(request.currency)) {
|
||||
String usd = obj.getString("price_usd");
|
||||
|
||||
Float rate = Float.valueOf(usd);
|
||||
loadedWallet.mCard.setRate(rate);
|
||||
loadedWallet.updateViews();
|
||||
stop = true;
|
||||
}
|
||||
|
||||
if (currency.equals(request.currencyAlter)) {
|
||||
String usd = obj.getString("price_usd");
|
||||
|
||||
Float rate = Float.valueOf(usd);
|
||||
loadedWallet.mCard.setRateAlter(rate);
|
||||
loadedWallet.updateViews();
|
||||
stopAlter = true;
|
||||
}
|
||||
|
||||
if (stop && stopAlter) {
|
||||
break;
|
||||
}
|
||||
|
||||
Float rate = Float.valueOf(usd);
|
||||
loadedWallet.mCard.setRate(rate);
|
||||
loadedWallet.updateViews();
|
||||
stop = true;
|
||||
}
|
||||
|
||||
if (currency.equals(request.currencyAlter)) {
|
||||
String usd = obj.getString("price_usd");
|
||||
|
||||
Float rate = Float.valueOf(usd);
|
||||
loadedWallet.mCard.setRateAlter(rate);
|
||||
loadedWallet.updateViews();
|
||||
stopAlter = true;
|
||||
}
|
||||
|
||||
if (stop && stopAlter) {
|
||||
break;
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
} catch (NullPointerException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue