Fix negative balance not displaying

This commit is contained in:
Tanguy Herbron 2018-08-15 22:37:43 +02:00
parent 91418b73fa
commit 4bdffe22c4

View File

@ -207,7 +207,6 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface,
layoutRefresherRunnable = new Runnable() {
@Override
public void run() {
final List<View> currencyView = new ArrayList<>();
final List<Currency> renderedCurrencies = new ArrayList<>();
if (balanceManager.getTotalBalance() != null)
@ -215,7 +214,7 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface,
for (int i = 0; i < balanceManager.getTotalBalance().size(); i++) {
final Currency currency = balanceManager.getTotalBalance().get(i);
if (!currency.getSymbol().equals("USD") && ((currency.getBalance() * currency.getValue()) >= preferencesManager.getMinimumAmount())) {
if (!currency.getSymbol().equals("USD") && (Math.abs(currency.getBalance() * currency.getValue()) >= preferencesManager.getMinimumAmount())) {
//currencyView.add(layoutGenerator.getInfoLayout(currency, totalValue, preferencesManager.isBalanceHidden()));
renderedCurrencies.add(currency);
}