Beispiel #1
0
 /// <summary>
 /// Creates a new instance of a Button with style.
 /// </summary>
 /// <param name="buttonStyle">Create Button by style customized by user.</param>
 /// <since_tizen> 8 </since_tizen>
 public Button(ButtonStyle buttonStyle) : base(buttonStyle)
 {
 }
Beispiel #2
0
        private View CreateListItem(int imageIndex, string text, bool toggle)
        {
            LinearLayout linearLayout = new LinearLayout()
            {
                LinearOrientation = LinearLayout.Orientation.Horizontal,
            };

            View listItem = new View()
            {
                WidthSpecification  = LayoutParamPolicies.MatchParent,
                HeightSpecification = LayoutParamPolicies.WrapContent,
                Layout  = linearLayout,
                Padding = new Extents(5, 5, 40, 40),
                Name    = "flexibleLayout-entry-" + text,
            };

            TextLabel textLabel = new TextLabel()
            {
                Text       = text,
                Name       = "flexibleLayout-text-label-" + text,
                Margin     = new Extents(90, 0, 0, 0),
                TextColor  = new Color(0.6f, 0.6f, 0.6f, 1),
                PointSize  = 38,
                FontFamily = "SamsungOneUI 500C",
            };

            if (imageIndex >= 0)
            {
                ImageView icon = new ImageView(applicationIconsArray[imageIndex]);
                listItem.Add(icon);
            }

            listItem.Add(textLabel);

            if (toggle)
            {
                Tizen.NUI.Components.ButtonStyle buttonStyle = new Tizen.NUI.Components.ButtonStyle
                {
                    Icon = new ImageViewStyle
                    {
                        ResourceUrl = new Tizen.NUI.Components.StringSelector
                        {
                            Normal   = this.DirectoryInfo.Resource + TestImages.iconImage[2],
                            Selected = this.DirectoryInfo.Resource + TestImages.iconImage[1]
                        },
                    },
                    IsSelectable = true,
                };

                Tizen.NUI.Components.Button toggleButton = new Tizen.NUI.Components.Button(buttonStyle)
                {
                    Name   = "toggleButton",
                    Size2D = new Size2D(90, 30),
                };

                listItem.Add(toggleButton);
            }


            return(listItem);
        }
Beispiel #3
0
 public CheckBox(ButtonStyle attrs) : base(attrs)
 {
 }
Beispiel #4
0
 public RadioButton(ButtonStyle buttonStyle) : base(buttonStyle)
 {
 }
Beispiel #5
0
        /// <summary>
        /// Applies style to AppBar.
        /// </summary>
        /// <param name="viewStyle">The style to apply.</param>
        /// <since_tizen> 9 </since_tizen>
        public override void ApplyStyle(ViewStyle viewStyle)
        {
            styleApplied = false;

            base.ApplyStyle(viewStyle);

            var appBarStyle = viewStyle as AppBarStyle;

            if (appBarStyle == null)
            {
                return;
            }

            if (appBarStyle.NavigationPadding != null)
            {
                navigationPadding = new Extents(appBarStyle.NavigationPadding);
            }

            if (appBarStyle.ActionPadding != null)
            {
                actionPadding = new Extents(appBarStyle.ActionPadding);
            }

            // Apply Back Button style.
            if ((appBarStyle.BackButton != null) && (DefaultNavigationContent is Button button))
            {
                button.ApplyStyle(appBarStyle.BackButton);
            }

            // Apply Title style.
            if ((appBarStyle.TitleTextLabel != null) && (DefaultTitleContent is TextLabel textLabel))
            {
                textLabel.ApplyStyle(appBarStyle.TitleTextLabel);
            }

            // Apply ActionCellPadding style.
            if (DefaultActionContent?.Layout is LinearLayout linearLayout && appBarStyle.ActionCellPadding != null)
            {
                linearLayout.CellPadding = new Size2D(appBarStyle.ActionCellPadding.Width, appBarStyle.ActionCellPadding.Height);
            }

            // Apply Action and ActionButton styles.
            if (DefaultActionContent?.Children != null)
            {
                foreach (var action in DefaultActionContent?.Children)
                {
                    if ((action is Button) && (appBarStyle.ActionButton != null))
                    {
                        action.ApplyStyle(appBarStyle.ActionButton);
                    }
                    else if (appBarStyle.ActionView != null)
                    {
                        action.ApplyStyle(appBarStyle.ActionView);
                    }
                }
            }

            if (actionButtonStyle == null)
            {
                actionButtonStyle = (ButtonStyle)appBarStyle.ActionButton.Clone();
            }
            else
            {
                actionButtonStyle.MergeDirectly(appBarStyle.ActionButton);
            }

            if (actionViewStyle == null)
            {
                actionViewStyle = (ViewStyle)appBarStyle.ActionView.Clone();
            }
            else
            {
                actionViewStyle.MergeDirectly(appBarStyle.ActionView);
            }


            styleApplied = true;

            // Calculate children's positions based on padding sizes.
            CalculatePosition();
        }
Beispiel #6
0
 /// <summary>
 /// Creates a new instance of a Button with style.
 /// </summary>
 /// <param name="buttonStyle">Create Button by style customized by user.</param>
 /// <since_tizen> 8 </since_tizen>
 public Button(ButtonStyle buttonStyle) : base(buttonStyle)
 {
     Initialize();
 }
Beispiel #7
0
 /// <summary>
 /// Creates a new instance of a Button with style.
 /// </summary>
 /// <param name="buttonStyle">Create Button by style customized by user.</param>
 /// <since_tizen> 8 </since_tizen>
 public Button(ButtonStyle buttonStyle) : base(buttonStyle)
 {
     Focusable = true;
 }
Beispiel #8
0
 public CheckBox(ButtonStyle buttonStyle) : base(buttonStyle)
 {
 }
Beispiel #9
0
 /// <summary>
 /// Creates a new instance of a ButtonStyle with style.
 /// </summary>
 /// <param name="style">Create ButtonStyle by style customized by user.</param>
 /// <since_tizen> 8 </since_tizen>
 public ButtonStyle(ButtonStyle style) : base(style)
 {
 }
Beispiel #10
0
 public SelectButton(ButtonStyle style) : base(style)
 {
     Initialize();
 }
Beispiel #11
0
 public RadioButton(ButtonStyle attrs) : base(attrs)
 {
 }