Use easing within the carousel views scrolling

It is visible if you scroll more than one card
This commit is contained in:
Tobias Loose
2013-12-06 20:40:34 +01:00
parent 2002bb4e16
commit 0d350af1b6
2 changed files with 35 additions and 50 deletions

View File

@@ -2,6 +2,7 @@
#define _CAROUSEL_DECK_VIEW_H_
#include "DeckView.h"
#include "Easing.h"
class CarouselDeckView : public DeckView
{
@@ -9,8 +10,7 @@ private:
enum AnimationStage{
NONE = 0,
SLIDE_UP,
SLIDE_DOWN,
SCROLL_TO_SELECTED
SLIDE_DOWN
};
static const float scroll_speed;
@@ -39,7 +39,7 @@ public:
//maintains the current rotation for fluid animations
private:
float mRotation; //[-1,1]. defines the current rotation of the cards
InOutQuadEasing mScrollOffset; //[-1,1]. defines the current rotation of the cards
float mSlide; //[-1,1]. defines, the y-offset of the cards
int mScrollTarget; //0 <= mScrollTarget < mCards.size(). defines where to scroll to if the current animation is a scroll animation
AnimationStage mStage; // state machine state. for animation purposes