Skip to content

Commit 47cd739

Browse files
committed
Spelling issue #101 resolved. its was due to an extra space which can be inserted (by user/autocorrect)at the beging or the end of the word when the word is to be save it causes the word to have the space and when checked with the answred (which may or may not contain space at exact location as in saved word) word it reurns false
1 parent 73699fc commit 47cd739

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

source-code/app/src/main/java/org/buildmlearn/toolkit/learnspelling/SpellingActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public void submit() {
190190
} else {
191191
mAlert.dismiss();
192192
boolean isCorrect = false;
193-
if (mEt_Spelling.getText().toString()
193+
if (mEt_Spelling.getText().toString().trim()
194194
.equalsIgnoreCase(mWordList.get(count).getWord())) {
195195
isCorrect = true;
196196
mManager.incrementCorrect();

source-code/app/src/main/java/org/buildmlearn/toolkit/templates/LearnSpellingTemplate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ public void addItem(final Activity activity) {
104104
public void onClick(View v) {
105105

106106
if (validated(activity, word, meaning)) {
107-
String wordText = word.getText().toString();
108-
String meaningText = meaning.getText().toString();
107+
String wordText = word.getText().toString().trim();
108+
String meaningText = meaning.getText().toString().trim();
109109

110110
LearnSpellingModel temp = new LearnSpellingModel(wordText, meaningText);
111111
mLearnSpellingData.add(temp);

0 commit comments

Comments
 (0)