Exemplo n.º 1
0
        internal void AnimateStarting(RotaryLayerView layer, List <RotaryItemWrapper> wrapperList)
        {
            animationCore.Duration = 350;
            animationCore.Clear();

            RotaryIndicator indicator = layer.GetIndicator();
            TextLabel       mainText  = layer.GetMainText();

            //Init value -> Animate position from 131(radius) to default value
            indicator.Position = indicator.GetRotaryPosition(indicator.CurrentIndex + 1, 131);
            indicator.Opacity  = 0.0f;

            mainText.Opacity = 0.0f;
            mainText.Scale   = new Vector3(1.2f, 1.2f, 1.2f);
            mainText.Text    = wrapperList[0].RotaryItem.MainText;

            //Add animation
            animationCore.AnimateTo(indicator, "Position", indicator.GetRotaryPosition(indicator.CurrentIndex + 1), alphaSineInOut80);
            animationCore.AnimateTo(indicator, "Opacity", 1.0f, alphaSineInOut80);

            animationCore.AnimateTo(mainText, "Scale", new Vector3(1.0f, 1.0f, 1.0f), alphaSineInOut80);
            animationCore.AnimateTo(mainText, "Opacity", 1.0f, alphaSineInOut80);

            // Second Page -> hide
            for (int i = 0; i < wrapperList.Count; i++)
            {
                RotarySelectorItem item = wrapperList[i]?.RotaryItem;
                if (item != null)
                {
                    item.Opacity  = 0.0f;
                    item.Position = wrapperList[i].GetRotaryPosition(wrapperList[i].CurrentIndex + 1, true, 170);

                    animationCore.AnimateTo(item, "Position", wrapperList[i].GetRotaryPosition(wrapperList[i].CurrentIndex + 1, true, 139), alphaSineInOut80);
                    animationCore.AnimateTo(item, "Opacity", 1.0f, alphaSineInOut80);
                }
            }

            animationCore.Play();
        }
Exemplo n.º 2
0
        internal Path GetIndicatorRotaryPath(RotaryIndicator indiacotr)
        {
            int sidx = indiacotr.PrevIndex + 1;
            int eidx = indiacotr.CurrentIndex + 1;

            Path path = new Path();

            if (sidx < eidx)
            {
                for (int j = sidx; j <= eidx; j++)
                {
                    path.AddPoint(indiacotr.GetRotaryPosition(j));
                }
            }
            else
            {
                for (int j = sidx; j >= eidx; j--)
                {
                    path.AddPoint(indiacotr.GetRotaryPosition(j));
                }
            }
            path.GenerateControlPoints(0);
            return(path);
        }