Remove CheckBox (#125)
author윤정현/Common Platform Lab(SR)/Staff Engineer/삼성전자 <jh0506.yun@samsung.com>
Wed, 8 Jan 2020 06:31:41 +0000 (15:31 +0900)
committer유리나/Common Platform Lab(SR)/Staff Engineer/삼성전자 <rina6350.you@samsung.com>
Wed, 8 Jan 2020 06:31:41 +0000 (15:31 +0900)
Xamarin.Forms.Core/CheckBox.cs [deleted file]
Xamarin.Forms.Platform.Tizen/Forms.cs
Xamarin.Forms.Platform.Tizen/Properties/AssemblyInfo.cs
Xamarin.Forms.Platform.Tizen/Renderers/CheckBoxRenderer.cs [deleted file]
Xamarin.Forms.Platform.Tizen/StaticRegistrar.cs
Xamarin.Forms.Platform/Xamarin.Forms.Platform.cs

diff --git a/Xamarin.Forms.Core/CheckBox.cs b/Xamarin.Forms.Core/CheckBox.cs
deleted file mode 100644 (file)
index adae2c5..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-using Xamarin.Forms.Platform;
-
-namespace Xamarin.Forms
-{
-       [RenderWith(typeof(_CheckBoxRenderer))]
-       public class CheckBox : View, IElementConfiguration<CheckBox>, IBorderElement, IColorElement
-       {
-               readonly Lazy<PlatformConfigurationRegistry<CheckBox>> _platformConfigurationRegistry;
-               public const string IsCheckedVisualState = "IsChecked";
-
-               public static readonly BindableProperty IsCheckedProperty =
-                       BindableProperty.Create(nameof(IsChecked), typeof(bool), typeof(CheckBox), false,
-                               propertyChanged: (bindable, oldValue, newValue) => {
-                       ((CheckBox)bindable).CheckedChanged?.Invoke(bindable, new CheckedChangedEventArgs((bool)newValue));
-                       ((CheckBox)bindable).ChangeVisualState();
-               }, defaultBindingMode: BindingMode.TwoWay);
-
-               public static readonly BindableProperty ColorProperty = ColorElement.ColorProperty;
-
-               public Color Color
-               {
-                       get => (Color)GetValue(ColorProperty);
-                       set => SetValue(ColorProperty, value);
-               }
-
-
-               public CheckBox() => _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<CheckBox>>(() => new PlatformConfigurationRegistry<CheckBox>(this));
-
-               public bool IsChecked
-               {
-                       get => (bool)GetValue(IsCheckedProperty);
-                       set => SetValue(IsCheckedProperty, value);
-               }
-
-               protected internal override void ChangeVisualState()
-               {
-                       if (IsEnabled && IsChecked)
-                               VisualStateManager.GoToState(this, IsCheckedVisualState);
-                       else
-                               base.ChangeVisualState();
-               }
-
-               public event EventHandler<CheckedChangedEventArgs> CheckedChanged;
-
-               public IPlatformElementConfiguration<T, CheckBox> On<T>() where T : IConfigPlatform
-               {
-                       return _platformConfigurationRegistry.Value.On<T>();
-               }
-
-               void IBorderElement.OnBorderColorPropertyChanged(Color oldValue, Color newValue)
-               {
-               }
-
-               Color IBorderElement.BorderColor => Color.Transparent;
-               int IBorderElement.CornerRadius => 0;
-               double IBorderElement.BorderWidth => 0;
-               int IBorderElement.CornerRadiusDefaultValue => 0;
-               Color IBorderElement.BorderColorDefaultValue => Color.Transparent;
-               double IBorderElement.BorderWidthDefaultValue => 0;
-               bool IBorderElement.IsCornerRadiusSet() => false;
-               bool IBorderElement.IsBackgroundColorSet() => IsSet(BackgroundColorProperty);
-               bool IBorderElement.IsBorderColorSet() => false;
-               bool IBorderElement.IsBorderWidthSet() => false;
-       }
-}
\ No newline at end of file
index f51cc03..141e5cf 100644 (file)
@@ -698,7 +698,6 @@ namespace Xamarin.Forms
                                typeof(BoxView),
                                typeof(Button),
                                typeof(ImageButton),
-                               typeof(CheckBox),
                                typeof(Slider),
                                typeof(Stepper),
                                typeof(Switch),
index 668c6ee..42f8459 100644 (file)
@@ -26,7 +26,6 @@ using Xamarin.Forms.Platform.Tizen;
 [assembly: ExportRenderer(typeof(TimePicker), typeof(TimePickerRenderer))]
 [assembly: ExportRenderer(typeof(ProgressBar), typeof(ProgressBarRenderer))]
 [assembly: ExportRenderer(typeof(Switch), typeof(SwitchRenderer))]
-[assembly: ExportRenderer(typeof(CheckBox), typeof(CheckBoxRenderer))]
 [assembly: ExportRenderer(typeof(ListView), typeof(ListViewRenderer))]
 [assembly: ExportRenderer(typeof(BoxView), typeof(BoxViewRenderer))]
 [assembly: ExportRenderer(typeof(ActivityIndicator), typeof(ActivityIndicatorRenderer))]
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/CheckBoxRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/CheckBoxRenderer.cs
deleted file mode 100644 (file)
index e13925d..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-using System;
-using ElmSharp;
-using EColor = ElmSharp.Color;
-
-namespace Xamarin.Forms.Platform.Tizen
-{
-       public class CheckBoxRenderer : ViewRenderer<CheckBox, Check>
-       {
-               readonly string[] _onColorParts;
-               readonly string[] _onColorEdjeParts;
-
-               public CheckBoxRenderer()
-               {
-                       _onColorParts = Device.Idiom == TargetIdiom.Watch ? new string[] {"outer_bg_on", "outer_bg_on_pressed", "check_on", "check_on_pressed"} : new string[] {"bg_on", "stroke"};
-                       _onColorEdjeParts = new string[_onColorParts.Length];
-                       RegisterPropertyHandler(CheckBox.IsCheckedProperty, UpdateIsChecked);
-                       RegisterPropertyHandler(CheckBox.ColorProperty, UpdateOnColor);
-               }
-
-               protected override void OnElementChanged(ElementChangedEventArgs<CheckBox> e)
-               {
-                       if (Control == null)
-                       {
-                               SetNativeControl(new Check(Forms.NativeParent));
-                               Control.StateChanged += OnStateChanged;
-                               for (int i=0; i<_onColorParts.Length; i++)
-                               {
-                                       _onColorEdjeParts[i] = Control.ClassName.ToLower().Replace("elm_", "") + "/" + _onColorParts[i];
-                               }
-                       }
-                       base.OnElementChanged(e);
-               }
-
-               protected override void Dispose(bool disposing)
-               {
-                       if (disposing)
-                       {
-                               if (Control != null)
-                               {
-                                       Control.StateChanged -= OnStateChanged;
-                               }
-                       }
-                       base.Dispose(disposing);
-               }
-
-               void OnStateChanged(object sender, EventArgs e)
-               {
-                       Element.SetValueFromRenderer(CheckBox.IsCheckedProperty, Control.IsChecked);
-               }
-
-               void UpdateIsChecked()
-               {
-                       Control.IsChecked = Element.IsChecked;
-               }
-
-               void UpdateOnColor(bool initialize)
-               {
-                       if (initialize && Element.Color.IsDefault)
-                               return;
-
-                       if (Element.Color.IsDefault)
-                       {
-                               foreach(string s in _onColorEdjeParts)
-                               {
-                                       Control.EdjeObject.DeleteColorClass(s);
-                               }
-                       }
-                       else
-                       {
-                               EColor color = Element.Color.ToNative();
-                               foreach (string s in _onColorParts)
-                               {
-                                       Control.SetPartColor(s, color);
-                               }
-                       }
-               }
-       }
-}
index 4f7b3ce..d589e51 100644 (file)
@@ -86,7 +86,6 @@ namespace Xamarin.Forms.Platform.Tizen
                        Registered.Register(typeof(TimePicker), () => new TimePickerRenderer());
                        Registered.Register(typeof(ProgressBar), () => new ProgressBarRenderer());
                        Registered.Register(typeof(Switch), () => new SwitchRenderer());
-                       Registered.Register(typeof(CheckBox), () => new CheckBoxRenderer());
                        Registered.Register(typeof(ListView), () => new ListViewRenderer());
                        Registered.Register(typeof(BoxView), () => new BoxViewRenderer());
                        Registered.Register(typeof(ActivityIndicator), () => new ActivityIndicatorRenderer());
index d060611..6d8aeeb 100644 (file)
        {
        }
 
-       internal class _CheckBoxRenderer
-       {
-       }
-
        internal class _IndicatorViewRenderer
        {
        }
        internal class _SwipeViewRenderer
        {
        }
-}
\ No newline at end of file
+}