Example #1
0
        public override void OrderByIndexAnimate(CircularRecycler gallery, bool cw = true)
        {
            List <CircularRecycler.ViewHolder> viewHolderList = gallery.GetChild();
            //currentPage == extraIdx

            int toIndex   = gallery.GetCurrentPage();
            int fromIndex = (!cw) ? toIndex + 1 : toIndex - 1;

            int count = viewHolderList.Count;

            float val  = (!cw) ? 1.0f : -1.0f;
            float span = (Math.Abs(storedPositionX + toIndex - fromIndex) / 10.0f) * val;

            ClearAnimation();
            for (int i = 0; i < count; i++)
            {
                View  view     = viewHolderList[i].GetView();
                Path  path     = new Path();
                float startIdx = storedPositionX + i - fromIndex;
                for (int j = 0; j <= 10; j++)
                {
                    Position position = GetRotaryPosition(startIdx);
                    path.AddPoint(position);
                    startIdx += span;
                }
                //SetAngle(view, i - toIndex);
                path.GenerateControlPoints(0);
                AnimatePath(view, path);
                Radian radi = new Radian(new Degree(30 * (i - toIndex)));
                AnimateRotate(view, GetRotation(i - toIndex));
            }
            PlayAnimation();
            storedPositionX = 0;
        }
Example #2
0
        public override void CancelPage(CircularRecycler gallery)
        {
            storedPositionX = 0;
            List <CircularRecycler.ViewHolder> viewHolderList = gallery.GetChild();
            //currentPage == extraIdx

            int toIndex = gallery.GetCurrentPage();

            int count = viewHolderList.Count;

            ClearAnimation();
            for (int i = 0; i < count; i++)
            {
                View  view     = viewHolderList[i].GetView();
                Path  path     = new Path();
                float startIdx = i - toIndex;

                Position position = GetRotaryPosition(startIdx);
                for (int j = 0; j <= 10; j++)
                {
                    path.AddPoint(position);
                }
                path.GenerateControlPoints(0);
                Animate(view, position);
                AnimateRotate(view, GetRotation(startIdx));
            }
            PlayAnimation();
        }
Example #3
0
        public override void DragPage(CircularRecycler gallery, int distance)
        {
            List <CircularRecycler.ViewHolder> viewHolderList = gallery.GetChild();
            int count   = viewHolderList.Count;
            int toIndex = gallery.GetCurrentPage();

            storedPositionX += ((float)distance / RESPONSIVIENESS);
            for (int i = 0; i < count; i++)
            {
                View view = viewHolderList[i].GetView();
                view.Position    = GetRotaryPosition(i - toIndex + storedPositionX);
                view.Orientation = GetRotation(i - toIndex + storedPositionX);
            }
        }
Example #4
0
        public override void OrderByIndex(CircularRecycler gallery)
        {
            List <CircularRecycler.ViewHolder> viewHolderList = gallery.GetChild();
            //currentPage == extraIdx

            int currentIndex = gallery.GetCurrentPage();
            int count        = viewHolderList.Count;

            for (int i = 0; i < count; i++)
            {
                View view = viewHolderList[i].GetView();
                view.Position    = GetRotaryPosition(i - currentIndex);
                view.Orientation = GetRotation(i - currentIndex);
            }
        }