简体   繁体   中英

CAndroid animation elastic effect on image dragged left or right

I am new to android,

I have six images in a fragment which is in a scrollview, one over the other,like a stack.

Objective :

  1. User should be able to add remove item in the basket.
  2. User drags item to the right of the screen item is added to the basket, and images comes back to its position.
  3. User drags item to the left of the screen item is removed of the bucket, and images comes back to its position.

I will be able to handle, putting item into the basket etc, only thing which I am curious is drag elastic effect , and I am sure there must be some way to achieve it.

I will really appreciate if someone point/show me a way to achieve it.

This is what I am trying to achieve. Pulling/dragging image right, adds item to basket 在此处输入图片说明

By pulling/dragging image left removes item from the basket. 在此处输入图片说明

Thanks, Shashank

1 :

Its already been asked before here, it might help someone.

Android: How to handle right to left swipe gestures

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM