internal void Parent(ModelItem parent, ModelItem child) { if (this._featureManager == null) { throw new NotSupportedException(string.Format((IFormatProvider)CultureInfo.CurrentCulture, Resources.Error_ParentNotSupported, new object[2] { (object)parent.ItemType.Name, (object)child.ItemType.Name })); } ParentAdapter parentAdapter1 = (ParentAdapter)null; using (IEnumerator <FeatureProvider> enumerator = FeatureExtensions.CreateFeatureProviders(this._featureManager, typeof(ParentAdapter), parent).GetEnumerator()) { if (enumerator.MoveNext()) { ParentAdapter parentAdapter2 = (ParentAdapter)enumerator.Current; ModelItem parent1 = parentAdapter2.RedirectParent(parent, child.ItemType); if (parent1 == null) { throw new InvalidOperationException(string.Format((IFormatProvider)CultureInfo.CurrentCulture, Resources.Error_InvalidRedirectParent, new object[1] { (object)parentAdapter2.GetType().Name })); } if (parent1 != parent) { this.Parent(parent1, child); return; } parentAdapter1 = parentAdapter2; } } if (parentAdapter1 == null || !parentAdapter1.CanParent(parent, child.ItemType)) { throw new NotSupportedException(string.Format((IFormatProvider)CultureInfo.CurrentCulture, Resources.Error_ParentNotSupported, new object[2] { (object)parent.ItemType.Name, (object)child.ItemType.Name })); } ModelItem parent2 = child.Parent; if (parent2 == parent) { return; } if (parent2 != null) { using (IEnumerator <FeatureProvider> enumerator = FeatureExtensions.CreateFeatureProviders(this._featureManager, typeof(ParentAdapter), parent2).GetEnumerator()) { if (enumerator.MoveNext()) { ((ParentAdapter)enumerator.Current).RemoveParent(parent2, parent, child); } } } parentAdapter1.Parent(parent, child); }
internal bool CanParent(ModelItem parent, Type childType, ModelItem childItem, out ModelItem redirectedParent) { redirectedParent = (ModelItem)null; if (this._featureManager == null) { return(false); } using (IEnumerator <FeatureProvider> enumerator = FeatureExtensions.CreateFeatureProviders(this._featureManager, typeof(ParentAdapter), parent).GetEnumerator()) { if (enumerator.MoveNext()) { ParentAdapter parentAdapter = (ParentAdapter)enumerator.Current; redirectedParent = parentAdapter.RedirectParent(parent, childType); if (redirectedParent == null) { throw new InvalidOperationException(string.Format((IFormatProvider)CultureInfo.CurrentCulture, Resources.Error_InvalidRedirectParent, new object[1] { (object)parentAdapter.GetType().Name })); } if (redirectedParent.Equals((object)childItem)) { return(false); } ModelItem modelItem = redirectedParent; ViewItem logicalParent = ModelParent.ItemParentImplementationService.GetLogicalParent(modelItem); if (childItem != null) { for (; logicalParent != (ViewItem)null; logicalParent = ModelParent.ItemParentImplementationService.GetLogicalParent(modelItem)) { if (logicalParent.Equals((object)childItem.View)) { return(false); } modelItem = modelItem.Parent; } } if (childItem != null && parentAdapter.IsParent(redirectedParent, childItem)) { return(true); } if (redirectedParent == parent) { return(parentAdapter.CanParent(parent, childType)); } parent = redirectedParent; return(this.CanParent(parent, childType, childItem, out redirectedParent)); } } return(false); }
public void RegisterAdapters() { /** * 1. Register parent * */ ComponentRegistry.Instance.Register(ParentAdapter.GetInstanceID(), ParentAdapter); /** * 2. Register children * */ foreach (ChildGroup childGroup in Groups) { foreach (ComponentAdapter adapter in childGroup.Adapters) { if (null == adapter) { throw new Exception("Child adapter is null"); } ComponentRegistry.Instance.Register(adapter.GetInstanceID(), adapter); } } }
/// <summary> /// When redirecting the add operation, find the parent to add the new control to. /// </summary> /// <param name="adapterService">Adapter service.</param> /// <param name="parent">The parent item.</param> /// <param name="childType">The type of child item.</param> /// <param name="index">Index of the last child of the parent.</param> /// <returns>The parent to add the new control to.</returns> private static ModelItem FindSuitableParent(AdapterService adapterService, ModelItem parent, Type childType, int index) { ModelItem suitableParent = null; if (adapterService != null) { ParentAdapter parentAdapter = adapterService.GetAdapter <ParentAdapter>(parent.Content.Collection[index].ItemType); Debug.Assert(parentAdapter != null, "Parent Adapter cannot be null"); List <ModelItem> parentList = new List <ModelItem>(); ModelItem targetParent = parent.Content.Collection[index]; ModelItem redirectedParent = parentAdapter.RedirectParent(parent.Content.Collection[index], childType); parentList.Add(targetParent); parentList.Add(redirectedParent); while (redirectedParent != targetParent) { targetParent = redirectedParent; parentAdapter = adapterService.GetAdapter <ParentAdapter>(targetParent.ItemType); Debug.Assert(parentAdapter != null, "Parent Adapter for Redirected Parent cannot be null"); redirectedParent = parentAdapter.RedirectParent(targetParent, childType); if (parentList.Contains(redirectedParent)) { break; // To avoid recursion } else { parentList.Add(redirectedParent); } } if (parentAdapter.CanParent(targetParent, childType)) { suitableParent = targetParent; } } return(suitableParent); }
public GroupListItem(Context context) : base(context) { SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor)); LayoutParameters = new AbsListView.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent); Orientation = Orientation.Vertical; LinearLayout contentLayout = new LinearLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context); contentLayout.LayoutParameters = new LinearLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent); contentLayout.Orientation = Orientation.Horizontal; AddView(contentLayout); TitleLayout = new LinearLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context); TitleLayout.LayoutParameters = new LinearLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent); TitleLayout.Orientation = Orientation.Vertical; ((LinearLayout.LayoutParams)TitleLayout.LayoutParameters).Weight = 1; ((LinearLayout.LayoutParams)TitleLayout.LayoutParameters).Gravity = GravityFlags.CenterVertical; ((LinearLayout.LayoutParams)TitleLayout.LayoutParameters).LeftMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(15); ((LinearLayout.LayoutParams)TitleLayout.LayoutParameters).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(5); ((LinearLayout.LayoutParams)TitleLayout.LayoutParameters).BottomMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(5); contentLayout.AddView(TitleLayout); Title = new TextView(Rock.Mobile.PlatformSpecific.Android.Core.Context); Title.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); Title.SetTypeface(Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(ControlStylingConfig.Font_Bold), TypefaceStyle.Normal); Title.SetTextSize(Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Medium_FontSize); Title.SetSingleLine( ); Title.Ellipsize = Android.Text.TextUtils.TruncateAt.End; Title.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.Label_TextColor)); TitleLayout.AddView(Title); Typeface buttonFontFace = Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(PrivateControlStylingConfig.Icon_Font_Secondary); JoinButton = new Button(Rock.Mobile.PlatformSpecific.Android.Core.Context); JoinButton.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); ((LinearLayout.LayoutParams)JoinButton.LayoutParameters).Weight = 0; ((LinearLayout.LayoutParams)JoinButton.LayoutParameters).Gravity = GravityFlags.CenterVertical; JoinButton.SetTypeface(buttonFontFace, TypefaceStyle.Normal); JoinButton.SetTextSize(Android.Util.ComplexUnitType.Dip, PrivateConnectConfig.GroupFinder_Join_IconSize); JoinButton.Text = PrivateConnectConfig.GroupFinder_JoinIcon; JoinButton.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.TextField_PlaceholderTextColor)); JoinButton.Background = null; JoinButton.FocusableInTouchMode = false; JoinButton.Focusable = false; contentLayout.AddView(JoinButton); JoinButton.Click += (object sender, EventArgs e) => { ParentAdapter.OnClick(Position, 1); }; MeetingTime = new TextView(Rock.Mobile.PlatformSpecific.Android.Core.Context); MeetingTime.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); MeetingTime.SetTypeface(Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(ControlStylingConfig.Font_Light), TypefaceStyle.Normal); MeetingTime.SetTextSize(Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize); MeetingTime.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.Label_TextColor)); TitleLayout.AddView(MeetingTime); Distance = new TextView(Rock.Mobile.PlatformSpecific.Android.Core.Context); Distance.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); Distance.SetTypeface(Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(ControlStylingConfig.Font_Light), TypefaceStyle.Normal); Distance.SetTextSize(Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize); Distance.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.Label_TextColor)); TitleLayout.AddView(Distance); Childcare = new TextView(Rock.Mobile.PlatformSpecific.Android.Core.Context); Childcare.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); Childcare.SetTypeface(Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(ControlStylingConfig.Font_Light), TypefaceStyle.Normal); Childcare.SetTextSize(Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize); Childcare.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.Label_TextColor)); TitleLayout.AddView(Childcare); // add our own custom seperator at the bottom View seperator = new View(Rock.Mobile.PlatformSpecific.Android.Core.Context); seperator.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 0); seperator.LayoutParameters.Height = 2; seperator.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor)); AddView(seperator); }
/// <summary> /// Parent the given control into the TabControl. /// </summary> /// <param name="parent">The new parent item for child.</param> /// <param name="child">The child item.</param> public override void Parent(ModelItem parent, ModelItem child) { if (parent == null) { throw new ArgumentNullException("parent"); } if (child == null) { throw new ArgumentNullException("child"); } // Clear existing property values that we don't want to apply to the new container. child.Properties[MyPlatformTypes.FrameworkElement.MarginProperty].ClearValue(); child.Properties[MyPlatformTypes.FrameworkElement.HorizontalAlignmentProperty].ClearValue(); child.Properties[MyPlatformTypes.FrameworkElement.VerticalAlignmentProperty].ClearValue(); bool childIsTabItem = child.IsItemOfType(MyPlatformTypes.TabItem.TypeId); // We always accept parenting in TabControl if there is not active focused Task. // If the control being pasted is not TabItem and TabControl is empty (doesnt have any TabItem(s) in it) // then we inject a TabItem with Grid in TabControl and paste the control under consideration in TabItem. // We inject a TabItem also in cases when active TabItem is not capable of parenting concerned control if (!childIsTabItem) { // Based on evaluation done in RedirectParent(), // if any control other than TabItem is being parented to Control in this Parent() call // then we need to add a new Tabitem with Grid in it try { ModelItem newTabItem = ModelFactory.CreateItem(parent.Context, MyPlatformTypes.TabItem.TypeId, CreateOptions.InitializeDefaults); parent.Content.Collection.Add(newTabItem); // activate the newly added tabItem TabItemDesignModeValueProvider.SetDesignTimeIsSelected(newTabItem, true); int index = parent.Content.Collection.Count - 1; // Find a suitable parent for control to be pasted. // Since we always accept parenting for TabControl when there is no active focused task, // we better make sure this works. AdapterService adapterService = parent.Context.Services.GetService <AdapterService>(); if (adapterService != null) { ModelItem targetParent = FindSuitableParent(adapterService, parent, child.ItemType, index); if (targetParent != null) { ParentAdapter parentAdapter = adapterService.GetAdapter <ParentAdapter>(targetParent.ItemType); parentAdapter.Parent(targetParent, child); } else { Debug.Assert(targetParent != null, "Parenting failed!"); } } } catch (Exception ex) { throw new InvalidOperationException("Parenting Failed", ex.InnerException); } } else { // child being added is a TabItem; child.Properties[MyPlatformTypes.TabItem.IsSelectedProperty].ClearValue(); parent.Content.Collection.Add(child); TabItemDesignModeValueProvider.SetDesignTimeIsSelected(child, true); // Activate the newly added tabItem } }
public MessageListItem(Context context) : base(context) { SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor)); LayoutParameters = new AbsListView.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent); Orientation = Orientation.Vertical; // Content Layout will hold all the items for this row LinearLayout contentLayout = new LinearLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context); contentLayout.LayoutParameters = new LinearLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent); contentLayout.Orientation = Orientation.Vertical; AddView(contentLayout); // Title Layout holds the title, and the MessageDetailsLayout (which contains date / speaker) TitleLayout = new LinearLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context); TitleLayout.LayoutParameters = new LinearLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent); TitleLayout.Orientation = Orientation.Horizontal; ((LinearLayout.LayoutParams)TitleLayout.LayoutParameters).Weight = 1; ((LinearLayout.LayoutParams)TitleLayout.LayoutParameters).LeftMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(15); ((LinearLayout.LayoutParams)TitleLayout.LayoutParameters).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(15); contentLayout.AddView(TitleLayout); Title = new TextView(Rock.Mobile.PlatformSpecific.Android.Core.Context); Title.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); ((LinearLayout.LayoutParams)Title.LayoutParameters).Gravity = GravityFlags.Top; ((LinearLayout.LayoutParams)Title.LayoutParameters).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(-4); Title.SetTypeface(Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(ControlStylingConfig.Font_Bold), TypefaceStyle.Normal); Title.SetTextSize(Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Medium_FontSize); Title.SetSingleLine( ); Title.Ellipsize = Android.Text.TextUtils.TruncateAt.End; Title.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.Label_TextColor)); TitleLayout.AddView(Title); // This Stores the Date / Speaker MessageDetailsLayout = new LinearLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context); MessageDetailsLayout.LayoutParameters = new LinearLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent); MessageDetailsLayout.Orientation = Orientation.Vertical; ((LinearLayout.LayoutParams)MessageDetailsLayout.LayoutParameters).Weight = 1; ((LinearLayout.LayoutParams)MessageDetailsLayout.LayoutParameters).Gravity = GravityFlags.Right; ((LinearLayout.LayoutParams)MessageDetailsLayout.LayoutParameters).LeftMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(15); ((LinearLayout.LayoutParams)MessageDetailsLayout.LayoutParameters).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(15); ((LinearLayout.LayoutParams)MessageDetailsLayout.LayoutParameters).RightMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(15); TitleLayout.AddView(MessageDetailsLayout); Date = new TextView(Rock.Mobile.PlatformSpecific.Android.Core.Context); Date.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); ((LinearLayout.LayoutParams)Date.LayoutParameters).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(-4); ((LinearLayout.LayoutParams)Date.LayoutParameters).Gravity = GravityFlags.Right; Date.SetTypeface(Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(ControlStylingConfig.Font_Regular), TypefaceStyle.Normal); Date.SetTextSize(Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize); Date.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.TextField_PlaceholderTextColor)); MessageDetailsLayout.AddView(Date); Speaker = new TextView(Rock.Mobile.PlatformSpecific.Android.Core.Context); Speaker.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); ((LinearLayout.LayoutParams)Speaker.LayoutParameters).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(-4); ((LinearLayout.LayoutParams)Speaker.LayoutParameters).Gravity = GravityFlags.Right; Speaker.SetTypeface(Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(ControlStylingConfig.Font_Regular), TypefaceStyle.Normal); Speaker.SetTextSize(Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize); Speaker.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.TextField_PlaceholderTextColor)); Speaker.SetMaxLines(1); MessageDetailsLayout.AddView(Speaker); // add our own custom seperator at the bottom View seperator = new View(Rock.Mobile.PlatformSpecific.Android.Core.Context); seperator.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 0); seperator.LayoutParameters.Height = 2; seperator.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor)); AddView(seperator); // setup the buttons LinearLayout buttonLayout = new LinearLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context); buttonLayout.LayoutParameters = new LinearLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent); ((LinearLayout.LayoutParams)buttonLayout.LayoutParameters).Weight = 1; buttonLayout.Orientation = Orientation.Horizontal; contentLayout.AddView(buttonLayout); Typeface buttonFontFace = Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(PrivateControlStylingConfig.Icon_Font_Secondary); ListenButton = new Button(Rock.Mobile.PlatformSpecific.Android.Core.Context); ListenButton.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); ((LinearLayout.LayoutParams)ListenButton.LayoutParameters).RightMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(-10); ListenButton.SetTypeface(buttonFontFace, TypefaceStyle.Normal); ListenButton.SetTextSize(Android.Util.ComplexUnitType.Dip, PrivateNoteConfig.Details_Table_IconSize); ListenButton.Text = PrivateNoteConfig.Series_Table_Listen_Icon; ListenButton.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(NoteConfig.Details_Table_IconColor)); ListenButton.Background = null; buttonLayout.AddView(ListenButton); WatchButton = new Button(Rock.Mobile.PlatformSpecific.Android.Core.Context); WatchButton.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); ((LinearLayout.LayoutParams)WatchButton.LayoutParameters).RightMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(-10); WatchButton.SetTypeface(buttonFontFace, TypefaceStyle.Normal); WatchButton.SetTextSize(Android.Util.ComplexUnitType.Dip, PrivateNoteConfig.Details_Table_IconSize); WatchButton.Text = PrivateNoteConfig.Series_Table_Watch_Icon; WatchButton.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(NoteConfig.Details_Table_IconColor)); WatchButton.Background = null; buttonLayout.AddView(WatchButton); DiscussionGuideButton = new Button(Rock.Mobile.PlatformSpecific.Android.Core.Context); DiscussionGuideButton.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); ((LinearLayout.LayoutParams)DiscussionGuideButton.LayoutParameters).RightMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(-10); DiscussionGuideButton.SetTypeface(buttonFontFace, TypefaceStyle.Normal); DiscussionGuideButton.SetTextSize(Android.Util.ComplexUnitType.Dip, PrivateNoteConfig.Details_Table_IconSize); DiscussionGuideButton.Text = PrivateNoteConfig.Series_Table_DiscussionGuide_Icon; DiscussionGuideButton.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(NoteConfig.Details_Table_IconColor)); DiscussionGuideButton.Background = null; buttonLayout.AddView(DiscussionGuideButton); TakeNotesButton = new Button(Rock.Mobile.PlatformSpecific.Android.Core.Context); TakeNotesButton.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); ((LinearLayout.LayoutParams)TakeNotesButton.LayoutParameters).RightMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(-10); TakeNotesButton.SetTypeface(buttonFontFace, TypefaceStyle.Normal); TakeNotesButton.SetTextSize(Android.Util.ComplexUnitType.Dip, PrivateNoteConfig.Details_Table_IconSize); TakeNotesButton.Text = PrivateNoteConfig.Series_Table_TakeNotes_Icon; TakeNotesButton.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(NoteConfig.Details_Table_IconColor)); TakeNotesButton.Background = null; buttonLayout.AddView(TakeNotesButton); ListenButton.Click += (object sender, EventArgs e) => { ParentAdapter.OnClick(Position, 0); }; WatchButton.Click += (object sender, EventArgs e) => { ParentAdapter.OnClick(Position, 1); }; TakeNotesButton.Click += (object sender, EventArgs e) => { ParentAdapter.OnClick(Position, 2); }; DiscussionGuideButton.Click += (object sender, EventArgs e) => { ParentAdapter.OnClick(Position, 3); }; }