Is there a way to listen on an EditText for the scenario where the text inserted is being wraped? (standard new line listener won't work since there is actually no real "/n" string on the edittext).
Maybe a listener on the height of the edit text changing?
Try this. Depending on the number of lines you know if there is text wrapping or not.
edittext.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {}
public void beforeTextChanged(CharSequence s, int s, int c, int a) {}
public void onTextChanged(CharSequence s, int s, int b, int c) {
Log.d("TESTING", " LINES = " + edittext.getLineCount());
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With