From: Durgesh Khandal Date: Wed, 30 Oct 2019 12:33:05 +0000 (+0530) Subject: Fixed - 5830 - Updated access modifier for EntryCellTableViewCell (#8286) fixes ... X-Git-Tag: accepted/tizen/5.5/unified/20200421.150457~106 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=663abfad668f6e39e28462e2f653fcba63e3e927;p=platform%2Fcore%2Fcsapi%2Fxsf.git Fixed - 5830 - Updated access modifier for EntryCellTableViewCell (#8286) fixes #5830 --- diff --git a/Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs b/Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs index 5e0e59a..962f71b 100644 --- a/Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs +++ b/Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs @@ -24,6 +24,7 @@ using RectangleF = CoreGraphics.CGRect; [assembly: ExportRenderer(typeof(Bugzilla52700.NoSelectionViewCell), typeof(NoSelectionViewCellRenderer))] [assembly: ExportRenderer(typeof(Issue1683.EntryKeyboardFlags), typeof(EntryRendererKeyboardFlags))] [assembly: ExportRenderer(typeof(Issue1683.EditorKeyboardFlags), typeof(EditorRendererKeyboardFlags))] +[assembly: ExportRenderer(typeof(Issue5830.ExtendedEntryCell), typeof(ExtendedEntryCellRenderer))] namespace Xamarin.Forms.ControlGallery.iOS { @@ -691,5 +692,25 @@ namespace Xamarin.Forms.ControlGallery.iOS } } + public class ExtendedEntryCellRenderer : EntryCellRenderer + { + public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv) + { + var entryCell = (EntryCell)item; + var cell = base.GetCell(item, reusableCell, tv); + if (cell != null && entryCell != null) + { + var tvc = cell as EntryCellTableViewCell; + if (tvc != null) + { + // cell.TextField.thingstocallhere, for example: + tvc.TextField.Text = entryCell.Text; + tvc.TextField.TextColor = UIColor.Red; + } + } + return cell; + } + } + } diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue5830.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue5830.cs new file mode 100644 index 0000000..831cb6c --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue5830.cs @@ -0,0 +1,56 @@ +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; +using System.Linq; +using System.Collections.ObjectModel; + +#if UITEST +using Xamarin.Forms.Core.UITests; +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 5830, "[Enhancement] EntryCellTableViewCell should be public", PlatformAffected.iOS)] + public class Issue5830 : TestContentPage + { + const string Instructions = "On iOS, if the below Entry Cell displays 'Text from Custom Entry Cell' in 'Red' color, this test has passed."; + ListView lstView; + + public class ExtendedEntryCell : EntryCell + { + public ExtendedEntryCell() + { + base.Text = "Text from Custom Entry Cell"; + } + } + + protected override void Init() + { + var label = new Label { Text = Instructions }; + lstView = new ListView(ListViewCachingStrategy.RecycleElement) + { + ItemTemplate = new DataTemplate(typeof(ExtendedEntryCell)), + ItemsSource = new[] { "item1" } + }; + + Content = new StackLayout + { + Children = { + label, + lstView + } + }; + } + +#if (UITEST && __IOS__) + [Test] + [Category(UITestCategories.ManualReview)] + public void Issue5830Test() + { + RunningApp.Screenshot("EntryTableViewCell Test with custom Text and TextColor"); + } +#endif + } +} \ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index 25b4377..9a157ae 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -21,6 +21,7 @@ + diff --git a/Xamarin.Forms.Platform.iOS/Cells/EntryCellRenderer.cs b/Xamarin.Forms.Platform.iOS/Cells/EntryCellRenderer.cs index ed23df7..870a9a5 100644 --- a/Xamarin.Forms.Platform.iOS/Cells/EntryCellRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Cells/EntryCellRenderer.cs @@ -125,7 +125,7 @@ namespace Xamarin.Forms.Platform.iOS cell.TextField.Text = entryCell.Text; } - class EntryCellTableViewCell : CellTableViewCell + public class EntryCellTableViewCell : CellTableViewCell { public EntryCellTableViewCell(string cellName) : base(UITableViewCellStyle.Value1, cellName) {