From dc324359c29a6c01e83c5fe52db4e0e31a251f07 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 6 Sep 2018 19:04:52 +0200 Subject: [PATCH] Survey buttons are automatically disabled on click. --- .../client/ui/fragments/AbstractPostsListFragment.java | 1 + .../android/comunic/client/ui/views/SurveyView.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/AbstractPostsListFragment.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/AbstractPostsListFragment.java index 302d13b..2dfad5c 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/AbstractPostsListFragment.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/AbstractPostsListFragment.java @@ -947,6 +947,7 @@ public abstract class AbstractPostsListFragment extends AbstractFragment //Check for failure if(!success){ Toast.makeText(getActivity(), R.string.err_cancel_response, Toast.LENGTH_SHORT).show(); + mPostsAdapter.notifyDataSetChanged(); return; } diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/views/SurveyView.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/views/SurveyView.java index c898f17..5d274d1 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/views/SurveyView.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/views/SurveyView.java @@ -103,6 +103,9 @@ public class SurveyView extends BaseFrameLayoutView implements View.OnClickListe } + mCancelButton.setEnabled(true); + mResponseButton.setEnabled(true); + mCancelSurveyResponseForm.setVisibility(survey.hasUserResponded() ? View.VISIBLE : View.GONE); mSendResponseForm.setVisibility(survey.hasUserResponded() ? @@ -139,6 +142,8 @@ public class SurveyView extends BaseFrameLayoutView implements View.OnClickListe @Override public void onClick(View v) { + v.setEnabled(false); + //Cancel response to survey if(v.equals(mCancelButton)){ if(mOnSurveyUpdateListener != null)