Created
April 28, 2016 09:18
-
-
Save jiangecho/1a53448e36c98d7b85e2ceac892b9f0b to your computer and use it in GitHub Desktop.
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