I want to trigger click event in ScrollView.
I take this Clicking a scroll view as reference, but it did not work... I also tried to set all children of ScrollView to be unclickable, but it still not work.
That is part of my Layout.
<ScrollView
android:id="@+id/draw"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="120dp"
android:fillViewport="true"
android:scrollbars="none"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout
android:id="@+id/frame"
android:layout_width="match_parent"
android:layout_height="match_parent">
That is part of my code to set listener.
scroller = ((Activity)c).findViewById(R.id.draw);
scroller_child = ((Activity)c).findViewById(R.id.frame);
scroller_child.setOnClickListener(new FrameLayout.OnClickListener() {
@Override
public void onClick(View v) {
Log.d("TAG", "onclicked trigger");
}
});
scroller.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() {
@Override
public void onScrollChanged() {
Log.d("TAG", "scroll");
}
});