//Need to fix -> Change function name internal void AnimateChangeState(RotaryLayerView layer, bool isEditMode, bool onlyIndicatorMoving = false) { animationCore.Clear(); animationCore.Duration = 350; if (isEditMode) { animationCore.AnimateTo(layer.GetContainer(), "Scale", new Vector3(0.9f, 0.9f, 1.0f), 0, 333, alphaGlideOut); animationCore.AnimateTo(layer.GetMainText(), "Opacity", 1.0f, 0, 333, alphaGlideOut); } else { if (!onlyIndicatorMoving) { animationCore.AnimateTo(layer.GetContainer(), "Scale", new Vector3(1.0f, 1.0f, 1.0f), 0, 333, alphaGlideOut); animationCore.AnimateTo(layer.GetMainText(), "Opacity", 1.0f, 0, 333, alphaGlideOut); } RotaryIndicator indicator = layer.GetIndicator(); if (!indicator.isNotMoving()) { animationCore.AnimatePath(indicator, mAniUtil.GetIndicatorRotaryPath(indicator), Vector3.Zero, 0, 200, alphaSineOut33); animationCore.AnimateTo(indicator, "Scale", new Vector3(1.1f, 1.1f, 1.1f), 0, 200, alphaSineOut33); animationCore.AnimateTo(indicator, "Scale", new Vector3(1.0f, 1.0f, 1.0f), 200, 350, alphaSineOut33); } } animationCore.Play(); }
/// <summary> /// Creates a new instance of a RotaryLayerView. /// Contains objects that are actually displayed on the screen. /// </summary> internal RotaryLayerView() { this.BackgroundColor = Color.Black; itemList = new List <RotarySelectorItem>(); container = new View() { Size = new Size(360, 360), ParentOrigin = Tizen.NUI.ParentOrigin.Center, PivotPoint = Tizen.NUI.PivotPoint.Center, PositionUsesPivotPoint = true, CornerRadius = ApplicationConstants.SCREEN_SIZE_RADIUS, }; this.Add(container); mainText = new TextLabel() { Size = new Size(210, 210), MultiLine = true, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, ParentOrigin = Tizen.NUI.ParentOrigin.Center, PivotPoint = Tizen.NUI.PivotPoint.Center, PositionUsesPivotPoint = true, TextColor = Color.White, PointSize = 8.0f, }; mainText.TouchEvent += MainText_TouchEvent; container.Add(mainText); //Temporary code, Need to fix. //Screen configuration should be changed according to user settings. subText = new TextLabel() { Text = "Sub", HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, ParentOrigin = Tizen.NUI.ParentOrigin.Center, PivotPoint = Tizen.NUI.PivotPoint.Center, PositionUsesPivotPoint = true, TextColor = Color.White, PointSize = 6.0f, Position = new Position(0, 50), }; //container.Add(subText); //default opacity of indicator is 0.0f. after showing animation, change opacity. rotaryIndicator = new RotaryIndicator(); rotaryIndicator.Opacity = 0.0f; container.Add(rotaryIndicator); }
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(); }
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); }