Skip to content

Commit 6d6c336

Browse files
authored
Merge pull request #277 from enisn/xf-v4-adaptation
XF Drawing adaptation
2 parents 1977426 + 6eadc90 commit 6d6c336

File tree

11 files changed

+317
-202
lines changed

11 files changed

+317
-202
lines changed

sandbox/SandboxMAUI/Pages/CheckBoxPage.xaml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using Microsoft.Maui.Controls;
3-
using Microsoft.Maui.Graphics;
1+
using InputKit.Shared.Helpers;
42
using CheckBox = InputKit.Shared.Controls.CheckBox;
53

64
namespace SandboxMAUI.Pages;
@@ -27,6 +25,7 @@ private void Button_Clicked(object sender, EventArgs e)
2725
if(sender is Button button)
2826
{
2927
button.BackgroundColor = color;
28+
button.TextColor = color.ToSurfaceColor();
3029
}
3130
}
3231
}

sandbox/SandboxXF/SandboxXF.Android/Resources/Resource.designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sandbox/SandboxXF/SandboxXF/Views/CheckBoxesPage.xaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@
1111
Padding="25"
1212
Spacing="15">
1313

14-
<input:CheckBox Text="Option 0 with Box Type" Type="Box" LabelPosition="After"/>
15-
<input:CheckBox Text="Option 1 with Check Type" Type="Check"/>
16-
<input:CheckBox Text="Option 2 wity Cross Type" Type="Cross"/>
17-
<input:CheckBox Text="Option 3 with Custom Type" Type="Custom" CustomIcon="ic_account_balance_black"/>
18-
<input:CheckBox Text="Option 4 with Material Type" Type="Material"/>
19-
<input:CheckBox Text="Option 5 with Star Type" Type="Star"/>
20-
<input:CheckBox Text="Option 6 (Position)" Type="Check" LabelPosition="Before"/>
14+
<Button Text="Randomize colors" Clicked="Button_Clicked" />
15+
<BoxView Color="{AppThemeBinding Dark=White, Light=Black}" HeightRequest="1" HorizontalOptions="Fill" Margin="5,10" />
16+
17+
<input:CheckBox Text="Option 0 Plain Checkbox" />
18+
<input:CheckBox Text="Option 1 with Filled Type" Type="Filled" />
19+
<input:CheckBox Text="Option 2 with Material Type" Type="Material" />
20+
<input:CheckBox Text="Option 2 with Square Shape" IconGeometry="{x:Static input:PredefinedShapes.Square}" />
21+
<input:CheckBox Text="Option 3 with Line Shape" IconGeometry="{x:Static input:PredefinedShapes.Line}" />
22+
<input:CheckBox Text="Option 3 with Line Shape with Material Type" Type="Material" IconGeometry="{x:Static input:PredefinedShapes.Line}" />
23+
<input:CheckBox Text="Option 3 with Custom Type (X)" Type="Custom" IconGeometry="M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z"/>
24+
<input:CheckBox Text="Option 5 with Material Custom Type (X)" Type="Material" IconGeometry="M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z"/>
25+
<input:CheckBox Text="Option 6 (Position)" Type="Regular" LabelPosition="Before"/>
2126

2227
</StackLayout>
2328

sandbox/SandboxXF/SandboxXF/Views/CheckBoxesPage.xaml.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using Plugin.InputKit.Shared.Helpers;
2+
using System;
23

34
using Xamarin.Forms;
45
using Xamarin.Forms.Xaml;
@@ -7,12 +8,12 @@
78
namespace SandboxXF.Views
89
{
910
[XamlCompilation(XamlCompilationOptions.Compile)]
10-
public partial class CheckBoxesPage : ContentPage
11-
{
11+
public partial class CheckBoxesPage : ContentPage
12+
{
1213
static readonly Random rnd = new Random();
13-
public CheckBoxesPage()
14-
{
15-
InitializeComponent ();
14+
public CheckBoxesPage()
15+
{
16+
InitializeComponent();
1617
}
1718

1819
private void Button_Clicked(object sender, EventArgs e)
@@ -26,6 +27,12 @@ private void Button_Clicked(object sender, EventArgs e)
2627
chk.Color = color;
2728
}
2829
}
30+
31+
if (sender is Button button)
32+
{
33+
button.BackgroundColor = color;
34+
button.TextColor = color.ToSurfaceColor();
35+
}
2936
}
3037
}
3138
}

0 commit comments

Comments
 (0)