diff --git a/opensrp-chw/build.gradle b/opensrp-chw/build.gradle index 8416ebf69f..d3efce73bd 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-LMH-Beta-07-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..f8a0b6ca6c 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 @@ -93,7 +93,7 @@ public boolean showChildrenUnder5() { @Override public boolean launchChildClientsAtLogin() { - return true; + return false; } @Override @@ -156,4 +156,58 @@ public boolean showChildrenAboveTwoDueStatus(){ public boolean showIconsForChildrenUnderTwoAndGirlsAgeNineToEleven(){ return true; } + + @Override + public boolean showBottomNavigation() { + return false; + } + + @Override + public boolean disableTitleClickGoBack() { + return true; + } + + public boolean showReportsDescription() { + return true; + } + + @Override + public boolean showReportsDivider() { + return true; + } + + @Override + public boolean hideChildRegisterPreviousNextIcons() { + return true; + } + + @Override + public boolean hideFamilyRegisterPreviousNextIcons() { + return true; + } + + @Override + public boolean showFamilyRegisterNextInToolbar() { + return true; + } + + @Override + public boolean onFamilySaveGoToProfile() { + return true; + } + + @Override + public boolean onChildProfileHomeGoToChildRegister() { + return false; + } + + @Override + public boolean greyOutFormActionsIfInvalid() { + return true; + } + + @Override + public boolean checkExtraForDueInFamily() { + return true; + } } 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/fragment/BaseHomeVisitImmunizationFragmentFlv.java b/opensrp-chw/src/lmh/java/org/smartregister/chw/fragment/BaseHomeVisitImmunizationFragmentFlv.java index f1a505d05d..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 @@ -2,9 +2,11 @@ import android.os.Bundle; import android.view.View; +import android.widget.DatePicker; 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; @@ -42,7 +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) { + callDatePickerUtilsThemeDatePicker(picker, new char[]{'d', 'm', 'y'}); + } } 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..ef4a835788 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_add_new_family_white, R.drawable.ic_add_new_family_white, R.string.menu_add_new_family, Constants.DrawerMenu.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.drawable.ic_reports, R.drawable.ic_reports, R.string.reports_dashboard, Constants.DrawerMenu.REPORTS, -1)); } return navigationOptions; diff --git a/opensrp-chw/src/lmh/res/drawable/ic_add_new_family_white.xml b/opensrp-chw/src/lmh/res/drawable/ic_add_new_family_white.xml new file mode 100644 index 0000000000..962847b009 --- /dev/null +++ b/opensrp-chw/src/lmh/res/drawable/ic_add_new_family_white.xml @@ -0,0 +1,9 @@ + + + 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/drawable/ic_reports.xml b/opensrp-chw/src/lmh/res/drawable/ic_reports.xml new file mode 100644 index 0000000000..762af7233b --- /dev/null +++ b/opensrp-chw/src/lmh/res/drawable/ic_reports.xml @@ -0,0 +1,14 @@ + + + + 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-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/fragment_base_anc_home_visit.xml b/opensrp-chw/src/lmh/res/layout/fragment_base_anc_home_visit.xml new file mode 100644 index 0000000000..99b7796148 --- /dev/null +++ b/opensrp-chw/src/lmh/res/layout/fragment_base_anc_home_visit.xml @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + +