Skip to content

Commit

Permalink
Removed unused textChangedListener
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Jun 29, 2018
1 parent 6b25cef commit 7b2c90a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ public DecimalWidget(Context context, FormEntryPrompt prompt, boolean readOnlyOv
setFocusable(false);
setClickable(false);
}

setupChangeListener();
}

private Double getDoubleAnswerValue() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ public IntegerWidget(Context context, FormEntryPrompt prompt, boolean readOnlyOv
answerText.setText(String.format(Locale.US, "%d", i));
Selection.setSelection(answerText.getText(), answerText.getText().toString().length());
}

setupChangeListener();
}

private Integer getIntegerAnswerValue() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,8 @@ protected char[] getAcceptedChars() {
answerTextField.setText(s);
Selection.setSelection(answerTextField.getText(), answerTextField.getText().toString().length());
}

setupChangeListener();
}


@Override
public IAnswerData getAnswer() {
clearFocus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public class StringWidget extends QuestionWidget {

public StringWidget(Context context, FormEntryPrompt prompt, boolean readOnlyOverride) {
this(context, prompt, readOnlyOverride, true);
setupChangeListener();
}

protected StringWidget(Context context, FormEntryPrompt prompt, boolean readOnlyOverride,
Expand Down Expand Up @@ -115,32 +114,6 @@ protected StringWidget(Context context, FormEntryPrompt prompt, boolean readOnly
addAnswerView(answerText);
}

protected void setupChangeListener() {
answerText.addTextChangedListener(new TextWatcher() {
private String oldText = "";

@Override
public void afterTextChanged(Editable s) {
if (!s.toString().equals(oldText)) {
Collect.getInstance().getActivityLogger()
.logInstanceAction(this, "answerTextChanged", s.toString(),
getFormEntryPrompt().getIndex());
}
}

@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
oldText = s.toString();
}

@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {
}
});
}

@Override
public void clearAnswer() {
answerText.setText(null);
Expand Down

0 comments on commit 7b2c90a

Please sign in to comment.