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); }); }
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(); }
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(); }
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); }
public CircleSlider(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent)) { ((IRotaryActionWidget)this).Activate(); }
/// <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); }
public CircleProgressBar(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent)) { }