So, I have this button ( ImageViewwith the method onClick) on the right side of the screen, which, when I pull it to the left, continues to SeekBarwhere you can select the time of day. To create this, I did it ScrollViewwith the horizontal one LinearLayout, and on the right - "button" + SeekBaron the left (mostly off-screen). "button" has a listener OnTouchand onClick.
OnTouch scrollview reports smoothScrollTo in the right place depending on where the finger is moving. When you move less than a certain threshold and release onClick, it is called.
In onClick, I said scrollview smoothScrollTo/ scrollTo/ fullScroll. FullScroll never worked. SmoothScrollTo works most of the time on one device (HTC Desire with Android 2.2.2), but never worked on ONCLICK (?) On another device (Samsung Galaxy Tab (old) with Android 2.2). Sometimes scrollTo works on both devices ... I'm sure onClickit gets called when I register it, when it starts, and also immediately after the scroll message ScrollView.
I tried sending scrollTo to ScrollViewin runnable and with a delay:
scrollView.postDelayed(new Runnable() {
@Override
public void run() {
scrollView.scrollTo(left, 0);
Log.d("SomeTag", "The scroller should scroll to: "+left);
}
}, 200);
But it worked as often (sometimes) as not to publish it ...
. Android , -, , "" , "" ... !