fix EditText in ScrollView scroll issue.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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