Skip to content

Instantly share code, notes, and snippets.

@dotkebi
Created May 20, 2016 05:04
Show Gist options
  • Save dotkebi/6cddcbb43da9f68a33221260bb9fac51 to your computer and use it in GitHub Desktop.
Save dotkebi/6cddcbb43da9f68a33221260bb9fac51 to your computer and use it in GitHub Desktop.
Android Simple TextWatcher
/**
* @author by [email protected] on 2016-05-20.
*/
public class SimpleTextWatcher implements TextWatcher {
public interface AfterTextChanged {
void afterTextChanged(Editable s);
}
private AfterTextChanged afterTextChanged;
public SimpleTextWatcher(AfterTextChanged afterTextChanged) {
this.afterTextChanged = afterTextChanged;
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {}
@Override
public void afterTextChanged(Editable s) {
afterTextChanged.afterTextChanged(s);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment