Research is telling me that there is no scroll listener for that case.
You could try your approch.
Another thing I would try is to override onScrollChanged (which provides the scroll position before) and so creating your own ScrollView
Update:
This one workes for me. It scrolls to the right but not to the left.
public class CustomScrollView extends HorizontalScrollView {
public CustomScrollView(Context context) {
super(context);
}
public CustomScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomScrollView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public void onScrollChanged(int w, int h, int ow, int oh) {
if (w < ow) {
scrollTo(ow, h);
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…