Skip to content

Commit

Permalink
2.6.0-26004
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielWeigl committed Jan 14, 2016
1 parent e342ad5 commit b59e904
Show file tree
Hide file tree
Showing 7 changed files with 837 additions and 861 deletions.
2 changes: 1 addition & 1 deletion public/mbw/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ android {
buildToolsVersion androidSdkBuildVersion

defaultConfig {
versionCode 26003
versionCode 26004
versionName '2.6.0'
multiDexEnabled true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,18 +587,24 @@ private List<com.coinapult.api.httpclient.Transaction.Json> getHistoryWithExtras
if (accountHistory == null) {
return Lists.newArrayList();
}
Function<com.coinapult.api.httpclient.Transaction.Json, String> tx = new Function<com.coinapult.api.httpclient.Transaction.Json, String>() {
Function<com.coinapult.api.httpclient.Transaction.Json, String> txMapping = new Function<com.coinapult.api.httpclient.Transaction.Json, String>() {
@Nullable
@Override
public String apply(@Nullable com.coinapult.api.httpclient.Transaction.Json input) {
return input.tid;
}
};
ImmutableMap<String, Transaction.Json> id2Tx1 = Maps.uniqueIndex(extraHistory, tx);
ImmutableMap<String, com.coinapult.api.httpclient.Transaction.Json> id2Tx2 = Maps.uniqueIndex(accountHistory, tx);
ImmutableMap<String, Transaction.Json> localHistoryMap = Maps.uniqueIndex(extraHistory, txMapping);
final HashMap<String, Transaction.Json> historyMap = new HashMap<String, Transaction.Json>();
for (Transaction.Json historyEntry : accountHistory) {
// sometimes the entry contains the same tx twice - timing problem in combination with paging-request
if (!historyMap.containsKey(historyEntry.tid)) {
historyMap.put(historyEntry.tid, historyEntry);
}
}
HashMap<String, Transaction.Json> merged = Maps.newHashMap();
merged.putAll(id2Tx1);
merged.putAll(id2Tx2); //accountHistory overwrites local results
merged.putAll(localHistoryMap);
merged.putAll(historyMap); //accountHistory overwrites local results
Collection<Transaction.Json> unfiltered = merged.values();
Iterable<com.coinapult.api.httpclient.Transaction.Json> withoutConversion = Iterables.filter(unfiltered, TX_NOT_CONVERSION);
ImmutableList<Transaction.Json> ret = Ordering.natural().onResultOf(new Function<com.coinapult.api.httpclient.Transaction.Json, Comparable>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public View getView(final int position, View convertView, ViewGroup parent) {
tvName.setText("");
}

if (billPay.payment != null) {
if (billPay.payment != null && billPay.payment.amount != null) {
tvAmount.setText(Utils.formatFiatValueAsString(billPay.payment.amount) + " " + billPay.payment.currency);
tvReference.setText(billPay.payment.reference);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ public CashilaService(String baseUrl, Bus eventBus) {

RestAdapter adapter = new RestAdapter.Builder()
.setEndpoint(baseUrl + API_VERSION + "/")
//.setLogLevel(RestAdapter.LogLevel.BASIC)
.setLogLevel(RestAdapter.LogLevel.FULL)
.setLogLevel(RestAdapter.LogLevel.BASIC)
//.setLogLevel(RestAdapter.LogLevel.FULL)
.setConverter(new JacksonConverter(objectMapper))
.setClient(new OkClient(client))
.setRequestInterceptor(apiIdInterceptor)
Expand All @@ -134,7 +134,6 @@ public CashilaService(String baseUrl, Bus eventBus) {
RestAdapter plainTextAdapter = new RestAdapter.Builder()
.setEndpoint(baseUrl + API_VERSION + "/")
.setLogLevel(RestAdapter.LogLevel.BASIC)
//.setLogLevel(RestAdapter.LogLevel.FULL)
.setConverter(new PlainTextConverter())
.setClient(new OkClient(client))
.setRequestInterceptor(apiIdInterceptor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,12 @@ private double getSelectedPremium() {
@Override
public void onClick(View arg0) {
enableUi(false);
String priceFormulaId = Preconditions.checkNotNull(getSelectedPriceFormula()).id;
final PriceFormula selectedPriceFormula = getSelectedPriceFormula();
if (selectedPriceFormula == null){
// cancel if we dont have a price formula available - user can go back and retry it, but dont crash
return;
}
String priceFormulaId = Preconditions.checkNotNull(selectedPriceFormula).id;
double premium = Preconditions.checkNotNull(getSelectedPremium());
TradeChangeParameters params = new TradeChangeParameters(_tradeSession.id, priceFormulaId, premium);
Intent result = new Intent();
Expand Down
Loading

0 comments on commit b59e904

Please sign in to comment.