Browse Source

record detail view: don't cancel scrolling when inner scroll view can't scrol

Fabio Arnold 7 years ago
parent
commit
d19d5d3334

+ 7 - 5
src/de/tudarmstadt/informatik/hostage/ui/fragment/RecordDetailFragment.java

@@ -178,11 +178,13 @@ public class RecordDetailFragment extends UpNavigatibleFragment {
 				@Override
 				public boolean onTouch(final View v, final MotionEvent motionEvent) {
 					if (v.getId() == R.id.record_conversation_content) {
-						v.getParent().requestDisallowInterceptTouchEvent(true);
-						switch (motionEvent.getAction() & MotionEvent.ACTION_MASK) {
-						case MotionEvent.ACTION_UP:
-							v.getParent().requestDisallowInterceptTouchEvent(false);
-							break;
+						if (v.canScrollVertically(1) || v.canScrollVertically(-1)) { // if the view is scrollable
+							v.getParent().requestDisallowInterceptTouchEvent(true);
+							switch (motionEvent.getAction() & MotionEvent.ACTION_MASK) {
+								case MotionEvent.ACTION_UP:
+									v.getParent().requestDisallowInterceptTouchEvent(false);
+									break;
+							}
 						}
 					}
 					return false;