/// <summary> /// Play animation to show page /// </summary> internal void AnimateShowPage(RotaryItemWrapper wrapper, bool isReverse = true, PageAnimationType type = PageAnimationType.Slide) { RotarySelectorItem rotaryItem = wrapper.RotaryItem; rotaryItem.Show(); rotaryItem.Opacity = 0.0f; int wrapperIndex = wrapper.CurrentIndex; if (type == PageAnimationType.Slide) { int sTime = isReverse ? mAniUtil.GetStartTime(wrapperIndex) : 240 - mAniUtil.GetStartTime(wrapperIndex); Position pos = wrapper.GetRotaryPosition(wrapperIndex + 1); rotaryItem.Position = new Position(pos.X + (isReverse ? 70 : -70), pos.Y);; animationCore.AnimateTo(rotaryItem, "Position", pos, 167 + sTime, 84 + sTime + 334, alphaSineOut33); animationCore.AnimateTo(rotaryItem, "Opacity", 1.0f, 167 + sTime, 84 + sTime + 334, alphaSineOut33); } else { animationCore.AnimatePath(rotaryItem, mAniUtil.GetItemRotaryPath(wrapper, isReverse), Vector3.Zero, 200, 699, alphaGlideOut); animationCore.AnimateTo(rotaryItem, "Opacity", 1.0f, 200, 300, alphaGlideOut); } }
internal Path GetItemRotaryPath(RotaryItemWrapper wrapper, bool isReverse = true) { Path path = new Path(); float fIndex = wrapper.CurrentIndex + 1; if (isReverse) { for (int j = 0; j <= fIndex; j++) { path.AddPoint(wrapper.GetRotaryPosition(j)); } } else { for (int j = ApplicationConstants.MAX_TRAY_COUNT; j >= fIndex; j--) { path.AddPoint(wrapper.GetRotaryPosition(j)); } } path.GenerateControlPoints(0); return(path); }
internal Path GetRotaryPositionPathIndex(RotaryItemWrapper wrapper, bool cw = true) { Path path = new Path(); float fIndex = (float)(cw ? wrapper.CurrentIndex + 2 : wrapper.CurrentIndex); for (int j = 0; j <= 10; j++) { path.AddPoint(wrapper.GetRotaryPosition(fIndex)); fIndex += (cw ? -0.1f : 0.1f); } path.GenerateControlPoints(0); return(path); }
internal Path GetRotaryPositionPath(RotaryItemWrapper wrapper, int s, int e, bool isReverse = true) { Path path = new Path(); float fIndex = wrapper.CurrentIndex + 1; if (isReverse) { for (int j = s; j <= fIndex; j++) { path.AddPoint(wrapper.GetRotaryPosition(j)); } } else { for (int j = e; j >= fIndex; j--) { path.AddPoint(wrapper.GetRotaryPosition(j)); } } path.GenerateControlPoints(0); return(path); }
/// <summary> /// Play animation to hide page /// </summary> internal void AnimateHidePage(RotaryItemWrapper wrapper, bool isReverse = true, PageAnimationType type = PageAnimationType.Slide) { RotarySelectorItem rotaryItem = wrapper.RotaryItem; rotaryItem.Opacity = 1.0f; if (type == PageAnimationType.Slide) { Position pos = wrapper.GetRotaryPosition(wrapper.CurrentIndex + 1); Position movePos = new Position(pos.X + (isReverse ? -70 : 70), pos.Y); animationCore.AnimateTo(rotaryItem, "Position", movePos, 0, 250, alphaGlideOut); animationCore.AnimateTo(rotaryItem, "Opacity", 0.0f, 0, 250, alphaGlideOut); } else { //Rotary hide animation animationCore.AnimatePath(rotaryItem, mAniUtil.GetRotaryPositionHidePath(wrapper, isReverse), Vector3.Zero, 0, 200, alphaSineOut33); animationCore.AnimateTo(rotaryItem, "Opacity", 0.0f, 0, 150, alphaSineOut33); } }