From 8661d852187a6c7584757187b2bd0db02d2186e4 Mon Sep 17 00:00:00 2001 From: CiufudeanDani Date: Mon, 11 Apr 2022 14:01:13 +0300 Subject: [PATCH 1/2] refresh list after on item Click --- .../main/java/com/safemobile/safedispatch/AlarmActivity.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/safeDispatch/src/main/java/com/safemobile/safedispatch/AlarmActivity.java b/safeDispatch/src/main/java/com/safemobile/safedispatch/AlarmActivity.java index d2db467..52091a1 100644 --- a/safeDispatch/src/main/java/com/safemobile/safedispatch/AlarmActivity.java +++ b/safeDispatch/src/main/java/com/safemobile/safedispatch/AlarmActivity.java @@ -128,9 +128,10 @@ public class AlarmActivity extends Activity { setConvertViewAlarm(arg1); // save position ackPosition = position; - if (!AppParams.DEMO) + if (!AppParams.DEMO) { + getParentTab().getAlarms(AppParams.USERID); setACK(getAllAlarms().get(position).idx, getAllAlarms().get(position).type, getAllAlarms().get(position).unitName); - else { + } else { getAllAlarms().get(position).ack = 1; updateResultsInUi("else"); } -- 2.37.1 From 27ef47ec1e6c05bec8a7ed4e778398b9abf8095d Mon Sep 17 00:00:00 2001 From: CiufudeanDani Date: Tue, 12 Apr 2022 14:29:15 +0300 Subject: [PATCH 2/2] hide ack alarms --- .../java/com/safemobile/adapters/AlertGridViewAdapter.java | 4 ++++ .../main/java/com/safemobile/safedispatch/AlarmActivity.java | 2 ++ 2 files changed, 6 insertions(+) diff --git a/libSafeMobile/src/main/java/com/safemobile/adapters/AlertGridViewAdapter.java b/libSafeMobile/src/main/java/com/safemobile/adapters/AlertGridViewAdapter.java index abaf299..d06236c 100644 --- a/libSafeMobile/src/main/java/com/safemobile/adapters/AlertGridViewAdapter.java +++ b/libSafeMobile/src/main/java/com/safemobile/adapters/AlertGridViewAdapter.java @@ -97,6 +97,10 @@ public class AlertGridViewAdapter extends BaseAdapter switch(acknowledged.get(position) ? 1 : 0) { case 1: + ViewGroup.LayoutParams params = convertView.getLayoutParams(); + if (params != null) { + params.height = 0; + } view.imageViewAlert.setImageResource(R.drawable.alert_off); //view.layoutAlarm.setBackgroundColor(0xffffffff); break; diff --git a/safeDispatch/src/main/java/com/safemobile/safedispatch/AlarmActivity.java b/safeDispatch/src/main/java/com/safemobile/safedispatch/AlarmActivity.java index 52091a1..4585b00 100644 --- a/safeDispatch/src/main/java/com/safemobile/safedispatch/AlarmActivity.java +++ b/safeDispatch/src/main/java/com/safemobile/safedispatch/AlarmActivity.java @@ -131,6 +131,8 @@ public class AlarmActivity extends Activity { if (!AppParams.DEMO) { getParentTab().getAlarms(AppParams.USERID); setACK(getAllAlarms().get(position).idx, getAllAlarms().get(position).type, getAllAlarms().get(position).unitName); + acknowledged.set(position, true); + updateResultsInUi(ALARM); } else { getAllAlarms().get(position).ack = 1; updateResultsInUi("else"); -- 2.37.1