Esempio n. 1
0
        public void Initialize()
        {
            _window = Window.Instance;
            _window.BackgroundColor = Color.White;

            // 1) sibling order test
            SiblingTest();
            // 2) text visual test
            dali_VisualBase_Creation_test();

            // 3) visual creation test
            VisualTest2();

            _style = StyleManager.Get();
            //_style.StyleChanged += _style_StyleChanged;
            _style.StyleChanged += (obj, e) =>
            {
                Tizen.Log.Debug("NUI", "in stylechanged.. C#side..\n");
                //flag = true;
            };

            _style.ApplyTheme("/home/owner/apps_rw/NUISamples.TizenTV/res/json/date-picker-theme.json");
            Tizen.Log.Debug("NUI", "#### 1) first change!");


            AnimatePath_1();
        }
Esempio n. 2
0
        public void SiblingTest()
        {
            View        _prev     = null;
            Position2D  _myPos    = new Position2D(100, 100);
            List <View> list_view = new List <View>();
            TextLabel   _txt      = new TextLabel();

            for (int i = 0; i < 10; i++)
            {
                View       _view0 = new PushButton();
                PushButton _view  = _view0 as PushButton;

                _view.Name         = "sibling" + i;
                _view.MinimumSize  = new Size2D(100, 50);
                _view.LabelText    = "sibling" + i;
                _view.ParentOrigin = ParentOrigin.TopLeft;
                _view.PivotPoint   = PivotPoint.TopLeft;
                _view.Position2D   = _myPos + new Position2D(20 * i, 10 * i);
                _view.Clicked     += (sender, ee) =>
                {
                    View curr = sender as View;
                    Tizen.Log.Debug("NUI", "clicked curr view name=" + curr.Name + "  sibling=" + curr.SiblingOrder);
                    curr.RaiseToTop();
                    if (_prev)
                    {
                        _prev.LowerToBottom();
                        Tizen.Log.Debug("NUI", "raise on top is called!curr sibling=" + curr.SiblingOrder + " prev name=" + _prev.Name + " sibling=" + _prev.SiblingOrder);
                    }
                    _prev     = curr;
                    _txt.Text = "on top: " + curr.Name + ", sibling order=" + curr.SiblingOrder;

                    _style.ApplyTheme("/home/owner/apps_rw/NUISamples.TizenTV/res/json/style-example-theme-one.json");
                    Tizen.Log.Debug("NUI", "#### 2) second change!");

                    return(true);
                };
                list_view.Add(_view);
            }

            for (int i = 0; i < 10; i++)
            {
                _window.Add(list_view[i]);
                Tizen.Log.Debug("NUI", list_view[i].Name + "'s sibling order=" + list_view[i].SiblingOrder);
            }

            _txt.ParentOrigin = ParentOrigin.TopLeft;
            _txt.PivotPoint   = PivotPoint.TopLeft;
            _txt.Text         = "on top: sibling#, sibling order=?";
            _txt.Position2D   = _myPos + new Position2D(-50, 200);
            _txt.TextColor    = Color.Blue;
            _window.Add(_txt);
        }