private void CreateScrollableBase()
        {
            mScrollableBase = new Components.ScrollableBase()
            {
                Position           = new Position(300, 100),
                Size               = new Size(400, 300),
                ScrollingDirection = Components.ScrollableBase.Direction.Vertical,
            };
            mScrollableBase.ScrollOutOfBound += OnScrollOutOfBound;

            items = new TextLabel[5];
            for (int i = 0; i < 5; i++)
            {
                items[i] = new TextLabel
                {
                    Position  = new Position(0, i * 100),
                    Size      = new Size(800, 100),
                    PointSize = 12.0f,
                    TextColor = Color.Black,
                };
                if (i % 2 == 0)
                {
                    items[i].BackgroundColor = Color.White;
                }
                else
                {
                    items[i].BackgroundColor = Color.Cyan;
                }
                mScrollableBase.Add(items[i]);
            }
            root.Add(mScrollableBase);
        }
Пример #2
0
        private void CreateVerticalScrollableBase()
        {
            verticalScrollableBase = new Components.ScrollableBase()
            {
                Size = new Size(400, 300),
                ScrollingDirection       = Components.ScrollableBase.Direction.Vertical,
                EnableOverShootingEffect = true,
            };
            verticalScrollableBase.ScrollOutOfBound += OnVerticalScrollOutOfBound;

            verticalItems = new TextLabel[5];
            for (int i = 0; i < 5; i++)
            {
                verticalItems[i] = new TextLabel
                {
                    Position  = new Position(0, i * 100),
                    Size      = new Size(400, 100),
                    PointSize = 12.0f,
                    TextColor = Color.Black,
                };
                if (i % 2 == 0)
                {
                    verticalItems[i].BackgroundColor = Color.White;
                }
                else
                {
                    verticalItems[i].BackgroundColor = Color.Cyan;
                }
                verticalScrollableBase.Add(verticalItems[i]);
            }
            root.Add(verticalScrollableBase);
        }
Пример #3
0
        private void CreateHorizontalScrollableBase()
        {
            horizontalScrollableBase = new Components.ScrollableBase()
            {
                Size = new Size(400, 300),
                ScrollingDirection = Components.ScrollableBase.Direction.Horizontal,
            };
            horizontalScrollableBase.ScrollOutOfBound += OnHorizontalScrollOutOfBound;

            horizontalItems = new TextLabel[5];
            for (int i = 0; i < 5; i++)
            {
                horizontalItems[i] = new TextLabel
                {
                    Position  = new Position(i * 200, 0),
                    Size      = new Size(200, 300),
                    PointSize = 12.0f,
                    TextColor = Color.Black,
                };
                if (i % 2 == 0)
                {
                    horizontalItems[i].BackgroundColor = Color.White;
                }
                else
                {
                    horizontalItems[i].BackgroundColor = Color.Cyan;
                }
                horizontalScrollableBase.Add(horizontalItems[i]);
            }
            root.Add(horizontalScrollableBase);
        }
Пример #4
0
        public void Activate()
        {
            window             = NUIApplication.GetDefaultWindow();
            defaultLayer       = window.GetDefaultLayer();
            window.TouchEvent += OnRiveWindowTouchEvent;

            // Load RiveAnimation File
            rav = new Tizen.NUI.Extension.RiveAnimationView(Tizen.Applications.Application.Current.DirectoryInfo.Resource + "rive/space_reload.riv")
            {
                Size     = new Size(720, 500),
                Position = new Position(0, 72)
            };

            scroll = new Components.ScrollableBase()
            {
                Position                 = new Position(0, 120),
                Size                     = new Size(720, 1160),
                ScrollingDirection       = Components.ScrollableBase.Direction.Vertical,
                EnableOverShootingEffect = true,
                HideScrollbar            = true,
                ScrollEnabled            = false
            };
            scroll.Scrolling += Scrolling;

            header = new TextLabel
            {
                Text                = "Universe",
                Position            = new Position(0, 0),
                Size                = new Size(720, 120),
                BackgroundColor     = new Color(52.0f / 255.0f, 43.0f / 255.0f, 117.0f / 255.0f, 1.0f),
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                TextColor           = new Color(1.0f, 1.0f, 1.0f, 1.0f),
                PointSize           = 20.0f,
            };

            viewItems = new View[5];
            for (int i = 0; i < 5; i++)
            {
                viewItems[i] = new View
                {
                    Position        = VIEW_POSITION[i],
                    Size            = VIEW_SIZE[i],
                    BackgroundImage = VIEW_BG_PATH[i],
                    Layout          = new LinearLayout()
                    {
                        LinearOrientation = LinearLayout.Orientation.Vertical,
                        LinearAlignment   = LinearLayout.Alignment.Center,
                        CellPadding       = new Size(40, 0)
                    }
                };

                TextLabel title = new TextLabel
                {
                    Size      = new Size(550, 70),
                    PointSize = 12.0f,
                    Text      = VIEW_TITLE[i],
                    TextColor = VIEW_TITLE_COLOR[i]
                };

                TextLabel text = new TextLabel
                {
                    Size      = new Size(550, 100),
                    PointSize = 9.0f,
                    MultiLine = true,
                    Text      = VIEW_TEXT[i],
                    TextColor = new Color(1.0f, 1.0f, 1.0f, 1.0f)
                };

                if (i == 0)
                {
                    viewItems[i].TouchEvent += OnChangeEarthColor;
                }
                else if (i == 1)
                {
                    viewItems[i].TouchEvent += OnChangeMoonColor;
                }
                else if (i == 2)
                {
                    viewItems[i].TouchEvent += OnChangeSunColor;
                }
                else if (i == 3)
                {
                    viewItems[i].TouchEvent += OnChangeJupiterColor;
                }

                viewItems[i].Add(title);
                viewItems[i].Add(text);
                scroll.Add(viewItems[i]);
            }

            defaultLayer.Add(rav);
            defaultLayer.Add(scroll);
            defaultLayer.Add(header);

            // Enable RiveAnimation and Play
            rav.EnableAnimation("Idle", true);
            rav.Play();
        }