From 02e5fc613d6cbc2a83a6fbd1b54c1e68dfc9d796 Mon Sep 17 00:00:00 2001 From: Satoshi Nakamura Date: Thu, 26 Dec 2019 12:47:34 +0900 Subject: [PATCH 1/5] Fix #48 --- AiForms.Effects.Droid/AddTextPlatformEffect.cs | 10 +++++++--- nuget/AzurePipelines.nuspec | 3 +-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/AiForms.Effects.Droid/AddTextPlatformEffect.cs b/AiForms.Effects.Droid/AddTextPlatformEffect.cs index b185950..1854fbe 100644 --- a/AiForms.Effects.Droid/AddTextPlatformEffect.cs +++ b/AiForms.Effects.Droid/AddTextPlatformEffect.cs @@ -6,6 +6,7 @@ using Xamarin.Forms.Platform.Android; using System; using Android.Content; +using System.Threading.Tasks; [assembly: ExportEffect(typeof(AddTextPlatformEffect), nameof(AddText))] namespace AiForms.Effects.Droid @@ -162,11 +163,12 @@ static void UpdateLayout(TextView textview, Element element, Android.Views.View var textpaint = textview.Paint; var rect = new Android.Graphics.Rect(); - textpaint.GetTextBounds(textview.Text, 0, textview.Text.Length, rect); + //textpaint.GetTextBounds(textview.Text, 0, textview.Text.Length, rect); // GetTextBound.Width is sometimes a little small less than actual width. + var textWidth = (int)textpaint.MeasureText(textview.Text); var xPos = 0; if (AddText.GetHorizontalAlign(element) == Xamarin.Forms.TextAlignment.End) { - xPos = v.Width - rect.Width() - textview.PaddingLeft - textview.PaddingRight - (int)margin.Right - 4; + xPos = v.Width - textWidth - textview.PaddingLeft - textview.PaddingRight - (int)margin.Right - 4; if (xPos < (int)margin.Left) { xPos = (int)margin.Left; } @@ -174,7 +176,7 @@ static void UpdateLayout(TextView textview, Element element, Android.Views.View } else { xPos = (int)margin.Left; - textview.Right = (int)margin.Left + rect.Width() + textview.PaddingLeft + textview.PaddingRight + 4; + textview.Right = (int)margin.Left + textWidth + textview.PaddingLeft + textview.PaddingRight + 4; if (textview.Right >= v.Width) { textview.Right = v.Width - (int)margin.Right; } @@ -189,6 +191,8 @@ static void UpdateLayout(TextView textview, Element element, Android.Views.View textview.Top = yPos; textview.Bottom = yPos + height; + + textview.Text = textview.Text; // HACK: For some reason, Invalidate is not work. Use reassign text instead of. } internal class ContainerOnLayoutChangeListener : Java.Lang.Object, Android.Views.View.IOnLayoutChangeListener diff --git a/nuget/AzurePipelines.nuspec b/nuget/AzurePipelines.nuspec index ce9ee7a..1a08eff 100644 --- a/nuget/AzurePipelines.nuspec +++ b/nuget/AzurePipelines.nuspec @@ -15,11 +15,10 @@ ## Changes -* Add the Android platform init method. ## Bug fixes -* AlterColor – Slider thumb color isn't changed. +* AddText – Fixed the end of characters is sometimes omitted. Xamarin.Forms Effects Command NumberPikcer LineHeight LineSpacing FlatButton Validation SoundEffect Border TimePicker DatePicker Placeholder Color SizeToFit TouchEvents Floating en-US From afb082f957de0d0c0f64800309755735ae5a88aa Mon Sep 17 00:00:00 2001 From: Satoshi Nakamura Date: Thu, 26 Dec 2019 12:53:27 +0900 Subject: [PATCH 2/5] Apply #49 null check --- AiForms.Effects.Droid/FeedbackPlatformEffect.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AiForms.Effects.Droid/FeedbackPlatformEffect.cs b/AiForms.Effects.Droid/FeedbackPlatformEffect.cs index 3aadf41..6217af9 100644 --- a/AiForms.Effects.Droid/FeedbackPlatformEffect.cs +++ b/AiForms.Effects.Droid/FeedbackPlatformEffect.cs @@ -142,7 +142,7 @@ void OnOverlayTouch(object sender, Android.Views.View.TouchEventArgs e) PlaySound(); } - _view.DispatchTouchEvent(e.Event); + _view?.DispatchTouchEvent(e.Event); e.Handled = false; } From 328f40bdebdbb76ff3b0204e9e08167b73199b7c Mon Sep 17 00:00:00 2001 From: Satoshi Nakamura Date: Thu, 26 Dec 2019 13:31:15 +0900 Subject: [PATCH 3/5] Apply #50 Button PlaySound on Android --- AiForms.Effects.Droid/FeedbackPlatformEffect.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AiForms.Effects.Droid/FeedbackPlatformEffect.cs b/AiForms.Effects.Droid/FeedbackPlatformEffect.cs index 6217af9..53b8fd2 100644 --- a/AiForms.Effects.Droid/FeedbackPlatformEffect.cs +++ b/AiForms.Effects.Droid/FeedbackPlatformEffect.cs @@ -28,7 +28,11 @@ public class FeedbackPlatformEffect:AiEffectBase typeof(Xamarin.Forms.AbsoluteLayout), typeof(Grid), typeof(Xamarin.Forms.RelativeLayout), - typeof(StackLayout) + typeof(StackLayout), + typeof(Xamarin.Forms.Button), + typeof(Xamarin.Forms.Image), + typeof(Xamarin.Forms.BoxView), + typeof(Xamarin.Forms.Label), }; private Android.Views.View _view; From 6fa42224124361487694324045949bb2829e01b7 Mon Sep 17 00:00:00 2001 From: Satoshi Nakamura Date: Thu, 26 Dec 2019 13:45:12 +0900 Subject: [PATCH 4/5] nuspec --- nuget/AzurePipelines.nuspec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nuget/AzurePipelines.nuspec b/nuget/AzurePipelines.nuspec index 1a08eff..88d0621 100644 --- a/nuget/AzurePipelines.nuspec +++ b/nuget/AzurePipelines.nuspec @@ -15,10 +15,13 @@ ## Changes +* Feedback – On Android, a button is now ringed a sound. #50 ## Bug fixes -* AddText – Fixed the end of characters is sometimes omitted. +* AddText – Fixed the end of characters is sometimes omitted #48. +* Feedback – Fixed Android OnOverlayTouch crash #49. + Xamarin.Forms Effects Command NumberPikcer LineHeight LineSpacing FlatButton Validation SoundEffect Border TimePicker DatePicker Placeholder Color SizeToFit TouchEvents Floating en-US From 93a6bb39b0f5b1264f2d8861833e4b192fe0ac32 Mon Sep 17 00:00:00 2001 From: Satoshi Nakamura Date: Thu, 26 Dec 2019 13:53:50 +0900 Subject: [PATCH 5/5] ReadMe --- README-ja.md | 15 +++++++++++++++ README.md | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/README-ja.md b/README-ja.md index 6f647d1..6ed46c8 100644 --- a/README-ja.md +++ b/README-ja.md @@ -744,6 +744,21 @@ viewをタップするとPickerが表示され、日付を選択すると、そ * [yuka-abn](https://github.com/yuka-abn) * [gentledepp](https://github.com/gentledepp) +## 寄付 + +開発継続のため、寄付を募集しています。 + +寄付をいただけるとやる気が非常にアップしますので、どうかよろしくお願いいたします🙇 + +* [PayPalMe](https://paypal.me/kamusoftJP?locale.x=ja_JP) + +## スポンサー + +スポンサーも募集しています。 +こちらはサブスクリプション制になります。 + +* [GitHub Sponsors](https://github.com/sponsors/muak) + ## License MIT Licensed. diff --git a/README.md b/README.md index d38eebc..3375dbd 100644 --- a/README.md +++ b/README.md @@ -768,6 +768,22 @@ This effect supports Editor only. * [yuka-abn](https://github.com/yuka-abn) * [gentledepp](https://github.com/gentledepp) +## Donation + +I am asking for your donation for continuous development🙇 + +Your donation will allow me to work harder and harder. + +* [PayPalMe](https://paypal.me/kamusoftJP?locale.x=ja_JP) + + +## Sponsors + +I am asking for sponsors too. +This is a subscription. + +* [GitHub Sponsors](https://github.com/sponsors/muak) + ## License MIT Licensed.