示例#1
0
 internal void ChangePaginationParent(CircularPagination pagination)
 {
     pagination.Unparent();
     if (editBGView == null)
     {
         this.Add(pagination);
         pagination.LowerToBottom();
     }
     else
     {
         editBGView.Add(pagination);
     }
 }
示例#2
0
        public View CreatePagination()
        {
            View view = new View()
            {
                Size = new Size(360, 360),
                PositionUsesPivotPoint = true,
                ParentOrigin           = ParentOrigin.Center,
                PivotPoint             = PivotPoint.Center,
            };

            pagination = new CircularPagination()
            {
                Size     = new Size(360, 360),
                Position = new Position(0, 100),

                // Set Pagination properties, such as Indicator size, count, and images.
                IndicatorSize     = new Size(10, 10),
                IndicatorImageURL = new Selector <string>()
                {
                    Normal   = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "normal_dot.png",
                    Selected = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "focus_dot.png",
                },
                //IndicatorSpacing = 8,
                IndicatorCount = PAGE_COUNT,
                SelectedIndex  = 0,

                // Positioning it to the top center
                ParentOrigin           = ParentOrigin.TopCenter,
                PivotPoint             = PivotPoint.TopCenter,
                PositionUsesPivotPoint = true
            };


            // To move on to the next page using Swipe gesture, add ScrollableBase and its View container.
            scrollable = new ScrollableBase()
            {
                Size               = new Size(120, 120),
                Position           = new Position(0, 10),
                ScrollingDirection = ScrollableBase.Direction.Horizontal,
                SnapToPage         = true,

                ParentOrigin           = ParentOrigin.Center,
                PivotPoint             = PivotPoint.Center,
                PositionUsesPivotPoint = true
            };

            View container = new View()
            {
                WidthSpecification  = LayoutParamPolicies.WrapContent,
                HeightSpecification = 120,
                Layout = new LinearLayout()
                {
                    LinearOrientation   = LinearLayout.Orientation.Horizontal,
                    SetPositionByLayout = false,
                },
                //BackgroundColor = Color.Black,
            };

            scrollable.Add(container);

            Tizen.Log.Error("MYLOG", "add scroll");
            for (int i = 0; i < PAGE_COUNT; i++)
            {
                View page = new View()
                {
                    Size            = new Size(120, 120),
                    CornerRadius    = 60.0f,
                    BackgroundColor = (i % 2 == 0)?Color.Yellow:Color.Red,
                };

                container.Add(page);
            }
            view.Add(scrollable);
            view.Add(pagination);

            // Screen Touch Event
            scrollable.ScrollAnimationEnded += Scrollable_ScrollAnimationEnded;
            return(view);
        }
示例#3
0
    protected override void OnCreate()
    {
        base.OnCreate();

        Window window = NUIApplication.GetDefaultWindow();

        window.BackgroundColor = Color.Black;

        // Create CircularPagination
        pagination = new CircularPagination()
        {
            Size = new Size(360, 360),

            // Set CircularPagination properties, such as Indicator size, count, and images.
            IndicatorSize  = new Size(10, 10),
            IndicatorCount = PAGE_COUNT,
            SelectedIndex  = 0,

            // Positioning it to the center
            ParentOrigin           = ParentOrigin.Center,
            PivotPoint             = PivotPoint.Center,
            PositionUsesPivotPoint = true
        };


        // To move on to the next page using Swipe gesture, add ScrollableBase and its View container.
        scrollable = new ScrollableBase()
        {
            Size = new Size(360, 360),

            ScrollingDirection = ScrollableBase.Direction.Horizontal,
            SnapToPage         = true,

            ParentOrigin           = ParentOrigin.Center,
            PivotPoint             = PivotPoint.Center,
            PositionUsesPivotPoint = true
        };

        View container = new View()
        {
            WidthSpecification  = LayoutParamPolicies.WrapContent,
            HeightSpecification = 360,
            Layout = new LinearLayout()
            {
                LinearOrientation = LinearLayout.Orientation.Horizontal,
            },
            BackgroundColor = Color.Black,
        };

        scrollable.Add(container);

        for (int i = 0; i < PAGE_COUNT; i++)
        {
            View page = new View()
            {
                Size            = new Size(360, 360),
                CornerRadius    = 150.0f,
                BackgroundColor = Color.Black,
            };

            container.Add(page);
        }

        window.Add(scrollable);
        window.Add(pagination);

        // Bezel event
        window.WheelEvent += Pagination_WheelEvent;

        // Screen Touch Event
        scrollable.ScrollAnimationEndEvent += Scroll_AnimationEnd;
    }
        public void Activate()
        {
            Window window = NUIApplication.GetDefaultWindow();

            ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
            /////////////////////////////////////// Symmetrical Circular Pagination ///////////////////////////////////////
            ///////////////////////////////////////////////////////////////////////////////////////////////////////////////

            circular                   = new CircularPagination();
            circular.Position2D        = new Position2D(50, 20);
            circular.Size2D            = new Size2D(360, 360);
            circular.BackgroundColor   = new Color(0.2f, 0.2f, 0.2f, 0.6f);
            circular.IndicatorSize     = new Size(26, 26);
            circular.IndicatorImageURL = new Selector <string>()
            {
                Normal   = CommonResource.GetFHResourcePath() + "9. Controller/pagination_ic_nor.png",
                Selected = CommonResource.GetFHResourcePath() + "9. Controller/pagination_ic_sel.png",
            };

            circular.IndicatorCount = 19;

            //circular.SelectedIndex = 0;

            window.Add(circular);

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            /////////////////////////////////////// Asymmetrical Circular Pagination ///////////////////////////////////////
            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

            homeCircular                 = new CircularPagination();
            homeCircular.Position2D      = new Position2D(50, 410);
            homeCircular.Size2D          = new Size2D(360, 360);
            homeCircular.BackgroundColor = new Color(0.7f, 0.7f, 0.7f, 0.6f);

            homeCircular.IndicatorSize     = new Size(26, 26);
            homeCircular.IndicatorImageURL = new Selector <string>()
            {
                Normal   = CommonResource.GetFHResourcePath() + "9. Controller/pagination_ic_nor.png",
                Selected = CommonResource.GetFHResourcePath() + "9. Controller/pagination_ic_sel.png",
            };

            // If you want to set the center indicator image differently from other indicators,
            // Use CenterIndicatorImageURL like below. (for example, home indicator clock picker)
            homeCircular.CenterIndicatorImageURL = new Selector <string>()
            {
                Normal   = CommonResource.GetFHResourcePath() + "9. Controller/controller_btn_slide_handler_press.png",
                Selected = CommonResource.GetFHResourcePath() + "9. Controller/controller_btn_radio_on.png",
            };

            homeCircular.IsSymmetrical       = false;
            homeCircular.RightIndicatorCount = 5;
            homeCircular.LeftIndicatorCount  = 2;

            //homeCircular.SetIndicatorPosition(0, new Position(111, 11));
            //homeCircular.SetIndicatorPosition(2, new Position(222, 73));

            //homeCircular.SelectedIndex = 0;

            window.Add(homeCircular);

            window.KeyEvent += Window_KeyEvent;
        }