Skip to content

Commit

Permalink
XF 3.1 update
Browse files Browse the repository at this point in the history
  • Loading branch information
enisn committed Jul 10, 2018
1 parent 222a896 commit a251a2e
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 186 deletions.
2 changes: 1 addition & 1 deletion InputKit.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

<!-- Dependencies are automatically installed when the package is installed -->
<dependencies>
<dependency id="Xamarin.Forms" version="[3.0.0.482510)" />
<dependency id="Xamarin.Forms" version="3.1.0.583944" />
</dependencies>
</metadata>

Expand Down
3 changes: 1 addition & 2 deletions InputKit/InputKit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@

<ItemGroup>
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.2.0" PrivateAssets="All" />
<!--<PackageReference Include="Xamarin.Forms" Version="2.5.1.444934" PrivateAssets="All" />-->
<PackageReference Include="Xamarin.Forms" Version="2.4.0.282" PrivateAssets="All" />
<PackageReference Include="Xamarin.Forms" Version="3.1.0.583944" PrivateAssets="All" />
<Compile Include="Shared\**\*.cs" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion InputKit/Shared/Controls/CheckBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class CheckBox : StackLayout

Frame boxBackground = new Frame { Padding = 0, InputTransparent = true, HeightRequest = GlobalSetting.Size, WidthRequest = GlobalSetting.Size, BackgroundColor = GlobalSetting.BackgroundColor, MinimumWidthRequest = 35, BorderColor = GlobalSetting.BorderColor, VerticalOptions = LayoutOptions.CenterAndExpand };
BoxView boxSelected = new BoxView { IsVisible = false, HeightRequest = GlobalSetting.Size * .65, WidthRequest = GlobalSetting.Size *.65, Color = GlobalSetting.Color, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.Center };
Label lblSelected = new Label { Text = "✓", FontSize = GlobalSetting.Size * .72, FontAttributes = FontAttributes.Bold, IsVisible = false, TextColor = Color.Accent, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.CenterAndExpand };
Label lblSelected = new Label { Text = "✓", FontSize = GlobalSetting.Size * .72, FontAttributes = FontAttributes.Bold, IsVisible = false, TextColor = GlobalSetting.Color, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.CenterAndExpand };
Label lblOption = new Label { VerticalOptions = LayoutOptions.CenterAndExpand, FontSize = GlobalSetting.FontSize, TextColor = GlobalSetting.TextColor };
private CheckType _type = CheckType.Box;
private bool _isEnabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,15 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.0.0.482510" />
<PackageReference Include="Xamarin.Forms" Version="3.1.0.583944" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="25.4.0.2" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="25.4.0.2" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="25.4.0.2" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="25.4.0.2" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="25.4.0.2" />
<PackageReference Include="Xamarin.Forms.InputKit">
<Version>1.2.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.0.0.482510" />
<PackageReference Include="Xamarin.Forms" Version="3.1.0.583944" />
<PackageReference Include="Xamarin.Forms.InputKit">
<Version>1.2.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
Expand Down
6 changes: 4 additions & 2 deletions Sample.InputKit/Sample.InputKit/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ public App()
{
InitializeComponent();

Plugin.InputKit.Shared.Controls.CheckBox.GlobalSetting.BorderColor = Color.Accent;
Plugin.InputKit.Shared.Controls.CheckBox.GlobalSetting.TextColor = Color.Red;
Plugin.InputKit.Shared.Controls.CheckBox.GlobalSetting.Color = Color.Blue;

MainPage = new NavigationPage(new Sample.InputKit.MainPage());

CheckBox.GlobalSetting.BackgroundColor = Color.WhiteSmoke;
CheckBox.GlobalSetting.Color = Color.BlueViolet;

}

Expand Down
174 changes: 0 additions & 174 deletions Sample.InputKit/Sample.InputKit/CheckBox.cs

This file was deleted.

10 changes: 7 additions & 3 deletions Sample.InputKit/Sample.InputKit/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
<ScrollView>
<StackLayout Spacing="12" Padding="10,0" VerticalOptions="CenterAndExpand">


<local:CheckBox Text="Hello There ! I'm new checkbox"/>

<input:CheckBox Text="ASD" Type="Check"/>
<input:CheckBox Text="ASD 22" Type="Check"/>
<input:CheckBox Text="ASD 333" Type="Check"/>

<!--<local:CheckBox Text="Hello There ! I'm new checkbox"/>
<local:CheckBox Type="Check" Text="Hello There ! I'm new checkbox" BoxBackgroundColor="DimGray" BorderColor="Accent"/>
<local:CheckBox Type="Cross" Text="Hello There ! I'm new checkbox"/>
<local:CheckBox Type="Star" Text="Hello There ! I'm new checkbox"/>
<local:CheckBox Type="Star" Text="Hello There ! I'm new checkbox"/>-->

<input:CheckBox Text="Option 1" Type="Box" IsDisabled="True" />
<input:CheckBox Text="Option 1" Type="Box" IsChecked="True" IsDisabled="True" />
Expand Down
3 changes: 2 additions & 1 deletion Sample.InputKit/Sample.InputKit/Sample.InputKit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.0.0.482510" />
<PackageReference Include="Xamarin.Forms" Version="3.1.0.583944" />
<PackageReference Include="Xamarin.Forms.InputKit" Version="1.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
32 changes: 32 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
----------------After Installation----------------

Go your XAML page and add that xmlns to your <ContentPage tag

xmlns:input="clr-namespace:Plugin.InputKit.Shared.Controls;assembly=Plugin.InputKit"


Then you will be able to use controls easily inside your page like:


<input:CheckBox Text="Option 1" Type="Check" />

------------------------------------------------------------


--------------EASY--DESIGNING----------------

If you want to set all the controls in your app you can use GlobalSettings for this package.
Go your

App.cs

to set default values of controls and set some properties in control which you need. Like below:

Plugin.InputKit.Shared.Controls.CheckBox.GlobalSetting.BorderColor = Color.Red;
Plugin.InputKit.Shared.Controls.CheckBox.GlobalSetting.Size = 36;
Plugin.InputKit.Shared.Controls.RadioButton.GlobalSetting.Color = Color.Red;


...and you'll see all the controls default values changed in entire project.


0 comments on commit a251a2e

Please sign in to comment.