From c3e4ff4cb1a2d138cb0f6efd9049b0685356eabb Mon Sep 17 00:00:00 2001 From: Lode Hoste Date: Tue, 17 Mar 2015 22:35:51 +0100 Subject: [PATCH] Set announce color green if at least one is connected (fixes #249) --- .../nutomic/syncthingandroid/fragments/DrawerFragment.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java b/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java index 639d46c8..16751e6b 100644 --- a/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java +++ b/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java @@ -182,12 +182,11 @@ public class DrawerFragment extends Fragment implements RestApi.OnReceiveSystemI }); mCpuUsage.setText(new DecimalFormat("0.00").format(info.cpuPercent) + "%"); mRamUsage.setText(RestApi.readableFileSize(mActivity, info.sys)); - if (info.extAnnounceConnected == info.extAnnounceTotal) { - mAnnounceServer.setText(android.R.string.ok); + mAnnounceServer.setText(Integer.toString(info.extAnnounceConnected) + "/" + + Integer.toString(info.extAnnounceTotal)); + if (info.extAnnounceConnected > 0) { mAnnounceServer.setTextColor(getResources().getColor(R.color.text_green)); } else { - mAnnounceServer.setText(Integer.toString(info.extAnnounceConnected) + "/" + - Integer.toString(info.extAnnounceTotal)); mAnnounceServer.setTextColor(getResources().getColor(R.color.text_red)); } }