示例#1
0
        internal RotarySelectorManager(Size rotarySize)
        {
            this.rotarySize = rotarySize;

            rotaryTouchController = new RotaryTouchNormalMode();
            wrapperList           = new List <RotaryItemWrapper>();

            // First Page
            for (int i = 0; i < ApplicationConstants.MAX_ITEM_COUNT; i++)
            {
                RotaryItemWrapper rotaryItemWrapper = new RotaryItemWrapper(i);
                wrapperList.Add(rotaryItemWrapper);
            }

            // Second Page
            for (int i = 0; i < ApplicationConstants.MAX_ITEM_COUNT; i++)
            {
                RotaryItemWrapper rotaryItemWrapper = new RotaryItemWrapper(i);
                wrapperList.Add(rotaryItemWrapper);
            }

            rotaryLayerView = new RotaryLayerView()
            {
                WidthResizePolicy      = ResizePolicyType.FillToParent,
                HeightResizePolicy     = ResizePolicyType.FillToParent,
                ParentOrigin           = Tizen.NUI.ParentOrigin.Center,
                PivotPoint             = Tizen.NUI.PivotPoint.Center,
                PositionUsesPivotPoint = true,
            };

            animationManager = new AnimationManager();

            pagination = new RotaryPagination();
        }
示例#2
0
        internal void SetRotarySelectorMode(bool isEditMode)
        {
            if (isEditMode)
            {
                rotaryTouchController           = new RotaryTouchEditMode();
                rotaryTouchController.OnNotify += RotaryTouchController_OnNotify;
                int idx = 0;
                foreach (RotarySelectorItem item in rotaryLayerView.RotaryItemList)
                {
                    item.AddDeleteIcon(idx++);
                    item.Touch_DeleteBadgeHandler += Item_Touch_DeleteBadgeHandler;
                }
            }
            else
            {
                rotaryTouchController = new RotaryTouchNormalMode();
                IsPaging = false;
                foreach (RotarySelectorItem item in rotaryLayerView.RotaryItemList)
                {
                    item.RemoveDeleteIcon();
                }

                int page = currentPage * ApplicationConstants.MAX_ITEM_COUNT;
                RotarySelectorItem selectItem = rotaryLayerView.RotaryItemList[page + currentSelectIdx];

                rotaryLayerView.SetText(selectItem.MainText, selectItem.SubText);
                rotaryLayerView.SetRotaryPosition(currentSelectIdx);
            }

            rotaryLayerView.ChangeMode(isEditMode, currentPage, lastPage);
            animationManager.AnimateChangeState(rotaryLayerView, isEditMode);
            rotaryLayerView.RegisterPageMoveOnEdit(MovePageOnEditMode);

            this.isEditMode = isEditMode;
        }
示例#3
0
        private void PanDetector_Detected(object source, PanGestureDetector.DetectedEventArgs e)
        {
            RotaryTouchController controller = rotarySelectorManager.GetRotaryTouchController();

            if (mode == Mode.EditMode && controller.SelectedItem != null)
            {
                panScreenPosition = 0;
                rotarySelectorManager.IsPaging = false;
                return;
            }

            if (controller.IsProcessing || rotarySelectorManager.isAnimating() || !rotarySelectorManager.isDetector())
            {
                panScreenPosition = 0;
                rotarySelectorManager.IsPaging = false;
                rotarySelectorManager.SetPanDetector();
                return;
            }
            switch (e.PanGesture.State)
            {
            case Gesture.StateType.Finished:
            {
                int mouse_nextX = (int)e.PanGesture.ScreenPosition.X;
                int distance    = mouse_nextX - panScreenPosition;
                if (distance > DRAG_DISTANCE)
                {
                    rotarySelectorManager.NextPage();
                }
                else if (distance < -DRAG_DISTANCE)
                {
                    rotarySelectorManager.PrevPage();
                }

                panScreenPosition = 0;
                rotarySelectorManager.IsPaging = false;
                break;
            }

            case Gesture.StateType.Continuing:

                break;

            case Gesture.StateType.Started:
            {
                rotarySelectorManager.IsPaging = true;
                panScreenPosition = (int)e.PanGesture.ScreenPosition.X;
                break;
            }
            }
        }
 internal void SetRotarySelectorMode(bool isEditMode)
 {
     if (isEditMode)
     {
         rotaryTouchController           = new RotaryTouchEditMode();
         rotaryTouchController.OnNotify += RotaryTouchController_OnNotify;
     }
     else
     {
         rotaryTouchController = new RotaryTouchNormalMode();
     }
     rotaryLayerView.ChangeMode(isEditMode, currentPage, lastPage);
     animationManager.AnimateChangeState(rotaryLayerView, isEditMode);
     this.isEditMode = isEditMode;
     rotaryLayerView.RegisterTest(TestFunction);
 }