From 6dab7f422121ad6da03ab4fb09999ee5f11c3e8d Mon Sep 17 00:00:00 2001 From: AkshGautam Date: Thu, 15 Feb 2018 18:57:19 +0530 Subject: [PATCH] Fix Issue #891:Empty space when no staff associated and No external ID in groups --- .../online/centerdetails/CenterDetailsFragment.java | 6 +++++- .../online/groupdetails/GroupDetailsFragment.java | 6 +++++- mifosng-android/src/main/res/values/strings.xml | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerdetails/CenterDetailsFragment.java b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerdetails/CenterDetailsFragment.java index 499509b9a5b..20017f50b1e 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerdetails/CenterDetailsFragment.java +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/centerdetails/CenterDetailsFragment.java @@ -144,7 +144,11 @@ public void showProgressbar(boolean show) { public void showCenterDetails(CenterWithAssociations centerWithAssociations) { setToolbarTitle(centerWithAssociations.getName()); if (!centerWithAssociations.getActivationDate().isEmpty()) { - tvStaffName.setText(centerWithAssociations.getStaffName()); + if (centerWithAssociations.getStaffName() != null) { + tvStaffName.setText(centerWithAssociations.getStaffName()); + } else { + tvStaffName.setText(R.string.no_staff); + } tvActivationDate.setText(Utils.getStringOfDate (centerWithAssociations.getActivationDate())); } diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/groupdetails/GroupDetailsFragment.java b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/groupdetails/GroupDetailsFragment.java index 87c2b0d2286..0141d345ea2 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/groupdetails/GroupDetailsFragment.java +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/groupdetails/GroupDetailsFragment.java @@ -217,7 +217,11 @@ public void showGroup(Group group) { } setToolbarTitle(getString(R.string.group) + " - " + group.getName()); tv_fullName.setText(group.getName()); - tv_externalId.setText(group.getExternalId()); + if (group.getExternalId() != null) { + tv_externalId.setText(group.getExternalId()); + } else { + tv_externalId.setText(R.string.not_available); + } try { String dateString = Utils.getStringOfDate(group.getActivationDate()); diff --git a/mifosng-android/src/main/res/values/strings.xml b/mifosng-android/src/main/res/values/strings.xml index 4f110154f96..afe4473d52d 100755 --- a/mifosng-android/src/main/res/values/strings.xml +++ b/mifosng-android/src/main/res/values/strings.xml @@ -755,6 +755,7 @@ This Survey is Empty Account No: %1$s no staff + N.A Notes Empty Notes Failed to Fetch Notes