Skip to content

Commit 6eea6bd

Browse files
authored
Merge pull request #366 from codingblazer/clearoptions
Added clear button in Comprehension and Quiz Template
2 parents 9da7200 + f818888 commit 6eea6bd

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/QuestionFragment.java

+8
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@ public void onClick(View v) {
208208
}
209209
});
210210

211+
rootView.findViewById(R.id.clear).setOnClickListener(new View.OnClickListener() {
212+
213+
@Override
214+
public void onClick(View v) {
215+
rg.clearCheck();
216+
}
217+
});
218+
211219
if (Integer.parseInt(questionId) == 1) {
212220

213221
rootView.findViewById(R.id.previous).setVisibility(View.INVISIBLE);

source-code/app/src/main/java/org/buildmlearn/toolkit/quiztemplate/fragment/QuestionFragment.java

+8
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,14 @@ public void onClick(View v) {
207207
}
208208
});
209209

210+
rootView.findViewById(R.id.clear).setOnClickListener(new View.OnClickListener() {
211+
212+
@Override
213+
public void onClick(View v) {
214+
rg.clearCheck();
215+
}
216+
});
217+
210218
if (Integer.parseInt(questionId) == 1) {
211219

212220
rootView.findViewById(R.id.previous).setVisibility(View.INVISIBLE);

source-code/app/src/main/res/layout/comprehension_content_question.xml

+15
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,21 @@
137137
android:text="@string/comprehension_previous"
138138
android:textAppearance="?android:textAppearanceSmall"
139139
android:textColor="@color/black_secondary_text" />
140+
<Button
141+
android:id="@+id/clear"
142+
android:layout_width="wrap_content"
143+
android:layout_height="wrap_content"
144+
android:layout_alignParentBottom="true"
145+
android:layout_toLeftOf="@+id/previous"
146+
android:layout_toStartOf="@+id/previous"
147+
android:background="@android:color/transparent"
148+
android:paddingBottom="@dimen/headline_leading_simulator"
149+
android:paddingLeft="@dimen/activity_vertical_margin_simulator"
150+
android:paddingRight="@dimen/activity_vertical_margin_simulator"
151+
android:paddingTop="@dimen/activity_vertical_margin_simulator"
152+
android:text="@string/comprehension_clear_all"
153+
android:textAppearance="?android:textAppearanceSmall"
154+
android:textColor="@color/black_secondary_text" />
140155

141156
</RelativeLayout>
142157

source-code/app/src/main/res/values/strings.xml

+1
Original file line numberDiff line numberDiff line change
@@ -462,4 +462,5 @@
462462
<string name="pref_tell_key">tell</string>
463463
<string name="pref_tell_title">Tell a friend</string>
464464
<string name="pref_tell_message">BuildmLearn Toolkit for your phone. Download it from here :</string>
465+
<string name="comprehension_clear_all">CLEAR</string>
465466
</resources>

0 commit comments

Comments
 (0)