Skip to content

Commit 952cb2b

Browse files
czancodinguser
authored andcommitted
Fix widgets with negative values being green
The number used to calculate whether a widget is red or green should be the same value as the one that is displayed. It was instead calling a (buggy) method which calculated a different balance to the one displayed. This patch fixes it to determine the colour using the same value as the one it is displaying.
1 parent 724a686 commit 952cb2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/main/java/org/gnucash/android/ui/homescreen/WidgetConfigurationActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public static void updateWidget(final Context context, int appWidgetId, String a
233233

234234
views.setTextViewText(R.id.transactions_summary,
235235
accountBalance.formattedString(Locale.getDefault()));
236-
int color = account.getBalance().isNegative() ? R.color.debit_red : R.color.credit_green;
236+
int color = accountBalance.isNegative() ? R.color.debit_red : R.color.credit_green;
237237
views.setTextColor(R.id.transactions_summary, context.getResources().getColor(color));
238238

239239

0 commit comments

Comments
 (0)