From 5adb7af5336425797df8ac659096cef62e84983c Mon Sep 17 00:00:00 2001 From: mahmud6390 Date: Mon, 14 Dec 2020 16:05:48 +0600 Subject: [PATCH] crash issue --- .../hnpp/fragment/FamilyHistoryFragment.java | 4 + .../repository/HnppVisitLogRepository.java | 2 +- .../src/main/res/layout/activity_forum.xml | 352 +++++++++--------- 3 files changed, 186 insertions(+), 172 deletions(-) diff --git a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/fragment/FamilyHistoryFragment.java b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/fragment/FamilyHistoryFragment.java index 52f7e6995..474a0de87 100644 --- a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/fragment/FamilyHistoryFragment.java +++ b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/fragment/FamilyHistoryFragment.java @@ -113,6 +113,10 @@ public MemberHistoryContract.Presenter getPresenter() { private MemberHistoryAdapter.OnClickAdapter onClickAdapter = new MemberHistoryAdapter.OnClickAdapter() { @Override public void onClick(int position, MemberHistoryData content) { + if(content.getEventType().equalsIgnoreCase("Vaccination") + || content.getEventType().equalsIgnoreCase("Recurring Service")){ + return; + } startFormActivity(content); } }; diff --git a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/repository/HnppVisitLogRepository.java b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/repository/HnppVisitLogRepository.java index bea123a5e..6dda53ee3 100644 --- a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/repository/HnppVisitLogRepository.java +++ b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/repository/HnppVisitLogRepository.java @@ -361,7 +361,7 @@ public ArrayList getAllVisitLog(String baseEntityId) { } public ArrayList getAllVisitLogForFamily(String familyId) { SQLiteDatabase database = getReadableDatabase(); - String selection = FAMILY_ID + " = ? " + COLLATE_NOCASE; + String selection = FAMILY_ID + " = ? " + COLLATE_NOCASE+" and ("+VISIT_TYPE+"!='"+HnppConstants.EVENT_TYPE.FORUM_ADULT+"' and "+VISIT_TYPE+"!='"+HnppConstants.EVENT_TYPE.FORUM_WOMEN+"' and "+VISIT_TYPE+"!='"+HnppConstants.EVENT_TYPE.FORUM_NCD+"' and "+VISIT_TYPE+"!='"+HnppConstants.EVENT_TYPE.FORUM_ADO+"' and "+VISIT_TYPE+"!='"+HnppConstants.EVENT_TYPE.FORUM_CHILD+"')"; String[] selectionArgs = new String[]{familyId}; try{ net.sqlcipher.Cursor cursor = database.query(VISIT_LOG_TABLE_NAME, TABLE_COLUMNS, selection, selectionArgs, null, null, VISIT_DATE + " DESC"); diff --git a/opensrp-brac-hnpp/src/main/res/layout/activity_forum.xml b/opensrp-brac-hnpp/src/main/res/layout/activity_forum.xml index abd636d9e..b051ae9b7 100644 --- a/opensrp-brac-hnpp/src/main/res/layout/activity_forum.xml +++ b/opensrp-brac-hnpp/src/main/res/layout/activity_forum.xml @@ -46,191 +46,201 @@ android:layout_height="wrap_content"/> - + android:layout_height="match_parent"> - - - + android:layout_height="match_parent"> + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + + + + + -