From 864e3ddc5b896972aa5167abe41e853cd417e2e6 Mon Sep 17 00:00:00 2001 From: Seoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com> Date: Tue, 9 Jun 2020 10:52:02 +0900 Subject: [PATCH] [NUI] Update Wearable default style (#1664) - Added default indicator size to CircularPagination. - Changed the names of bindable properties. - Added Stop() before creating Animation with visual. Signed-off-by: Seoyeon Kim --- .../src/public/CircularProgress.cs | 21 ++++++++++++--------- .../public/WearableStyle/CircularPaginationStyle.cs | 1 + .../public/WearableStyle/CircularProgressStyle.cs | 6 +++--- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/Tizen.NUI.Wearable/src/public/CircularProgress.cs b/src/Tizen.NUI.Wearable/src/public/CircularProgress.cs index 10283fc..3ce7821 100755 --- a/src/Tizen.NUI.Wearable/src/public/CircularProgress.cs +++ b/src/Tizen.NUI.Wearable/src/public/CircularProgress.cs @@ -82,7 +82,7 @@ namespace Tizen.NUI.Wearable /// Bindable property of CurrentValue [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CurrentValueProperty = BindableProperty.Create("currentValue", typeof(float), typeof(CircularProgress), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty CurrentValueProperty = BindableProperty.Create(nameof(CurrentValue), typeof(float), typeof(CircularProgress), default(float), propertyChanged: (bindable, oldValue, newValue) => { var instance = (CircularProgress)bindable; if (newValue != null) @@ -103,7 +103,7 @@ namespace Tizen.NUI.Wearable /// Bindable property of TrackColor [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TrackColorProperty = BindableProperty.Create("trackColor", typeof(Color), typeof(CircularProgress), null, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(CircularProgress), null, propertyChanged: (bindable, oldValue, newValue) => { var instance = (CircularProgress)bindable; @@ -118,7 +118,7 @@ namespace Tizen.NUI.Wearable /// Bindable property of ProgressColor [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ProgressColorProperty = BindableProperty.Create("progressColor", typeof(Color), typeof(CircularProgress), null, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty ProgressColorProperty = BindableProperty.Create(nameof(ProgressColor), typeof(Color), typeof(CircularProgress), null, propertyChanged: (bindable, oldValue, newValue) => { var instance = (CircularProgress)bindable; @@ -147,8 +147,8 @@ namespace Tizen.NUI.Wearable return instance.privateIsEnabled; }); - private static readonly string TrackVisualName = "Track"; - private static readonly string ProgressVisualName = "Progress"; + private const string TrackVisualName = "Track"; + private const string ProgressVisualName = "Progress"; private ArcVisual trackVisual; private ArcVisual progressVisual; @@ -271,6 +271,10 @@ namespace Tizen.NUI.Wearable } set { + if (sweepAngleAnimation) + { + sweepAngleAnimation.Stop(); + } sweepAngleAnimation = AnimateVisual(progressVisual, "sweepAngle", progressVisual.SweepAngle, 0, 100, AlphaFunction.BuiltinFunctions.EaseIn); SetValue(CurrentValueProperty, value); @@ -335,7 +339,7 @@ namespace Tizen.NUI.Wearable set { isEnabled = value; - if(isEnabled) + if (isEnabled) { UpdateTrackVisualColor(new Color(0.0f, 0.16f, 0.30f, 1.0f)); // #002A4D } @@ -349,7 +353,6 @@ namespace Tizen.NUI.Wearable #endregion Properties - #region Methods /// @@ -484,7 +487,7 @@ namespace Tizen.NUI.Wearable if (sweepAngleAnimation) { - sweepAngleAnimation?.Stop(); + sweepAngleAnimation.Stop(); } sweepAngleAnimation = AnimateVisual(progressVisual, "sweepAngle", progressVisual.SweepAngle, 0, 100, builtinAlphaFunction); @@ -515,7 +518,7 @@ namespace Tizen.NUI.Wearable } progressVisual.MixColor = progressColor; - if( !isEnabled ) // Dim state + if (!isEnabled) // Dim state { progressVisual.Opacity = 0.6f; } diff --git a/src/Tizen.NUI.Wearable/src/public/WearableStyle/CircularPaginationStyle.cs b/src/Tizen.NUI.Wearable/src/public/WearableStyle/CircularPaginationStyle.cs index d165f32..44cdab0 100755 --- a/src/Tizen.NUI.Wearable/src/public/WearableStyle/CircularPaginationStyle.cs +++ b/src/Tizen.NUI.Wearable/src/public/WearableStyle/CircularPaginationStyle.cs @@ -114,6 +114,7 @@ namespace Tizen.NUI.Wearable Normal = "/usr/share/dotnet.tizen/framework/res/" + "nui_component_default_pagination_normal_dot.png", Selected = "/usr/share/dotnet.tizen/framework/res/" + "nui_component_default_pagination_focus_dot.png", }; + IndicatorSize = new Size(10, 10); } } } diff --git a/src/Tizen.NUI.Wearable/src/public/WearableStyle/CircularProgressStyle.cs b/src/Tizen.NUI.Wearable/src/public/WearableStyle/CircularProgressStyle.cs index df9b0be..ca5c948 100755 --- a/src/Tizen.NUI.Wearable/src/public/WearableStyle/CircularProgressStyle.cs +++ b/src/Tizen.NUI.Wearable/src/public/WearableStyle/CircularProgressStyle.cs @@ -62,7 +62,7 @@ namespace Tizen.NUI.Wearable /// Bindable property of CurrentValue [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CurrentValueProperty = BindableProperty.Create("currentValue", typeof(float), typeof(CircularProgressStyle), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty CurrentValueProperty = BindableProperty.Create(nameof(CurrentValue), typeof(float), typeof(CircularProgressStyle), default(float), propertyChanged: (bindable, oldValue, newValue) => { ((CircularProgressStyle)bindable).currentValue = (float)newValue; }, @@ -73,7 +73,7 @@ namespace Tizen.NUI.Wearable /// Bindable property of TrackColor [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TrackColorProperty = BindableProperty.Create("trackColor", typeof(Color), typeof(CircularProgressStyle), null, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(CircularProgressStyle), null, propertyChanged: (bindable, oldValue, newValue) => { ((CircularProgressStyle)bindable).trackColor = (Color)newValue; }, @@ -84,7 +84,7 @@ namespace Tizen.NUI.Wearable /// Bindable property of ProgressColor [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ProgressColorProperty = BindableProperty.Create("progressColor", typeof(Color), typeof(CircularProgressStyle), null, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty ProgressColorProperty = BindableProperty.Create(nameof(ProgressColor), typeof(Color), typeof(CircularProgressStyle), null, propertyChanged: (bindable, oldValue, newValue) => { ((CircularProgressStyle)bindable).progressColor = (Color)newValue; }, -- 2.7.4