Survey buttons are automatically disabled on click.

This commit is contained in:
Pierre HUBERT 2018-09-06 19:04:52 +02:00
parent 79f2fa3c2d
commit dc324359c2
2 changed files with 6 additions and 0 deletions

View File

@ -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;
}

View File

@ -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)