예제 #1
0
 protected internal virtual void RestoreKeyFocus()
 {
     if (FocusManager.Instance.IsDefaultAlgorithmEnabled())
     {
         if (LastFocusedView)
         {
             FocusManager.Instance.SetCurrentFocusView(LastFocusedView);
         }
         else
         {
             var temp = new Tizen.NUI.BaseComponents.View()
             {
                 Size      = new Size(0.1f, 0.1f, 0.0f),
                 Position  = new Position(0, 0, 0),
                 Focusable = true,
             };
             this.Add(temp);
             temp.LowerToBottom();
             FocusManager.Instance.SetCurrentFocusView(temp);
             var focused = FocusManager.Instance.GetNearestFocusableActor(this, temp, Tizen.NUI.BaseComponents.View.FocusDirection.Down);
             if (focused)
             {
                 FocusManager.Instance.SetCurrentFocusView(focused);
             }
             else
             {
                 FocusManager.Instance.ClearFocus();
             }
             temp.Unparent();
             temp.Dispose();
         }
     }
 }
예제 #2
0
 public static void SetEnable(this View view, bool enable)
 {
     if (view is NButton button)
     {
         button.IsEnabled = enable;
     }
     else
     {
         view.EnableControlState = enable;
     }
 }
        public static void UpdateBounds(this View view, Rect bounds)
        {
            if (view.Size.Width != bounds.Width || view.Size.Height != bounds.Height)
            {
                view.Size = bounds.Size.ToNative();
            }

            if (view.Position.X != bounds.X || view.Position.Y != bounds.Y)
            {
                view.Position = bounds.Location.ToNative();
            }
        }
예제 #4
0
 /// <summary>
 /// Remove view, a created view by Adaptor, should be removed by Adaptor
 /// </summary>
 /// <param name="native">A view to remove</param>
 public abstract void RemoveNativeView(View native);
예제 #5
0
 /// <summary>
 /// Remove footer view, a created view by Adaptor, should be removed by Adaptor
 /// </summary>
 /// <param name="footer">A view to remove</param>
 public virtual void RemoveFooterView(View footer)
 {
     footer.Dispose();
 }
예제 #6
0
 /// <summary>
 /// Remove header view, a created view by Adaptor, should be removed by Adaptor
 /// </summary>
 /// <param name="header">A view to remove</param>
 public virtual void RemoveHeaderView(View header)
 {
     header.Dispose();
 }
예제 #7
0
 /// <summary>
 /// Update View state
 /// </summary>
 /// <param name="view">A view to update</param>
 /// <param name="state">State of view</param>
 public virtual void UpdateViewState(View view, ViewHolderState state)
 {
 }
 public static void UpdateSize(this View view, Size size)
 {
     view.Size = size.ToNative();
 }
 public static Rect GetBounds(this View view)
 {
     return(new Rect(view.Position.ToCommon(), view.Size.ToCommon()));
 }
예제 #10
0
 public View FindChildById(uint id)
 {
     Tizen.NUI.BaseComponents.View ret = layer.FindChildById(id);
     return(BaseHandle.GetHandle(ret) as View);
 }
 public static void UpdatePosition(this View view, Point position)
 {
     view.Position = position.ToNative();
 }
 public static void UpdateBounds(this View view, Rect bounds)
 {
     view.Size     = bounds.Size.ToNative();
     view.Position = bounds.Location.ToNative();
 }
예제 #13
0
 public static void UpdateBackgroundColor(this View view, Color color)
 {
     view.BackgroundColor = color.IsDefault ? Color.Transparent.ToNative() : color.ToNative();
 }
예제 #14
0
 public static bool IsInside(this View view, Vector2 position)
 {
     return(position.X > 0 && position.X < view.SizeWidth && position.Y > 0 && position.Y < view.SizeHeight);
 }
예제 #15
0
 public static void SetEnable(this View view, bool enable)
 {
     view.IsEnabled = enable;
 }
예제 #16
0
 /// <summary>
 /// Set data binding between view and item
 /// </summary>
 /// <param name="view">A target view</param>
 /// <param name="index">A target item</param>
 public abstract void SetBinding(View view, int index);
예제 #17
0
 /// <summary>
 /// Unset data binding on view
 /// </summary>
 /// <param name="view">A view to unbinding</param>
 public abstract void UnBinding(View view);
예제 #18
0
 public override View GetChildAt(uint index)
 {
     Tizen.NUI.BaseComponents.View ret = layer.GetChildAt(index);
     return(BaseHandle.GetHandle(ret) as View);
 }