Skip to content

Commit

Permalink
Merge remote-tracking branch 'sec/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rookiejava committed Apr 28, 2022
2 parents fba5aac + 7c1e9e9 commit d2f9e8b
Show file tree
Hide file tree
Showing 46 changed files with 731 additions and 121 deletions.
7 changes: 7 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="myget" value="https://tizen.myget.org/F/dotnet/api/v3/index.json" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion Versions.prop
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<MicrosoftMauiGraphicsVersion>6.0.200-preview.13.935</MicrosoftMauiGraphicsVersion>
<MicrosoftMauiGraphicsVersion>6.0.300-rc.2.1310</MicrosoftMauiGraphicsVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public ActivityIndicatorDrawable(IActivityIndicator view)
float MaterialActivityIndicatorSweepAngle { get; set; }
float MaterialActivityIndicatorLastStartAngle { get; set; }

public override void Draw(ICanvas canvas, RectangleF dirtyRect)
public override void Draw(ICanvas canvas, RectF dirtyRect)
{
DrawMaterialActivityIndicator(canvas, dirtyRect);
}
Expand Down Expand Up @@ -65,7 +65,7 @@ public void UpdateAnimation(bool animate)
materialActivityIndicatorAngleAnimation.Commit(this, "MaterialActivityIndicator", length: 1400, repeat: () => true, finished: (l, c) => materialActivityIndicatorAngleAnimation = null);
}

void DrawMaterialActivityIndicator(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialActivityIndicator(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand Down
10 changes: 5 additions & 5 deletions src/Tizen.UIExtensions.Common/GraphicsView/ButtonDrawable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ButtonDrawable : GraphicsViewDrawable
const float MaterialShadowOffset = 3f;

readonly RippleEffectDrawable _rippleEffect;
RectangleF _backgroundRect;
RectF _backgroundRect;

public ButtonDrawable(IButton view)
{
Expand All @@ -22,7 +22,7 @@ public ButtonDrawable(IButton view)

IButton View { get; }

public override void Draw(ICanvas canvas, RectangleF dirtyRect)
public override void Draw(ICanvas canvas, RectF dirtyRect)
{
DrawMaterialButtonBackground(canvas, dirtyRect);
DrawMaterialButtonText(canvas, dirtyRect);
Expand Down Expand Up @@ -57,7 +57,7 @@ public override void OnTouchUp(GPoint point)
_rippleEffect.OnTouchUp(point);
}

void DrawMaterialButtonBackground(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialButtonBackground(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand All @@ -74,10 +74,10 @@ void DrawMaterialButtonBackground(ICanvas canvas, RectangleF dirtyRect)

canvas.RestoreState();

_backgroundRect = new RectangleF(x, y, width, height);
_backgroundRect = new RectF(x, y, width, height);
}

void DrawMaterialButtonText(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialButtonText(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public CheckBoxDrawable(ICheckBox view)

ICheckBox View { get; }

public override void Draw(ICanvas canvas, RectangleF dirtyRect)
public override void Draw(ICanvas canvas, RectF dirtyRect)
{
DrawMaterialCheckBoxBackground(canvas, dirtyRect);
DrawMaterialCheckBoxMark(canvas, dirtyRect);
Expand Down Expand Up @@ -44,7 +44,7 @@ public override void OnTouchDown(GPoint point)
View.IsChecked = !View.IsChecked;
}

void DrawMaterialCheckBoxBackground(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialCheckBoxBackground(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand Down Expand Up @@ -87,7 +87,7 @@ void DrawMaterialCheckBoxBackground(ICanvas canvas, RectangleF dirtyRect)
canvas.RestoreState();
}

void DrawMaterialCheckBoxMark(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialCheckBoxMark(ICanvas canvas, RectF dirtyRect)
{
if (View.IsChecked)
{
Expand Down Expand Up @@ -115,7 +115,7 @@ void DrawMaterialCheckBoxMark(ICanvas canvas, RectangleF dirtyRect)
}
}

void DrawMaterialCheckBoxText(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialCheckBoxText(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand Down
8 changes: 4 additions & 4 deletions src/Tizen.UIExtensions.Common/GraphicsView/EditorDrawable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ float PlaceholderFontSize
}
}

public override void Draw(ICanvas canvas, RectangleF dirtyRect)
public override void Draw(ICanvas canvas, RectF dirtyRect)
{
DrawMaterialEditorBackground(canvas, dirtyRect);
DrawMaterialEditorBorder(canvas, dirtyRect);
Expand All @@ -67,7 +67,7 @@ public override void OnUnfocused()
AnimateMaterialPlaceholder(false);
}

void DrawMaterialEditorBackground(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialEditorBackground(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand All @@ -87,7 +87,7 @@ void DrawMaterialEditorBackground(ICanvas canvas, RectangleF dirtyRect)
canvas.RestoreState();
}

void DrawMaterialEditorBorder(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialEditorBorder(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand All @@ -114,7 +114,7 @@ void DrawMaterialEditorBorder(ICanvas canvas, RectangleF dirtyRect)
canvas.RestoreState();
}

void DrawMaterialEditorPlaceholder(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialEditorPlaceholder(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand Down
14 changes: 7 additions & 7 deletions src/Tizen.UIExtensions.Common/GraphicsView/EntryDrawable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class EntryDrawable : GraphicsViewDrawable, IAnimatable
float _placeholderY;
float _placeholderFontSize;

RectangleF _indicatorRect;
RectF _indicatorRect;

public EntryDrawable(IEntry view)
{
Expand Down Expand Up @@ -51,7 +51,7 @@ float PlaceholderFontSize
}
}

public override void Draw(ICanvas canvas, RectangleF dirtyRect)
public override void Draw(ICanvas canvas, RectF dirtyRect)
{
DrawMaterialEntryBackground(canvas, dirtyRect);
DrawMaterialEntryBorder(canvas, dirtyRect);
Expand Down Expand Up @@ -82,7 +82,7 @@ public override void OnTouchDown(GPoint point)
View.Text = string.Empty;
}

void DrawMaterialEntryBackground(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialEntryBackground(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand All @@ -100,7 +100,7 @@ void DrawMaterialEntryBackground(ICanvas canvas, RectangleF dirtyRect)
canvas.RestoreState();
}

void DrawMaterialEntryBorder(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialEntryBorder(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand All @@ -124,7 +124,7 @@ void DrawMaterialEntryBorder(ICanvas canvas, RectangleF dirtyRect)
canvas.RestoreState();
}

void DrawMaterialEntryPlaceholder(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialEntryPlaceholder(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand All @@ -151,7 +151,7 @@ void DrawMaterialEntryPlaceholder(ICanvas canvas, RectangleF dirtyRect)
canvas.RestoreState();
}

void DrawMaterialEntryIndicators(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialEntryIndicators(ICanvas canvas, RectF dirtyRect)
{
if (!string.IsNullOrEmpty(View.Text))
{
Expand All @@ -175,7 +175,7 @@ void DrawMaterialEntryIndicators(ICanvas canvas, RectangleF dirtyRect)

canvas.RestoreState();

_indicatorRect = new RectangleF(x - radius, y - radius, radius * 2, radius * 2);
_indicatorRect = new RectF(x - radius, y - radius, radius * 2, radius * 2);

canvas.SaveState();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public abstract class GraphicsViewDrawable : IDrawable, IMeasurable, IDisposable

public bool IsEnabled { get; set; } = true;

public abstract void Draw(ICanvas canvas, RectangleF dirtyRect);
public abstract void Draw(ICanvas canvas, RectF dirtyRect);

public virtual void OnTouchDown(GPoint point) { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public MaterialIconDrawable()
public MaterialIcons Icon { get; set; }
public Color Color { get; set; }

public override void Draw(ICanvas canvas, RectangleF dirtyRect)
public override void Draw(ICanvas canvas, RectF dirtyRect)
{
DrawIcon(canvas, dirtyRect);
}
Expand All @@ -103,7 +103,7 @@ public override TSize Measure(double availableWidth, double availableHeight)
}


void DrawIcon(ICanvas canvas, RectangleF dirtyRect)
void DrawIcon(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public ProgressBarDrawable(IProgressBar view)

IProgressBar View { get; }

public override void Draw(ICanvas canvas, RectangleF dirtyRect)
public override void Draw(ICanvas canvas, RectF dirtyRect)
{
DrawMaterialProgressTrack(canvas, dirtyRect);
DrawMaterialProgressBar(canvas, dirtyRect);
Expand All @@ -26,7 +26,7 @@ public override TSize Measure(double availableWidth, double availableHeight)
return new TSize(availableWidth, MaterialTrackHeight * DeviceInfo.ScalingFactor);
}

void DrawMaterialProgressTrack(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialProgressTrack(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand All @@ -42,7 +42,7 @@ void DrawMaterialProgressTrack(ICanvas canvas, RectangleF dirtyRect)
canvas.RestoreState();
}

void DrawMaterialProgressBar(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialProgressBar(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public Color BackgroundColor
/// Implementation of the IDrawable.Draw() method.
/// This method defines how to draw a refresh icon.
/// </summary>
public override void Draw(ICanvas canvas, RectangleF dirtyRect)
public override void Draw(ICanvas canvas, RectF dirtyRect)
{
DrawRefreshIcon(canvas, dirtyRect);
}
Expand Down Expand Up @@ -99,7 +99,7 @@ void AbortRunningAnimation()
SendInvalidated();
}

void DrawRefreshIcon(ICanvas canvas, RectangleF dirtyRect)
void DrawRefreshIcon(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();
canvas.StrokeSize = StrokeWidth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ public RippleEffectDrawable()
RippleColor = Colors.White;
}

public override void Draw(ICanvas canvas, RectangleF dirtyRect)
public override void Draw(ICanvas canvas, RectF dirtyRect)
{
if ((ClipRectangle == RectangleF.Zero || ClipRectangle.Contains(TouchPoint)) && RippleEffectSize > 0)
if ((ClipRectangle == RectF.Zero || ClipRectangle.Contains(TouchPoint)) && RippleEffectSize > 0)
{
canvas.SaveState();

if (ClipRectangle == RectangleF.Zero)
if (ClipRectangle == RectF.Zero)
ClipRectangle = dirtyRect;

canvas.ClipRectangle(ClipRectangle);
Expand All @@ -41,7 +41,7 @@ public override TSize Measure(double availableWidth, double availableHeight)

public GColor RippleColor { get; set; }

public RectangleF ClipRectangle { get; set; }
public RectF ClipRectangle { get; set; }

public PointF TouchPoint { get; set; }

Expand All @@ -63,14 +63,14 @@ public override void OnTouchDown(GPoint point)

public override void OnTouchUp(GPoint point)
{
if (ClipRectangle == RectangleF.Zero || ClipRectangle.Contains(TouchPoint))
if (ClipRectangle == RectF.Zero || ClipRectangle.Contains(TouchPoint))
AnimateDrawRipple();
}

void AnimateDrawRipple()
{
var from = 0;
var to = ClipRectangle != RectangleF.Zero ? ClipRectangle.Width : 1000;
var to = ClipRectangle != RectF.Zero ? ClipRectangle.Width : 1000;

var thumbSizeAnimation = new Animation(v => RippleEffectSize = (int)v, from, to, easing: Easing.SinInOut);
thumbSizeAnimation.Commit(this, "RippleEffectAnimation", rate:32, length: 350, finished: (l, c) =>
Expand Down
20 changes: 11 additions & 9 deletions src/Tizen.UIExtensions.Common/GraphicsView/SliderDrawable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ public SliderDrawable(ISlider view)

float MaterialFloatThumb { get; set; } = NormalMaterialThumbSize;

public RectangleF ThumbRect { get; set; }
public RectangleF TrackRect { get; set; }
public RectF ThumbRect { get; set; }
public RectF TrackRect { get; set; }

public double ValueRate
{
get
{
return View.Value / View.Maximum;
double start = View.Minimum;
double diff = View.Maximum - View.Minimum;
return (View.Value - start) / diff;
}
set
{
Expand All @@ -39,7 +41,7 @@ public double ValueRate
}
}

public override void Draw(ICanvas canvas, RectangleF dirtyRect)
public override void Draw(ICanvas canvas, RectF dirtyRect)
{
DrawMaterialSliderTrackBackground(canvas, dirtyRect);
DrawMaterialSliderTrackProgress(canvas, dirtyRect);
Expand Down Expand Up @@ -82,7 +84,7 @@ void UpdateValue(GPoint point)
SendInvalidated();
}

void DrawMaterialSliderTrackBackground(ICanvas canvas, RectangleF dirtyRect)
void DrawMaterialSliderTrackBackground(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand All @@ -99,10 +101,10 @@ void DrawMaterialSliderTrackBackground(ICanvas canvas, RectangleF dirtyRect)

canvas.RestoreState();

TrackRect = new RectangleF(x, y, width, height);
TrackRect = new RectF(x, y, width, height);
}

protected virtual void DrawMaterialSliderTrackProgress(ICanvas canvas, RectangleF dirtyRect)
protected virtual void DrawMaterialSliderTrackProgress(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand All @@ -122,7 +124,7 @@ protected virtual void DrawMaterialSliderTrackProgress(ICanvas canvas, Rectangle
canvas.RestoreState();
}

protected virtual void DrawMaterialSliderThumb(ICanvas canvas, RectangleF dirtyRect)
protected virtual void DrawMaterialSliderThumb(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();

Expand All @@ -143,7 +145,7 @@ protected virtual void DrawMaterialSliderThumb(ICanvas canvas, RectangleF dirtyR

canvas.RestoreState();

ThumbRect = new RectangleF(x, y, MaterialFloatThumb, MaterialFloatThumb);
ThumbRect = new RectF(x, y, MaterialFloatThumb, MaterialFloatThumb);
}

public void AnimateMaterialThumbSize(bool increase)
Expand Down
Loading

0 comments on commit d2f9e8b

Please sign in to comment.