简体   繁体   English

CAndroid动画对图像左右拖动的弹性效果

[英]CAndroid animation elastic effect on image dragged left or right

I am new to android, 我是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 谢谢,Shashank

1 : 1

Its already been asked before here, it might help someone. 在此之前已经有人问过它,可能会对某人有所帮助。

Android: How to handle right to left swipe gestures Android:如何处理从右向左的滑动手势

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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