I know that we can use touchlisteners to view scrolls, for example
parentScrollView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { Log.v(TAG, "PARENT TOUCH"); findViewById(R.id.child_scroll).getParent() .requestDisallowInterceptTouchEvent(false); return false; } }); childScrollView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { Log.v(TAG, "CHILD TOUCH");
What I came across is my child’s scroll profile, not the immediate child in the parent scroll. In this, v.getParent() does not work, and when I touch and try to scroll the scroll of my child scroll, the scroll of the entire main scroll.
The positions of my scroll views in my layout (views are dynamically created, so I need to go with so many layouts)
linearLayout ParentscrollView(0) linearLayout(0) relativeLayout(0) TextView(0) relativeLayout(1) childScrollView(0)
need help. Thanks in advance.!!
source share