Skip to content

Commit

Permalink
codinguser#876 - Remove black color for 0 balance, to be homogeneous …
Browse files Browse the repository at this point in the history
…with TransactionTypeSwitch.setWidgetTextColor()
  • Loading branch information
JeanGarf committed Jun 14, 2020
1 parent b8d58a7 commit d92391b
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions app/src/main/java/org/gnucash/android/model/AccountType.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit d92391b

Please sign in to comment.