From d92391b800781ca3baa6135df543743c85bf6243 Mon Sep 17 00:00:00 2001 From: JeanGarf Date: Sun, 14 Jun 2020 18:22:10 +0200 Subject: [PATCH] #876 - Remove black color for 0 balance, to be homogeneous with TransactionTypeSwitch.setWidgetTextColor() --- .../gnucash/android/model/AccountType.java | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/org/gnucash/android/model/AccountType.java b/app/src/main/java/org/gnucash/android/model/AccountType.java index b45374ac7..6826f598b 100644 --- a/app/src/main/java/org/gnucash/android/model/AccountType.java +++ b/app/src/main/java/org/gnucash/android/model/AccountType.java @@ -1,6 +1,5 @@ package org.gnucash.android.model; -import android.content.Context; import android.support.annotation.ColorInt; import android.support.annotation.ColorRes; import android.widget.TextView; @@ -9,7 +8,6 @@ import org.gnucash.android.app.GnuCashApplication; import org.gnucash.android.ui.settings.PreferenceActivity; -import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -172,22 +170,9 @@ public void displayBalance(final TextView balanceTextView, @ColorInt int fontColor; - if (balance.asBigDecimal() - .compareTo(BigDecimal.ZERO) == 0) { - // balance is null + final boolean isCreditBalance = balance.isNegative(); - Context context = GnuCashApplication.getAppContext(); - - fontColor = context.getResources() - .getColor(android.R.color.black); - - } else { - // balance is not null - - final boolean isCreditBalance = balance.isNegative(); - - fontColor = getAmountColor(isCreditBalance); - } + fontColor = getAmountColor(isCreditBalance); balanceTextView.setTextColor(fontColor); }