From 678ccc8f3cc8087253f4d67aab2ea5a481a117e3 Mon Sep 17 00:00:00 2001
From: LZRS <12814349+LZRS@users.noreply.github.com>
Date: Thu, 30 Sep 2021 12:22:21 +0300
Subject: [PATCH 01/28] add descriptions for report labels
---
.../chw/application/ChwApplicationFlv.java | 10 ++++
.../drawable/ic_navigate_next_grey_24dp.xml | 9 +++
.../lmh/res/layout/reports_fragment_item.xml | 49 ++++++++++++++++
opensrp-chw/src/lmh/res/values/strings.xml | 4 ++
.../chw/application/ChwApplication.java | 4 ++
.../application/DefaultChwApplicationFlv.java | 10 ++++
.../smartregister/chw/domain/ReportType.java | 19 ++++++-
.../chw/fragment/ReportsFragment.java | 20 +++++--
.../chw/viewholder/ReportViewHolder.java | 11 ++++
.../drawable/ic_navigate_next_black_24dp.xml | 10 ++--
.../src/main/res/layout/reports_fragment.xml | 2 +-
.../main/res/layout/reports_fragment_item.xml | 56 ++++++++++++++-----
12 files changed, 178 insertions(+), 26 deletions(-)
create mode 100644 opensrp-chw/src/lmh/res/drawable/ic_navigate_next_grey_24dp.xml
create mode 100644 opensrp-chw/src/lmh/res/layout/reports_fragment_item.xml
diff --git a/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java b/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java
index 071e41b4ce..2390e5d8b0 100644
--- a/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java
+++ b/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java
@@ -156,4 +156,14 @@ public boolean showChildrenAboveTwoDueStatus(){
public boolean showIconsForChildrenUnderTwoAndGirlsAgeNineToEleven(){
return true;
}
+
+ @Override
+ public boolean showReportsDescription() {
+ return true;
+ }
+
+ @Override
+ public boolean showReportsDivider() {
+ return true;
+ }
}
diff --git a/opensrp-chw/src/lmh/res/drawable/ic_navigate_next_grey_24dp.xml b/opensrp-chw/src/lmh/res/drawable/ic_navigate_next_grey_24dp.xml
new file mode 100644
index 0000000000..c809dbee8f
--- /dev/null
+++ b/opensrp-chw/src/lmh/res/drawable/ic_navigate_next_grey_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/opensrp-chw/src/lmh/res/layout/reports_fragment_item.xml b/opensrp-chw/src/lmh/res/layout/reports_fragment_item.xml
new file mode 100644
index 0000000000..7484b7756a
--- /dev/null
+++ b/opensrp-chw/src/lmh/res/layout/reports_fragment_item.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/opensrp-chw/src/lmh/res/values/strings.xml b/opensrp-chw/src/lmh/res/values/strings.xml
index 00e11fd350..f6df6d046d 100644
--- a/opensrp-chw/src/lmh/res/values/strings.xml
+++ b/opensrp-chw/src/lmh/res/values/strings.xml
@@ -25,4 +25,8 @@
%s adults and %s U11 children
Are you sure you want to go back? All data you have entered in this form will be cleared.
+
+ List of children who can take the vaccines at a date in the future
+ Number of vaccine doses needed for children who can take the vaccine at a date in the future
+ Number on vaccines provided and child deaths in my area
\ No newline at end of file
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java b/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java
index 3d3b62a00b..406bcff066 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java
@@ -438,6 +438,10 @@ public interface Flavor {
boolean showIconsForChildrenUnderTwoAndGirlsAgeNineToEleven();
+ boolean showReportsDescription();
+
+ boolean showReportsDivider();
+
}
}
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java b/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java
index 06e6dae369..7521b3a90b 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java
@@ -216,4 +216,14 @@ public boolean showLastNameOnChildProfile() {
public boolean showIconsForChildrenUnderTwoAndGirlsAgeNineToEleven(){
return false;
}
+
+ @Override
+ public boolean showReportsDescription() {
+ return false;
+ }
+
+ @Override
+ public boolean showReportsDivider() {
+ return false;
+ }
}
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/domain/ReportType.java b/opensrp-chw/src/main/java/org/smartregister/chw/domain/ReportType.java
index 130202568d..3179bd8aa5 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/domain/ReportType.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/domain/ReportType.java
@@ -4,14 +4,29 @@
public class ReportType implements ListContract.Identifiable {
- private String id;
- private String name;
+ private final String id;
+ private final String name;
+ private String description;
public ReportType(String id, String name) {
this.id = id;
this.name = name;
}
+ public ReportType(String id, String name, String description){
+ this.id = id;
+ this.name = name;
+ this.description = description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
@Override
public String getID() {
return id;
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/fragment/ReportsFragment.java b/opensrp-chw/src/main/java/org/smartregister/chw/fragment/ReportsFragment.java
index 2ce8808407..135b9bbecd 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/fragment/ReportsFragment.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/fragment/ReportsFragment.java
@@ -8,6 +8,7 @@
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
+import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@@ -15,6 +16,7 @@
import org.smartregister.chw.activity.FragmentBaseActivity;
import org.smartregister.chw.adapter.ListableAdapter;
import org.smartregister.chw.adapter.ReportsFragmentAdapter;
+import org.smartregister.chw.application.ChwApplication;
import org.smartregister.chw.contract.ListContract;
import org.smartregister.chw.domain.ReportType;
import org.smartregister.chw.presenter.ListPresenter;
@@ -43,9 +45,15 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
presenter.fetchList(() -> {
List list = new ArrayList<>();
- list.add(new ReportType(getString(R.string.eligible_children), getString(R.string.eligible_children)));
- list.add(new ReportType(getString(R.string.doses_needed), getString(R.string.doses_needed)));
- list.add(new ReportType(getString(R.string.community_activity), getString(R.string.community_activity)));
+ if (ChwApplication.getApplicationFlavor().showReportsDescription()){
+ list.add(new ReportType(getString(R.string.eligible_children), getString(R.string.eligible_children), getString(R.string.eligible_children_description)));
+ list.add(new ReportType(getString(R.string.doses_needed), getString(R.string.doses_needed), getString(R.string.doses_needed_description)));
+ list.add(new ReportType(getString(R.string.community_activity), getString(R.string.community_activity), getString(R.string.community_activity_description)));
+ }else {
+ list.add(new ReportType(getString(R.string.eligible_children), getString(R.string.eligible_children)));
+ list.add(new ReportType(getString(R.string.doses_needed), getString(R.string.doses_needed)));
+ list.add(new ReportType(getString(R.string.community_activity), getString(R.string.community_activity)));
+ }
return list;
});
@@ -57,9 +65,13 @@ public void bindLayout() {
RecyclerView recyclerView = view.findViewById(R.id.recyclerView);
recyclerView.setHasFixedSize(false);
- RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext());
+ LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
recyclerView.setLayoutManager(layoutManager);
+ if (ChwApplication.getApplicationFlavor().showReportsDivider()){
+ recyclerView.addItemDecoration(new DividerItemDecoration(requireContext(), layoutManager.getOrientation()));
+ }
+
progressBar = view.findViewById(R.id.progress_bar);
progressBar.setVisibility(View.GONE);
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/viewholder/ReportViewHolder.java b/opensrp-chw/src/main/java/org/smartregister/chw/viewholder/ReportViewHolder.java
index 38aae34a6e..07df1c1741 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/viewholder/ReportViewHolder.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/viewholder/ReportViewHolder.java
@@ -6,28 +6,39 @@
import androidx.annotation.NonNull;
import org.smartregister.chw.R;
+import org.smartregister.chw.application.ChwApplication;
import org.smartregister.chw.contract.ListContract;
import org.smartregister.chw.domain.ReportType;
public class ReportViewHolder extends ListableViewHolder {
private TextView tvName;
+ private TextView tvDesc;
private View currentView;
public ReportViewHolder(@NonNull View itemView) {
super(itemView);
currentView = itemView;
tvName = itemView.findViewById(R.id.tvName);
+ if (ChwApplication.getApplicationFlavor().showReportsDescription()) {
+ tvDesc = itemView.findViewById(R.id.tvDesc);
+ }
}
@Override
public void bindView(ReportType reportType, ListContract.View view) {
tvName.setText(reportType.getName());
+ if (tvDesc != null){
+ tvDesc.setText(reportType.getDescription());
+ }
currentView.setOnClickListener(v -> view.onListItemClicked(reportType, v.getId()));
}
@Override
public void resetView() {
tvName.setText("");
+ if (tvDesc != null){
+ tvDesc.setText("");
+ }
}
}
diff --git a/opensrp-chw/src/main/res/drawable/ic_navigate_next_black_24dp.xml b/opensrp-chw/src/main/res/drawable/ic_navigate_next_black_24dp.xml
index 24835127dd..125885ad41 100644
--- a/opensrp-chw/src/main/res/drawable/ic_navigate_next_black_24dp.xml
+++ b/opensrp-chw/src/main/res/drawable/ic_navigate_next_black_24dp.xml
@@ -1,9 +1,9 @@
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z" />
diff --git a/opensrp-chw/src/main/res/layout/reports_fragment.xml b/opensrp-chw/src/main/res/layout/reports_fragment.xml
index f641ccdcea..b74cfa6a88 100644
--- a/opensrp-chw/src/main/res/layout/reports_fragment.xml
+++ b/opensrp-chw/src/main/res/layout/reports_fragment.xml
@@ -24,7 +24,7 @@
-
+ android:paddingRight="25dp"
+ android:paddingBottom="20dp">
-
+ android:orientation="vertical"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toStartOf="@+id/ivNext"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent">
+
+
+
+
+
+
+ android:layout_height="30dp"
+ android:src="@drawable/ic_navigate_next_black_24dp"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
-
\ No newline at end of file
+
From ed4625fa99fa8e92b2893e47c2b1c68cdf2658a5 Mon Sep 17 00:00:00 2001
From: LZRS <12814349+LZRS@users.noreply.github.com>
Date: Mon, 4 Oct 2021 15:29:23 +0300
Subject: [PATCH 02/28] make different lmh ui screen for bluetooth sync (#1913)
---
.../res/drawable/ic_transfer_data_receive.xml | 10 ++
.../res/drawable/ic_transfer_data_send.xml | 10 ++
.../drawable/p2p_card_text_color_selector.xml | 5 +
.../lmh/res/layout/fragment_mode_select.xml | 161 ++++++++++++++++++
opensrp-chw/src/lmh/res/values/strings.xml | 3 +
5 files changed, 189 insertions(+)
create mode 100644 opensrp-chw/src/lmh/res/drawable/ic_transfer_data_receive.xml
create mode 100644 opensrp-chw/src/lmh/res/drawable/ic_transfer_data_send.xml
create mode 100644 opensrp-chw/src/lmh/res/drawable/p2p_card_text_color_selector.xml
create mode 100644 opensrp-chw/src/lmh/res/layout/fragment_mode_select.xml
diff --git a/opensrp-chw/src/lmh/res/drawable/ic_transfer_data_receive.xml b/opensrp-chw/src/lmh/res/drawable/ic_transfer_data_receive.xml
new file mode 100644
index 0000000000..e1a5381c8c
--- /dev/null
+++ b/opensrp-chw/src/lmh/res/drawable/ic_transfer_data_receive.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/opensrp-chw/src/lmh/res/drawable/ic_transfer_data_send.xml b/opensrp-chw/src/lmh/res/drawable/ic_transfer_data_send.xml
new file mode 100644
index 0000000000..558afc034d
--- /dev/null
+++ b/opensrp-chw/src/lmh/res/drawable/ic_transfer_data_send.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/opensrp-chw/src/lmh/res/drawable/p2p_card_text_color_selector.xml b/opensrp-chw/src/lmh/res/drawable/p2p_card_text_color_selector.xml
new file mode 100644
index 0000000000..c58a8cb97e
--- /dev/null
+++ b/opensrp-chw/src/lmh/res/drawable/p2p_card_text_color_selector.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/opensrp-chw/src/lmh/res/layout/fragment_mode_select.xml b/opensrp-chw/src/lmh/res/layout/fragment_mode_select.xml
new file mode 100644
index 0000000000..f04c2bb05e
--- /dev/null
+++ b/opensrp-chw/src/lmh/res/layout/fragment_mode_select.xml
@@ -0,0 +1,161 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/opensrp-chw/src/lmh/res/values/strings.xml b/opensrp-chw/src/lmh/res/values/strings.xml
index f6df6d046d..bd6867f384 100644
--- a/opensrp-chw/src/lmh/res/values/strings.xml
+++ b/opensrp-chw/src/lmh/res/values/strings.xml
@@ -26,6 +26,9 @@
%s adults and %s U11 children
Are you sure you want to go back? All data you have entered in this form will be cleared.
+ Transfer Data
+ Tap to start receiving data from nearby device
+ Tap to start sending data to nearby device
List of children who can take the vaccines at a date in the future
Number of vaccine doses needed for children who can take the vaccine at a date in the future
Number on vaccines provided and child deaths in my area
From c967abca56dfffc38cb3cf4c133f3465127c9b5c Mon Sep 17 00:00:00 2001
From: LZRS <12814349+LZRS@users.noreply.github.com>
Date: Mon, 4 Oct 2021 15:29:43 +0300
Subject: [PATCH 03/28] remove vaccine from list of administered, if
unchecked/invalid (#1910)
to avoid showing second/third doses, when in edit, and the first dose
has not been entered
---
.../chw/actionhelper/ImmunizationValidator.java | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/actionhelper/ImmunizationValidator.java b/opensrp-chw/src/main/java/org/smartregister/chw/actionhelper/ImmunizationValidator.java
index 798da170fc..63f3a056e8 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/actionhelper/ImmunizationValidator.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/actionhelper/ImmunizationValidator.java
@@ -43,7 +43,7 @@ public ImmunizationValidator(
) {
vaccineSchedules = VisitVaccineUtil.getSchedule(vaccinesGroups, specialVaccines, vaccineCategory);
for (org.smartregister.immunization.domain.Vaccine vaccine : vaccines) {
- administeredVaccines.put(vaccine.getName(), vaccine.getDate());
+ administeredVaccines.put(vaccine.getName().toLowerCase(), vaccine.getDate());
}
}
@@ -134,8 +134,14 @@ public void onChanged(String s) {
// add all the received vaccines in the map
if (prevFragment != null) {
for (VaccineDisplay display : prevFragment.getVaccineDisplays().values()) {
- if (display.getValid())
- receivedVacs.put(display.getVaccineWrapper().getName(), display.getDateGiven());
+ String displayName = display.getVaccineWrapper().getName().toLowerCase();
+ if (display.getValid()) {
+ receivedVacs.put(displayName, display.getDateGiven());
+ } else if (receivedVacs.containsKey(displayName)
+ && !display.getValid() // If not valid, remove from administered vaccines
+ ) {
+ receivedVacs.remove(displayName);
+ }
}
}
From 84941d10d71f3afdae6504da5b65e6025ddf3339 Mon Sep 17 00:00:00 2001
From: LZRS <12814349+LZRS@users.noreply.github.com>
Date: Fri, 10 Sep 2021 15:18:35 +0300
Subject: [PATCH 04/28] update date theme for each of generated date pickers
to have expected format of 'DD-MM-YYYY' instead of default
---
.../fragment/BaseHomeVisitImmunizationFragmentFlv.java | 6 ++++++
.../DefaultBaseHomeVisitImmunizationFragment.java | 9 +++++++++
2 files changed, 15 insertions(+)
diff --git a/opensrp-chw/src/lmh/java/org/smartregister/chw/fragment/BaseHomeVisitImmunizationFragmentFlv.java b/opensrp-chw/src/lmh/java/org/smartregister/chw/fragment/BaseHomeVisitImmunizationFragmentFlv.java
index f1a505d05d..a5c658729f 100644
--- a/opensrp-chw/src/lmh/java/org/smartregister/chw/fragment/BaseHomeVisitImmunizationFragmentFlv.java
+++ b/opensrp-chw/src/lmh/java/org/smartregister/chw/fragment/BaseHomeVisitImmunizationFragmentFlv.java
@@ -2,6 +2,7 @@
import android.os.Bundle;
import android.view.View;
+import android.widget.DatePicker;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -45,4 +46,9 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
DatePickerUtils.themeDatePicker(singleDatePicker, new char[]{'d', 'm', 'y'});
super.onViewCreated(view, savedInstanceState);
}
+
+ @Override
+ protected void setDatePickerTheme(DatePicker picker) {
+ DatePickerUtils.themeDatePicker(picker, new char[]{'d', 'm', 'y'});
+ }
}
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/fragment/DefaultBaseHomeVisitImmunizationFragment.java b/opensrp-chw/src/main/java/org/smartregister/chw/fragment/DefaultBaseHomeVisitImmunizationFragment.java
index 56f3983551..a8e2da9061 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/fragment/DefaultBaseHomeVisitImmunizationFragment.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/fragment/DefaultBaseHomeVisitImmunizationFragment.java
@@ -249,6 +249,14 @@ private void onVariedResponsesMode() {
redrawView();
}
+ /**
+ * Sets theme for generated DatePickers
+ * @param picker
+ */
+ protected void setDatePickerTheme(DatePicker picker){
+ // no-op but may be extended in child fragments to set date picker theme
+ }
+
private void generateDatePickerViews() {
int x = 0;
while (vaccineViews.size() > x) {
@@ -257,6 +265,7 @@ private void generateDatePickerViews() {
View layout = inflater.inflate(R.layout.custom_single_vaccine_view, null);
TextView question = layout.findViewById(R.id.vaccines_given_when_title_question);
DatePicker datePicker = layout.findViewById(R.id.earlier_date_picker);
+ setDatePickerTheme(datePicker);
String translatedVaccineName = NCUtils.getStringResourceByName(vaccineView.vaccineName.toLowerCase().replace(" ", "_"), getActivity());
question.setText(getString(R.string.when_vaccine, translatedVaccineName));
From 5342eaa4abba084a80addd6493e9551df5150e05 Mon Sep 17 00:00:00 2001
From: LZRS <12814349+LZRS@users.noreply.github.com>
Date: Tue, 21 Sep 2021 15:02:11 +0300
Subject: [PATCH 05/28] add tests for date fix
---
.../BaseHomeVisitImmunizationFragmentFlv.java | 10 ++++--
...eHomeVisitImmunizationFragmentFlvTest.java | 36 +++++++++++++++++++
2 files changed, 44 insertions(+), 2 deletions(-)
create mode 100644 opensrp-chw/src/testLmh/java/org/smartregister/chw/fragment/BaseHomeVisitImmunizationFragmentFlvTest.java
diff --git a/opensrp-chw/src/lmh/java/org/smartregister/chw/fragment/BaseHomeVisitImmunizationFragmentFlv.java b/opensrp-chw/src/lmh/java/org/smartregister/chw/fragment/BaseHomeVisitImmunizationFragmentFlv.java
index a5c658729f..16ae4d30cf 100644
--- a/opensrp-chw/src/lmh/java/org/smartregister/chw/fragment/BaseHomeVisitImmunizationFragmentFlv.java
+++ b/opensrp-chw/src/lmh/java/org/smartregister/chw/fragment/BaseHomeVisitImmunizationFragmentFlv.java
@@ -6,6 +6,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
import org.smartregister.chw.anc.contract.BaseAncHomeVisitContract;
import org.smartregister.chw.anc.domain.VaccineDisplay;
@@ -43,12 +44,17 @@ public static BaseHomeVisitImmunizationFragmentFlv getInstance(final BaseAncHome
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
- DatePickerUtils.themeDatePicker(singleDatePicker, new char[]{'d', 'm', 'y'});
+ callDatePickerUtilsThemeDatePicker(singleDatePicker, new char[]{'d', 'm', 'y'});
super.onViewCreated(view, savedInstanceState);
}
+ @VisibleForTesting
+ void callDatePickerUtilsThemeDatePicker(DatePicker datePicker, char[] ymdOrder){
+ DatePickerUtils.themeDatePicker(datePicker, ymdOrder);
+ }
+
@Override
protected void setDatePickerTheme(DatePicker picker) {
- DatePickerUtils.themeDatePicker(picker, new char[]{'d', 'm', 'y'});
+ callDatePickerUtilsThemeDatePicker(picker, new char[]{'d', 'm', 'y'});
}
}
diff --git a/opensrp-chw/src/testLmh/java/org/smartregister/chw/fragment/BaseHomeVisitImmunizationFragmentFlvTest.java b/opensrp-chw/src/testLmh/java/org/smartregister/chw/fragment/BaseHomeVisitImmunizationFragmentFlvTest.java
new file mode 100644
index 0000000000..79d5e27491
--- /dev/null
+++ b/opensrp-chw/src/testLmh/java/org/smartregister/chw/fragment/BaseHomeVisitImmunizationFragmentFlvTest.java
@@ -0,0 +1,36 @@
+package org.smartregister.chw.fragment;
+
+import android.widget.DatePicker;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.AdditionalMatchers;
+import org.mockito.Spy;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.MockitoAnnotations.initMocks;
+
+public class BaseHomeVisitImmunizationFragmentFlvTest {
+
+ @Spy
+ BaseHomeVisitImmunizationFragmentFlv fragmentFlv;
+
+ @Before
+ public void setUp(){
+ initMocks(this);
+ }
+
+ @Test
+ public void testSetDatePickerThemeSetsCorrectFormat() {
+ DatePicker datePicker = mock(DatePicker.class);
+ doNothing().when(fragmentFlv).callDatePickerUtilsThemeDatePicker(any(), any());
+ fragmentFlv.setDatePickerTheme(datePicker);
+ verify(fragmentFlv).callDatePickerUtilsThemeDatePicker(eq(datePicker), AdditionalMatchers.aryEq(new char[]{'d', 'm', 'y'}));
+ }
+
+
+}
From 9dd595c62512fb89ec2400b5fb139410eebff0ee Mon Sep 17 00:00:00 2001
From: LZRS <12814349+LZRS@users.noreply.github.com>
Date: Mon, 4 Oct 2021 15:34:24 +0300
Subject: [PATCH 06/28] remove onclicklistener on title_layout (#1885)
* remove onclicklistener on title_layout
to fix click on app bar, closing the app
* use flavor to remove onclick on title layout
...and some tests
---
.../chw/application/ChwApplicationFlv.java | 4 +++
.../chw/application/ChwApplication.java | 2 ++
.../application/DefaultChwApplicationFlv.java | 4 +++
.../chw/fragment/ChildRegisterFragment.java | 5 ++++
.../fragment/ChildRegisterFragmentTest.java | 27 ++++++++++++++++++-
5 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java b/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java
index 2390e5d8b0..abec469b2e 100644
--- a/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java
+++ b/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java
@@ -158,6 +158,10 @@ public boolean showIconsForChildrenUnderTwoAndGirlsAgeNineToEleven(){
}
@Override
+ public boolean disableChildRegistrationTitleGoBack() {
+ return true;
+ }
+
public boolean showReportsDescription() {
return true;
}
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java b/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java
index 406bcff066..c95eb10b45 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java
@@ -438,6 +438,8 @@ public interface Flavor {
boolean showIconsForChildrenUnderTwoAndGirlsAgeNineToEleven();
+ boolean disableChildRegistrationTitleGoBack();
+
boolean showReportsDescription();
boolean showReportsDivider();
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java b/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java
index 7521b3a90b..4106b272c2 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java
@@ -218,6 +218,10 @@ public boolean showIconsForChildrenUnderTwoAndGirlsAgeNineToEleven(){
}
@Override
+ public boolean disableChildRegistrationTitleGoBack() {
+ return false;
+ }
+
public boolean showReportsDescription() {
return false;
}
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/fragment/ChildRegisterFragment.java b/opensrp-chw/src/main/java/org/smartregister/chw/fragment/ChildRegisterFragment.java
index 75e8208061..6dc279a2ad 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/fragment/ChildRegisterFragment.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/fragment/ChildRegisterFragment.java
@@ -64,6 +64,11 @@ protected void initializePresenter() {
public void setupViews(android.view.View view) {
super.setupViews(view);
+ if (ChwApplication.getApplicationFlavor().disableChildRegistrationTitleGoBack()) {
+ android.view.View titleLayout = view.findViewById(R.id.title_layout);
+ titleLayout.setOnClickListener(null);
+ }
+
if (ChwApplication.getApplicationFlavor().hasDefaultDueFilterForChildClient()) {
android.view.View dueOnlyLayout = view.findViewById(org.smartregister.chw.core.R.id.due_only_layout);
dueOnlyLayout.setVisibility(android.view.View.VISIBLE);
diff --git a/opensrp-chw/src/test/java/org/smartregister/chw/fragment/ChildRegisterFragmentTest.java b/opensrp-chw/src/test/java/org/smartregister/chw/fragment/ChildRegisterFragmentTest.java
index 2815047873..bde1b95491 100644
--- a/opensrp-chw/src/test/java/org/smartregister/chw/fragment/ChildRegisterFragmentTest.java
+++ b/opensrp-chw/src/test/java/org/smartregister/chw/fragment/ChildRegisterFragmentTest.java
@@ -19,6 +19,8 @@
import org.smartregister.Context;
import org.smartregister.CoreLibrary;
import org.smartregister.chw.BaseUnitTest;
+import org.smartregister.chw.R;
+import org.smartregister.chw.application.ChwApplication;
import org.smartregister.chw.core.presenter.CoreChildRegisterFragmentPresenter;
import org.smartregister.commonregistry.CommonRepository;
import org.smartregister.domain.FetchStatus;
@@ -27,8 +29,13 @@
import java.util.ArrayList;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -93,12 +100,30 @@ public void testSetupViews() {
when(fragment.getActivity()).thenReturn(activity);
when(fragment.getContext()).thenReturn(activity);
View view = LayoutInflater.from(activity).inflate(org.smartregister.chw.core.R.layout.fragment_base_register, null);
+ View dueOnlyLayout = view.findViewById(org.smartregister.chw.core.R.id.due_only_layout);
+ doNothing().when(fragment).toggleFilterSelection(eq(dueOnlyLayout));
fragment.setupViews(view);
- View dueOnlyLayout = view.findViewById(org.smartregister.chw.core.R.id.due_only_layout);
dueOnlyLayout.setVisibility(View.VISIBLE);
assertEquals(View.VISIBLE, dueOnlyLayout.getVisibility());
}
+
+ @Test
+ public void testSetUpViewsWithDisableChildRegistrationTitleGoBack(){
+ when(fragment.getActivity()).thenReturn(activity);
+ when(fragment.getContext()).thenReturn(activity);
+ View view = LayoutInflater.from(activity).inflate(org.smartregister.chw.core.R.layout.fragment_base_register, null);
+ View dueOnlyLayout = view.findViewById(org.smartregister.chw.core.R.id.due_only_layout);
+ doNothing().when(fragment).toggleFilterSelection(eq(dueOnlyLayout));
+ fragment.setupViews(view);
+
+ View titleLayout = view.findViewById(R.id.title_layout);
+ if (ChwApplication.getApplicationFlavor().disableChildRegistrationTitleGoBack()){
+ assertFalse(titleLayout.hasOnClickListeners());
+ }else{
+ assertTrue(titleLayout.hasOnClickListeners());
+ }
+ }
}
From 575ffb77867f1edb3a3666f9960a387e19cfe4dc Mon Sep 17 00:00:00 2001
From: LZRS <12814349+LZRS@users.noreply.github.com>
Date: Mon, 4 Oct 2021 19:05:09 +0300
Subject: [PATCH 07/28] move bottom navigation to side menu
---
opensrp-chw/build.gradle | 2 +-
.../chw/application/ChwApplicationFlv.java | 5 +
.../chw/custom_view/NavigationMenuFlv.java | 27 ++
.../chw/model/NavigationModelFlv.java | 9 +-
.../lmh/res/layout-w900dp/navigation_view.xml | 397 ++++++++++++++++
.../src/lmh/res/layout/navigation_view.xml | 427 ++++++++++++++++++
opensrp-chw/src/lmh/res/values/strings.xml | 4 +
.../chw/activity/FamilyRegisterActivity.java | 5 +
.../chw/activity/ReportsActivity.java | 13 +-
.../chw/application/ChwApplication.java | 5 +
.../application/DefaultChwApplicationFlv.java | 5 +
.../chw/fragment/ReportsFragment.java | 4 +
.../src/main/res/layout/activity_reports.xml | 41 +-
.../src/main/res/layout/reports_fragment.xml | 15 +-
opensrp-chw/src/main/res/values/colors.xml | 2 +
opensrp-chw/src/main/res/values/styles.xml | 1 +
16 files changed, 937 insertions(+), 25 deletions(-)
create mode 100644 opensrp-chw/src/lmh/res/layout-w900dp/navigation_view.xml
create mode 100644 opensrp-chw/src/lmh/res/layout/navigation_view.xml
diff --git a/opensrp-chw/build.gradle b/opensrp-chw/build.gradle
index 8416ebf69f..34215b5e27 100644
--- a/opensrp-chw/build.gradle
+++ b/opensrp-chw/build.gradle
@@ -302,7 +302,7 @@ android {
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
- implementation('org.smartregister:opensrp-client-chw-core:1.5.25-LMH-Beta-01-SNAPSHOT@aar') {
+ implementation('org.smartregister:opensrp-client-chw-core:1.5.25-Beta-03-SNAPSHOT@aar') {
transitive = true
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'androidx.legacy', module: 'legacy-support-v4'
diff --git a/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java b/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java
index 071e41b4ce..c85117cfc6 100644
--- a/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java
+++ b/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java
@@ -156,4 +156,9 @@ public boolean showChildrenAboveTwoDueStatus(){
public boolean showIconsForChildrenUnderTwoAndGirlsAgeNineToEleven(){
return true;
}
+
+ @Override
+ public boolean showBottomNavigation() {
+ return false;
+ }
}
diff --git a/opensrp-chw/src/lmh/java/org/smartregister/chw/custom_view/NavigationMenuFlv.java b/opensrp-chw/src/lmh/java/org/smartregister/chw/custom_view/NavigationMenuFlv.java
index 443be8ac93..f11c514724 100644
--- a/opensrp-chw/src/lmh/java/org/smartregister/chw/custom_view/NavigationMenuFlv.java
+++ b/opensrp-chw/src/lmh/java/org/smartregister/chw/custom_view/NavigationMenuFlv.java
@@ -1,6 +1,14 @@
package org.smartregister.chw.custom_view;
+import android.app.Activity;
+import android.content.DialogInterface;
+import android.graphics.Color;
+import android.widget.Button;
+
+import androidx.appcompat.app.AlertDialog;
+
import org.apache.commons.lang3.tuple.Pair;
+import org.smartregister.chw.R;
import java.util.Arrays;
import java.util.List;
@@ -37,4 +45,23 @@ public String childNavigationMenuCountString() {
" and (SELECT is_closed FROM ec_family_member WHERE base_entity_id = ec_child.mother_entity_id ) = 1)) \n" +
" and (((julianday('now') - julianday(ec_child.dob))/365.25) < 2 or (ec_child.gender = 'Female' and (((julianday('now') - julianday(ec_child.dob))/365.25) BETWEEN 9 AND 11)))\n";
}
+
+ @Override
+ public AlertDialog doLogOutDialog(Activity activity) {
+ AlertDialog dialog = new AlertDialog.Builder(activity)
+ .setTitle("Log Out?")
+ .setMessage("You will be returned to the PIN entry screen.")
+ .create();
+ dialog.setOnShowListener(dialog1 -> {
+ Button positiveButton = ((AlertDialog) dialog1)
+ .getButton(AlertDialog.BUTTON_POSITIVE);
+ positiveButton.setTextColor(Color.RED);
+
+ Button negativeButton = ((AlertDialog) dialog1)
+ .getButton(AlertDialog.BUTTON_NEGATIVE);
+ negativeButton.setTextColor(Color.GRAY);
+ });
+
+ return dialog;
+ }
}
diff --git a/opensrp-chw/src/lmh/java/org/smartregister/chw/model/NavigationModelFlv.java b/opensrp-chw/src/lmh/java/org/smartregister/chw/model/NavigationModelFlv.java
index 13618faf6d..60562171d2 100644
--- a/opensrp-chw/src/lmh/java/org/smartregister/chw/model/NavigationModelFlv.java
+++ b/opensrp-chw/src/lmh/java/org/smartregister/chw/model/NavigationModelFlv.java
@@ -2,6 +2,7 @@
import org.smartregister.chw.R;
import org.smartregister.chw.core.model.NavigationOption;
+import org.smartregister.chw.core.utils.CoreConstants;
import org.smartregister.chw.util.Constants;
import java.util.ArrayList;
@@ -9,14 +10,16 @@
public class NavigationModelFlv extends DefaultNavigationModelFlv {
- private List navigationOptions = new ArrayList<>();
+ private final List navigationOptions = new ArrayList<>();
@Override
public List getNavigationItems() {
if (navigationOptions.size() == 0) {
- navigationOptions.add(new NavigationOption(R.mipmap.sidemenu_families, R.mipmap.sidemenu_families_active, R.string.menu_all_families, Constants.DrawerMenu.ALL_FAMILIES, 0));
- navigationOptions.add(new NavigationOption(R.mipmap.sidemenu_children, R.mipmap.sidemenu_children_active, R.string.menu_child_clients, Constants.DrawerMenu.CHILD_CLIENTS, 0));
+ navigationOptions.add(new NavigationOption(R.mipmap.sidemenu_families, R.mipmap.sidemenu_families, R.string.menu_all_families, Constants.DrawerMenu.ALL_FAMILIES, 0));
+ navigationOptions.add(new NavigationOption(R.drawable.ic_input_add, R.drawable.ic_input_add, R.string.menu_add_new_family, "Add New Family", -1));
+ navigationOptions.add(new NavigationOption(R.mipmap.sidemenu_children, R.mipmap.sidemenu_children, R.string.menu_child_clients, Constants.DrawerMenu.CHILD_CLIENTS, 0));
+ navigationOptions.add(new NavigationOption(R.mipmap.ic_jobaids, R.mipmap.ic_jobaids, R.string.reports, "Reports", -1));
}
return navigationOptions;
diff --git a/opensrp-chw/src/lmh/res/layout-w900dp/navigation_view.xml b/opensrp-chw/src/lmh/res/layout-w900dp/navigation_view.xml
new file mode 100644
index 0000000000..5249e0b3c8
--- /dev/null
+++ b/opensrp-chw/src/lmh/res/layout-w900dp/navigation_view.xml
@@ -0,0 +1,397 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/opensrp-chw/src/lmh/res/layout/navigation_view.xml b/opensrp-chw/src/lmh/res/layout/navigation_view.xml
new file mode 100644
index 0000000000..cfa6fc76ef
--- /dev/null
+++ b/opensrp-chw/src/lmh/res/layout/navigation_view.xml
@@ -0,0 +1,427 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/opensrp-chw/src/lmh/res/values/strings.xml b/opensrp-chw/src/lmh/res/values/strings.xml
index 00e11fd350..8db5da557b 100644
--- a/opensrp-chw/src/lmh/res/values/strings.xml
+++ b/opensrp-chw/src/lmh/res/values/strings.xml
@@ -25,4 +25,8 @@
%s adults and %s U11 children
Are you sure you want to go back? All data you have entered in this form will be cleared.
+
+ Transfer Data
+ All Children
+ Add New Family
\ No newline at end of file
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/activity/FamilyRegisterActivity.java b/opensrp-chw/src/main/java/org/smartregister/chw/activity/FamilyRegisterActivity.java
index effd2a622e..c8afb3f9cd 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/activity/FamilyRegisterActivity.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/activity/FamilyRegisterActivity.java
@@ -3,6 +3,7 @@
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
+import android.view.View;
import com.google.android.material.bottomnavigation.BottomNavigationView;
@@ -28,6 +29,10 @@ public static void registerBottomNavigation(
BottomNavigationHelper bottomNavigationHelper, BottomNavigationView bottomNavigationView, Activity activity
) {
Utils.setupBottomNavigation(bottomNavigationHelper, bottomNavigationView, new ChwBottomNavigationListener(activity));
+ if (!ChwApplication.getApplicationFlavor().showBottomNavigation()
+ && bottomNavigationView != null){
+ bottomNavigationView.setVisibility(View.GONE);
+ }
}
@Override
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/activity/ReportsActivity.java b/opensrp-chw/src/main/java/org/smartregister/chw/activity/ReportsActivity.java
index c37d784904..7b5c25531d 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/activity/ReportsActivity.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/activity/ReportsActivity.java
@@ -2,11 +2,13 @@
import android.os.Bundle;
+import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import org.smartregister.chw.R;
+import org.smartregister.chw.core.custom_views.NavigationMenu;
import org.smartregister.chw.core.job.ChwIndicatorGeneratingJob;
import org.smartregister.chw.fragment.ReportsFragment;
import org.smartregister.helper.BottomNavigationHelper;
@@ -28,13 +30,20 @@ protected void onCreate(Bundle savedInstanceState) {
switchToFragment(new ReportsFragment());
}
+ NavigationMenu.getInstance(this, null, null);
+
onCreation();
+
+ if (getSupportActionBar() != null){
+
+ }
+
ChwIndicatorGeneratingJob.scheduleJobImmediately(ChwIndicatorGeneratingJob.TAG);
}
private void switchToFragment(Fragment fragment) {
getSupportFragmentManager().beginTransaction()
- .add(R.id.content, fragment)
+ .add(R.id.main_content, fragment)
.commit();
}
@@ -44,7 +53,7 @@ protected void onCreation() {
bottomNavigationView = findViewById(R.id.bottom_navigation);
FamilyRegisterActivity.registerBottomNavigation(bottomNavigationHelper, bottomNavigationView, this);
if (bottomNavigationView != null)
- bottomNavigationView.getMenu().findItem(R.id.action_report).setChecked(true);
+ bottomNavigationView.getMenu().findItem(R.id.action_report).setChecked(true);
}
@Override
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java b/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java
index 3d3b62a00b..980c57199d 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java
@@ -33,6 +33,7 @@
import org.smartregister.chw.activity.MalariaRegisterActivity;
import org.smartregister.chw.activity.PncRegisterActivity;
import org.smartregister.chw.activity.ReferralRegisterActivity;
+import org.smartregister.chw.activity.ReportsActivity;
import org.smartregister.chw.activity.UpdatesRegisterActivity;
import org.smartregister.chw.anc.AncLibrary;
import org.smartregister.chw.anc.domain.Visit;
@@ -294,6 +295,8 @@ public Map getRegisteredActivities() {
}
registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.FP_REGISTER_ACTIVITY, FpRegisterActivity.class);
registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.UPDATES_REGISTER_ACTIVITY, UpdatesRegisterActivity.class);
+ registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.REPORTS_ACTIVITY, ReportsActivity.class);
+ registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.ADD_NEW_FAMILY, FamilyRegisterActivity.class);
return registeredActivities;
}
@@ -438,6 +441,8 @@ public interface Flavor {
boolean showIconsForChildrenUnderTwoAndGirlsAgeNineToEleven();
+ boolean showBottomNavigation();
+
}
}
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java b/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java
index 06e6dae369..869b433eee 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java
@@ -216,4 +216,9 @@ public boolean showLastNameOnChildProfile() {
public boolean showIconsForChildrenUnderTwoAndGirlsAgeNineToEleven(){
return false;
}
+
+ @Override
+ public boolean showBottomNavigation() {
+ return true;
+ }
}
diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/fragment/ReportsFragment.java b/opensrp-chw/src/main/java/org/smartregister/chw/fragment/ReportsFragment.java
index 2ce8808407..7c90f54d95 100644
--- a/opensrp-chw/src/main/java/org/smartregister/chw/fragment/ReportsFragment.java
+++ b/opensrp-chw/src/main/java/org/smartregister/chw/fragment/ReportsFragment.java
@@ -7,6 +7,7 @@
import android.widget.ProgressBar;
import androidx.annotation.NonNull;
+import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@@ -16,6 +17,7 @@
import org.smartregister.chw.adapter.ListableAdapter;
import org.smartregister.chw.adapter.ReportsFragmentAdapter;
import org.smartregister.chw.contract.ListContract;
+import org.smartregister.chw.core.custom_views.NavigationMenu;
import org.smartregister.chw.domain.ReportType;
import org.smartregister.chw.presenter.ListPresenter;
import org.smartregister.chw.viewholder.ListableViewHolder;
@@ -38,6 +40,8 @@ public class ReportsFragment extends Fragment implements ListContract.View
-
+ android:layout_height="match_parent"
+ android:fitsSystemWindows="true"
+ tools:openDrawer="start">
-
+ android:layout_height="match_parent">
-
+
+
+
+
+
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/opensrp-chw/src/main/res/layout/reports_fragment.xml b/opensrp-chw/src/main/res/layout/reports_fragment.xml
index f641ccdcea..e565485f37 100644
--- a/opensrp-chw/src/main/res/layout/reports_fragment.xml
+++ b/opensrp-chw/src/main/res/layout/reports_fragment.xml
@@ -2,14 +2,21 @@
+ xmlns:tools="http://schemas.android.com/tools"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
-
+ app:contentInsetLeft="0dp"
+ app:contentInsetStart="0dp"
+ app:contentInsetRight="0dp"
+ app:contentInsetEnd="0dp"
+ android:minHeight="?attr/actionBarSize"
+ app:popupTheme="@style/AppTheme.PopupOverlay"
+ android:theme="@style/AppTheme.AppBarOverlay">
-
+
#A64D79
#E69138
#803F04
+ @color/accent
+ @color/white
diff --git a/opensrp-chw/src/main/res/values/styles.xml b/opensrp-chw/src/main/res/values/styles.xml
index 269ef676a4..818a40783a 100644
--- a/opensrp-chw/src/main/res/values/styles.xml
+++ b/opensrp-chw/src/main/res/values/styles.xml
@@ -6,6 +6,7 @@
- @color/chw_primary
- @color/chw_primary_dark
- @color/chw_accent
+ - true