コード例 #1
0
        protected override void OnAttached()
        {
            var rect = Control.Geometry;

            _surfaceLayout = new ElmSharp.Layout(Container);
            _surfaceLayout.Show();
            _surface = new ElmSharp.Wearable.CircleSurface(_surfaceLayout);
            _surfaceLayout.Geometry = rect;
            _surfaceLayout.StackAbove(Control);

            CircleSurfaceEffectBehavior.SetSurface(Element, _surface);

            _showEvent    = new EvasObjectEvent(Control, EvasObjectCallbackType.Show);
            _hideEvent    = new EvasObjectEvent(Control, EvasObjectCallbackType.Hide);
            _restackEvent = new EvasObjectEvent(Control, EvasObjectCallbackType.Restack);
            _moveEvent    = new EvasObjectEvent(Control, EvasObjectCallbackType.Move);
            _resizeEvent  = new EvasObjectEvent(Control, EvasObjectCallbackType.Resize);

            _showEvent.On    += ControlShowed;
            _hideEvent.On    += ControlHided;
            _restackEvent.On += ControlRestacked;
            _moveEvent.On    += ControlChanged;
            _resizeEvent.On  += ControlChanged;

            Element.PropertyChanging += ElementPropertyChanging;
            Element.PropertyChanged  += ElementPropertyChanged;

            EcoreMainloop.Post(() =>
            {
                var obj = CircleSurfaceEffectBehavior.GetRotaryFocusObject(Element);
                ActivateRotaryFocusable(obj);
            });
        }
コード例 #2
0
ファイル: Preload.cs プロジェクト: yunmiha/TizenFX
        static public void WarmupWidgets(PreloadedWindow win)
        {
            var surface = new CircleSurface(win.BaseConformant);

            win.BaseCircleSurface = surface;
            new CircleDateTimeSelector(win, surface).Unrealize();
            new CircleProgressBar(win, surface).Unrealize();
            new CircleScroller(win, surface).Unrealize();
            new CircleSlider(win, surface).Unrealize();
            new CircleSpinner(win, surface).Unrealize();
            new MoreOption(win).Unrealize();
        }
コード例 #3
0
        protected override void OnDetached()
        {
            var obj = CircleSurfaceEffectBehavior.GetRotaryFocusObject(Element);

            DeativateRotaryFocusable(obj);

            _surface.Delete();
            _surface = null;
            _surfaceLayout.Unrealize();
            _surfaceLayout = null;
            CircleSurfaceEffectBehavior.SetSurface(Element, null);

            _showEvent.Dispose();
            _hideEvent.Dispose();
            _restackEvent.Dispose();
            _moveEvent.Dispose();
            _resizeEvent.Dispose();
        }
コード例 #4
0
        void OnRealized()
        {
            _box = new ObservableBox(Xamarin.Forms.Platform.Tizen.Forms.NativeParent);
            _box.SetLayoutCallback(OnLayout);

            _bgColorObject = new ElmSharp.Rectangle(_box)
            {
                Color = ElmSharp.Color.Transparent
            };
            _bgImageObject = new EvasImage(_box);
            _surfaceLayout = new ElmSharp.Layout(_box);
            _surface       = new ElmSharp.Wearable.CircleSurface(_surfaceLayout);


            _toolbarItemMap     = new Dictionary <XToolbarItem, ElmSharp.Wearable.MoreOptionItem>();
            _circleSurfaceItems = new Dictionary <ICircleSurfaceItem, ICircleWidget>();

            _box.PackEnd(_bgColorObject);
            _box.PackEnd(_bgImageObject);
            _box.PackEnd(_surfaceLayout);

            _bgColorObject.Show();
            _bgImageObject.Hide();
            _surfaceLayout.Show();

            if (Element.ToolbarItems.Count > 0)
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    SetVisibleMoreOption(true);

                    foreach (var item in Element.ToolbarItems)
                    {
                        AddToolbarItem(item);
                    }
                });
            }

            SetNativeView(_box);
        }
コード例 #5
0
 public CircleSlider(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent))
 {
     ((IRotaryActionWidget)this).Activate();
 }
コード例 #6
0
 /// <summary>
 /// Creates and initializes a new instance of the CircleSlider class.
 /// </summary>
 /// <param name="parent">The EvasObject to which the new CircleSlider will be attached as a child.</param>
 /// <param name="surface">The surface for drawing the circle features for this widget.</param>
 /// <since_tizen> preview </since_tizen>
 public CircleSlider(EvasObject parent, CircleSurface surface) : base()
 {
     Debug.Assert(parent == null || surface == null || parent.IsRealized);
     _surface = surface;
     Realize(parent);
 }
コード例 #7
0
 public CircleProgressBar(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent))
 {
 }