Skip to content

Commit

Permalink
[NUI] Remove build warning
Browse files Browse the repository at this point in the history
1. Remove XML parsing error
2. Let we use SafeHandle.Dispose(bool), instead of Dispose() API directly.
3. Add 'new' keyword what we re-define properties intention.

Signed-off-by: Eunki, Hong <[email protected]>
  • Loading branch information
Eunki, Hong authored and hinohie committed Jun 27, 2024
1 parent 26c7f10 commit 60595fd
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ public partial class ItemView
/// LayoutProperty
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static BindableProperty LayoutProperty = null;
internal static void SetInternalLayoutProperty(BindableObject bindable, object oldValue, object newValue)
public static new BindableProperty LayoutProperty = null;
internal static new void SetInternalLayoutProperty(BindableObject bindable, object oldValue, object newValue)
{
var instance = (Tizen.NUI.ItemView)bindable;
if (newValue != null)
{
instance.InternalLayout = (Tizen.NUI.PropertyArray)newValue;
}
}
internal static object GetInternalLayoutProperty(BindableObject bindable)
internal static new object GetInternalLayoutProperty(BindableObject bindable)
{
var instance = (Tizen.NUI.ItemView)bindable;
return instance.InternalLayout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,22 @@ internal static object GetInternalResourceURLProperty(BindableObject bindable)
/// <summary>
/// ResourceUrlProperty
/// </summary>
/// <remarks>
/// This property does not have same logic with LottieAnimationView.ResourceUrl.
/// Should use new keyword!
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY
public static new BindableProperty ResourceUrlProperty = null;
#else
public static readonly new BindableProperty ResourceUrlProperty = null;
#endif
internal static void SetInternalResourceUrlProperty(BindableObject bindable, object oldValue, object newValue)
internal static new void SetInternalResourceUrlProperty(BindableObject bindable, object oldValue, object newValue)
{
var instance = (Tizen.NUI.BaseComponents.AnimatedVectorImageView)bindable;
instance.InternalResourceUrl = (string)newValue;
}
internal static object GetInternalResourceUrlProperty(BindableObject bindable)
internal static new object GetInternalResourceUrlProperty(BindableObject bindable)
{
var instance = (Tizen.NUI.BaseComponents.AnimatedVectorImageView)bindable;
return instance.InternalResourceUrl;
Expand Down Expand Up @@ -88,21 +92,25 @@ internal static object GetInternalRepeatCountProperty(BindableObject bindable)
/// <summary>
/// CurrentFrameProperty
/// </summary>
/// <remarks>
/// This property does not have same logic with LottieAnimationView.CurrentFrame.
/// Should use new keyword!
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY
public static new BindableProperty CurrentFrameProperty = null;
#else
public static readonly new BindableProperty CurrentFrameProperty = null;
#endif
internal static void SetInternalCurrentFrameProperty(BindableObject bindable, object oldValue, object newValue)
internal static new void SetInternalCurrentFrameProperty(BindableObject bindable, object oldValue, object newValue)
{
var instance = (Tizen.NUI.BaseComponents.AnimatedVectorImageView)bindable;
if (newValue != null)
{
instance.InternalCurrentFrame = (int)newValue;
}
}
internal static object GetInternalCurrentFrameProperty(BindableObject bindable)
internal static new object GetInternalCurrentFrameProperty(BindableObject bindable)
{
var instance = (Tizen.NUI.BaseComponents.AnimatedVectorImageView)bindable;
return instance.InternalCurrentFrame;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ static CanvasView()
{
ViewBoxProperty = BindableProperty.Create(nameof(ViewBox), typeof(Tizen.NUI.Size2D), typeof(Tizen.NUI.BaseComponents.VectorGraphics.CanvasView), null,
propertyChanged: SetInternalViewBoxProperty, defaultValueCreator: GetInternalViewBoxProperty);
SynchronousLoadingProperty = BindableProperty.Create(nameof(ViewBox), typeof(bool), typeof(Tizen.NUI.BaseComponents.VectorGraphics.CanvasView), true,
SynchronousLoadingProperty = BindableProperty.Create(nameof(SynchronousLoading), typeof(bool), typeof(Tizen.NUI.BaseComponents.VectorGraphics.CanvasView), true,
propertyChanged: SetInternalSynchronousLoadingProperty, defaultValueCreator: GetInternalSynchronousLoadingProperty);
RasterizationRequestManuallyProperty = BindableProperty.Create(nameof(ViewBox), typeof(bool), typeof(Tizen.NUI.BaseComponents.VectorGraphics.CanvasView), false,
RasterizationRequestManuallyProperty = BindableProperty.Create(nameof(RasterizationRequestManually), typeof(bool), typeof(Tizen.NUI.BaseComponents.VectorGraphics.CanvasView), false,
propertyChanged: SetInternalRasterizationRequestManuallyProperty, defaultValueCreator: GetInternalRasterizationRequestManuallyProperty);
}
}
Expand Down
23 changes: 19 additions & 4 deletions src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,29 @@ public override bool IsInvalid

protected override bool ReleaseHandle()
{
DisposeQueue.Instance.Add(this);
if (!IsInvalid)
{
DisposeQueue.Instance.Add(this);
}
return true;
}

public void Dispose()
protected override void Dispose(bool disposing)
{
Interop.View.DeleteControlHandleView(handle);
this.SetHandle(IntPtr.Zero);
if (IsInvalid)
{
return;
}

if (disposing)
{
Interop.View.DeleteControlHandleView(handle);
this.SetHandle(IntPtr.Zero);
}
else
{
DisposeQueue.Instance.Add(this);
}
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ internal enum BackgroundExtraDataUpdatedFlag : byte

internal BackgroundExtraDataUpdatedFlag backgroundExtraDataUpdatedFlag = BackgroundExtraDataUpdatedFlag.None;

private bool backgroundExtraDataUpdateProcessAttachedFlag = false;
// TODO : Re-open this API when we resolve Animation issue.
// private bool backgroundExtraDataUpdateProcessAttachedFlag = false;

internal virtual LayoutItem CreateDefaultLayout()
{
Expand Down Expand Up @@ -1217,7 +1218,8 @@ internal virtual void UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag f
private void UpdateBackgroundExtraData(object source, EventArgs e)
{
// Note : To allow event attachment during UpdateBackgroundExtraData, let we make flag as false before call UpdateBackgroundExtraData().
backgroundExtraDataUpdateProcessAttachedFlag = false;
// TODO : Re-open this API when we resolve Animation issue.
// backgroundExtraDataUpdateProcessAttachedFlag = false;
UpdateBackgroundExtraData();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Tizen.NUI/src/public/Common/WeakEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected virtual void OnCountIncreased()
/// </summary>
/// <remarks>
/// The event handler count decreases when an event handler is removed
/// with <see cref="Remove()"/> or after detecting that it is no longer valid.
/// with <see cref="Remove(T)"/> or after detecting that it is no longer valid.
/// </remarks>
/// <since_tizen> 12 </since_tizen>
protected virtual void OnCountDecreased()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Tizen.NUI.Utility
{
/// <summary>
/// Accumulating Velocity Tracker
/// </sumary>
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public class AccumulatingVelocityTrackerStrategy : VelocityTrackerStrategy
{
Expand Down Expand Up @@ -56,7 +56,7 @@ public Movement(uint pEventTime, float pPosition)

/// <summary>
/// Create an instance of AccumulatingVelocityTrackerStrategy.
/// </sumary>
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public AccumulatingVelocityTrackerStrategy(uint maximumTime) : base()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Tizen.NUI/src/public/Utility/VelocityTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace Tizen.NUI.Utility
{
/// <summary>
/// Calculates the velocity of touch movements over time.
/// </summary>
/// <example>
/// private void OnPanGestureDetected(object source, PanGestureDetector.DetectedEventArgs e)
/// {
Expand All @@ -45,7 +46,6 @@ namespace Tizen.NUI.Utility
/// }
/// }
/// </example>
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public class VelocityTracker
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Tizen.NUI.Utility

/// <summary>
/// VelocityTrackerStrategy
/// </sumary>
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract class VelocityTrackerStrategy
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public void Activate()
PivotPoint = PivotPoint.Center,
PositionUsesPivotPoint = true,
};
root.PropertyChanged += (object o, global::System.ComponentModel.PropertyChangedEventArgs e) =>
{
Tizen.Log.Error("NUI", $"root view Property Changed! {e.PropertyName}\n");
};
window.Add(root);

window.KeyEvent += WindowKeyEvent;
Expand All @@ -46,6 +50,10 @@ public void Activate()
PivotPoint = PivotPoint.Center,
PositionUsesPivotPoint = true,
};
canvasView.PropertyChanged += (object o, global::System.ComponentModel.PropertyChangedEventArgs e) =>
{
Tizen.Log.Error("NUI", $"canvas view Property Changed! {e.PropertyName}\n");
};

RadialGradient roundedRectFillRadialGradient = new RadialGradient()
{
Expand Down

0 comments on commit 60595fd

Please sign in to comment.