Skip to content

Commit

Permalink
Merge pull request #47 from muak/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
muak authored Aug 24, 2019
2 parents 8aa496f + c7f6548 commit 65f7275
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 11 deletions.
1 change: 1 addition & 0 deletions AiForms.Effects.Droid/AiForms.Effects.Droid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
<Compile Include="FloatingPlatformEffect.cs" />
<Compile Include="PlatformUtility.cs" />
<Compile Include="FloatingLayoutRenderer.cs" />
<Compile Include="Initialize.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
Expand Down
10 changes: 10 additions & 0 deletions AiForms.Effects.Droid/Initialize.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using Android.Runtime;
namespace AiForms.Effects.Droid
{
[Preserve(AllMembers = true)]
public static class Effects
{
public static void Init() { }
}
}
19 changes: 16 additions & 3 deletions README-ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,29 @@ iOSで使用するために、AppDelegate.csに以下のようなコードの追

```csharp
public override bool FinishedLaunching(UIApplication app, NSDictionary options) {

global::Xamarin.Forms.Forms.Init();

AiForms.Effects.iOS.Effects.Init(); //need to write here
LoadApplication(new App(new iOSInitializer()));

return base.FinishedLaunching(app, options);
}
```

### Android プロジェクト

MainActivity.cs に以下のようなコードを追記します。

```csharp
protected override void OnCreate(Bundle bundle) {

base.OnCreate(bundle);

global::Xamarin.Forms.Forms.Init(this, bundle);
AiForms.Effects.Droid.Effects.Init(); //need to write here
...
}
```

## Floating

ページの上の任意の場所に複数のフローティングView (Floating Action Buttonなど) を配置するEffectです。
Expand Down
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,34 @@ You need to install this nuget package to .NETStandard project and each platform

### for iOS project

To use by iOS, you need to write the following code in AppDelegate.cs.
You need to write the following code in AppDelegate.cs:

```csharp
public override bool FinishedLaunching(UIApplication app, NSDictionary options) {

global::Xamarin.Forms.Forms.Init();

AiForms.Effects.iOS.Effects.Init(); //need to write here
LoadApplication(new App(new iOSInitializer()));

...
return base.FinishedLaunching(app, options);
}
```

### for Android project

You need to write the following code in MainActivity.cs:

```csharp
protected override void OnCreate(Bundle bundle) {

base.OnCreate(bundle);

global::Xamarin.Forms.Forms.Init(this, bundle);
AiForms.Effects.Droid.Effects.Init(); //need to write here
...
}
```

## Floating

This is the effect that arranges some floating views (e.g. FAB) at any place on a page.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ protected override void OnCreate(Bundle bundle) {

global::Xamarin.Forms.Forms.SetFlags("FastRenderers_Experimental");
global::Xamarin.Forms.Forms.Init(this, bundle);
AiForms.Effects.Droid.Effects.Init();

Xamarin.Forms.Forms.ViewInitialized += (object sender, Xamarin.Forms.ViewInitializedEventArgs e) => {
if (!string.IsNullOrWhiteSpace(e.View.AutomationId)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ViewCellPageViewModel

public ViewCellPageViewModel(INavigationService navigationService, IPageDialogService pageDlg)
{
for (var i = 0; i < 20;i++){
for (var i = 0; i < 40;i++){
ItemsSource.Add("Name");
}

Expand Down
23 changes: 21 additions & 2 deletions Tests/AiEffects.TestApp/AiEffects.TestApp/Views/ViewCellPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:ef="clr-namespace:AiForms.Effects;assembly=AiForms.Effects"
xmlns:sv="clr-namespace:AiForms.Renderers;assembly=SettingsView"
x:Class="AiEffects.TestApp.Views.ViewCellPage">
<StackLayout Orientation="Vertical">
<Label Text="XYZ" BackgroundColor="Red" HeightRequest="30" VerticalOptions="Start"
Expand All @@ -12,19 +13,37 @@
ef:AlterLineHeight.Multiple="1.5"
ef:SizeToFit.CanExpand="true" />

<ListView ItemsSource="{Binding ItemsSource}" x:Name="listview" VerticalOptions="FillAndExpand">
<!--<ListView ItemsSource="{Binding ItemsSource}" x:Name="listview" VerticalOptions="FillAndExpand">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal">
<Label Text="{Binding}" HorizontalOptions="StartAndExpand" />
<Slider Minimum="0" Maximum="1" Value="0.5" ef:AlterColor.Accent="Red" HorizontalOptions="FillAndExpand" />
<ContentView BackgroundColor="Red" HorizontalOptions="End" WidthRequest="30" HeightRequest="30"
ef:AddCommand.On="true" ef:AddCommand.Command="{Binding BindingContext.TestCommand,Source={x:Reference listview}}" ef:AddCommand.EnableRipple="true"
/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ListView>-->
<sv:SettingsView>
<sv:Section ItemsSource="{Binding ItemsSource}" x:Name="listview">
<sv:Section.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal">
<Label Text="{Binding}" HorizontalOptions="StartAndExpand" />
<Slider Minimum="0" Maximum="1" Value="0.5" ef:AlterColor.Accent="Red" HorizontalOptions="FillAndExpand" />
<ContentView BackgroundColor="Red" HorizontalOptions="End" WidthRequest="30" HeightRequest="30"
ef:AddCommand.On="true" ef:AddCommand.Command="{Binding BindingContext.TestCommand,Source={x:Reference listview}}" ef:AddCommand.EnableRipple="true"
/>
</StackLayout>
</ViewCell>
</DataTemplate>
</sv:Section.ItemTemplate>
</sv:Section>
</sv:SettingsView>
</StackLayout>
</ContentPage>
6 changes: 5 additions & 1 deletion nuget/AzurePipelines.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Xamarin.Forms Effects(add Border / add placeholder / add Text / add Command / add NumberPicker, TimePicker and DatePicker / alter color for switch and slider / alter LineHeight of Label and Editor / Button to flat / Size to fit for Label / add touch events / Floating / Feedback) for iOS / Android</description>
<summary></summary>
<releaseNotes>
<releaseNotes>
## Changes

* Add the Android platform init method.

## Bug fixes

* AlterColor – Slider thumb color isn't changed.
Expand Down

0 comments on commit 65f7275

Please sign in to comment.