From 145b7b985a15f42e56fe8961574b26ce53e7a27a Mon Sep 17 00:00:00 2001 From: Alfred Date: Tue, 16 May 2017 07:50:01 +0000 Subject: [PATCH 1/4] add the ability to be able to add footer --- .../questionnaireview/MainActivity.java | 13 ++++++ app/src/main/res/layout/footer.xml | 18 ++++++++ .../QuestionnaireView.java | 44 +++++++++++++++++++ .../src/main/res/layout/check_list_item.xml | 1 - 4 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/layout/footer.xml diff --git a/app/src/main/java/com/alfredayibonte/questionnaireview/MainActivity.java b/app/src/main/java/com/alfredayibonte/questionnaireview/MainActivity.java index b41a5b9..d8520b2 100644 --- a/app/src/main/java/com/alfredayibonte/questionnaireview/MainActivity.java +++ b/app/src/main/java/com/alfredayibonte/questionnaireview/MainActivity.java @@ -5,6 +5,9 @@ import android.text.Editable; import android.text.TextWatcher; import android.util.Log; +import android.view.View; +import android.widget.Button; + import com.alfredayibonte.questionnaireviewlib.QuestionnaireView; import com.alfredayibonte.questionnaireviewlib.utils.AnswerType; @@ -18,6 +21,16 @@ protected void onCreate(Bundle savedInstanceState) { questionnaireView.setQuestion("

What is the name of this library ?

"); questionnaireView.setViewType(AnswerType.EDITTEXT); questionnaireView.addTextChangedListener(this); + View view = View.inflate(this, R.layout.footer, null); + Button btn = (Button) view.findViewById(R.id.next); + btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Log.e("NEXT::", "Next button clicked"); + } + }); + questionnaireView.addFooter(view); + } @Override diff --git a/app/src/main/res/layout/footer.xml b/app/src/main/res/layout/footer.xml new file mode 100644 index 0000000..c3929d7 --- /dev/null +++ b/app/src/main/res/layout/footer.xml @@ -0,0 +1,18 @@ + + +