Ok, I found a way how to implement this.
You just need to create your own HorizontalScrollView and override the onTouchEvent method
public class MyHSV extends HorizontalScrollView {
public MyHSV(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context);
}
public MyHSV(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public MyHSV(Context context) {
super(context);
init(context);
}
void init(Context context) {
setHorizontalFadingEdgeEnabled(false);
setVerticalFadingEdgeEnabled(false);
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
return false;
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
return false;
}
}
And then in the xml file
<pathToClass.MyHSV xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:scrollbars="none"
android:id="@+id/myHSV>
</pathToClass.MyHSV>
source
share