Skip to content

Instantly share code, notes, and snippets.

@jiangecho
Created April 28, 2016 09:18
Show Gist options
  • Save jiangecho/1a53448e36c98d7b85e2ceac892b9f0b to your computer and use it in GitHub Desktop.
Save jiangecho/1a53448e36c98d7b85e2ceac892b9f0b to your computer and use it in GitHub Desktop.
fix EditText in ScrollView scroll issue.
feedbackEditText.setOnTouchListener((v, event) -> {
if (v.getId() == R.id.feedbackEditText) {
ViewParent parent = v.getParent();
while (!(parent instanceof ScrollView)) {
parent = parent.getParent();
}
parent.requestDisallowInterceptTouchEvent(true);
switch (event.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_UP:
parent.requestDisallowInterceptTouchEvent(false);
break;
}
}
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment