 Rank: Newbie
Groups: Registered
Joined: 6/5/2012(UTC) Posts: 4
|
My problem: When I call xScale.zoomToRange() during animation scroll - animation doesn't stop and proceeds from previous zoom position. So, how can I abort this animation?
|
|
|
|
 Rank: Member
Groups: Registered
Joined: 7/28/2009(UTC) Posts: 447 
|
Hi, Unfortunately the is no API to do that. You may use workaround: Code:public class MyChartView extends ChartView
{
static final int SCROLL_FLAGS = ChartGestureListener.ANIMATED_PANNING_FLAG // animation
| ChartGestureListener.HORIZONTAL_PANNING_FLAG // horizontal scrolling
| ChartGestureListener.VERTICAL_PANNING_FLAG; // vertical scrolling
ChartGestureListener _gestureListener;
public MyChartView(Context context)
{
super(context);
_gestureListener = new ChartGestureListener(this, SCROLL_FLAGS); // enable scrolling
setGestureDetector(_gestureListener);
}
public void stopScrolling()
{
_gestureListener.setFlags(ChartGestureListener.NONE_FLAG); // disable scrolling
_gestureListener.onScroll(null, null, 0, 0); // imitate scrolling event to stop animation
_gestureListener.setFlags(SCROLL_FLAGS); // enable scrolling back
}
}
|
Volodymyr Baydalka Andriod development and support team |
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.