//Red button private void InitilizeEditRedFloatButton() { var fabButton = new FabButton { Frame = RootView.Frame, SpaceBetweenMainButtonAndActionItems = 20, ActionItemSpacing = 12 }; var margin = new Margin(8, (int)HeaderView.Frame.Height - 28); var mainButton = CreateMainButton(56, UIColor.FromRGB(245, 1, 87)); fabButton.Initialize(mainButton, FabAligment.TopRight, margin); fabButton.WithDefaultOverlay(UIColor.FromRGBA(0f, 0f, 0f, 0.34f)) .SetOpenDirection(OpenDirections.Bottom); SetActionButtons(fabButton, mainButton.BackgroundColor); fabButton.SetActionButton(new CircleButton { BackgroundColor = UIColor.White, NormalStateImage = UIImage.FromBundle("Close"), Diameter = 46 }); RootView.AddSubview(fabButton); }
public void SetFamily(Family family) { // remove any current members foreach (FamilyMember person in Members) { person.Button.RemoveFromSuperview( ); } Members.Clear( ); Family = family; // create a button for each member foreach (Rock.Client.GroupMember member in Family.FamilyMembers) { FamilyMember newEntry = new FamilyMember( ); newEntry.Button = UIButton.FromType(UIButtonType.System); newEntry.Button.Layer.AnchorPoint = CGPoint.Empty; newEntry.Button.SetTitle(member.Person.NickName, UIControlState.Normal); newEntry.Button.Font = FontManager.GetFont(Settings.General_BoldFont, Config.Instance.VisualSettings.MediumFontSize); newEntry.Button.SizeToFit( ); newEntry.Button.Layer.CornerRadius = 4; newEntry.Button.BackgroundColor = Theme.GetColor(Config.Instance.VisualSettings.SearchResultStyle.BackgroundColor); newEntry.Button.SetTitleColor(Theme.GetColor(Config.Instance.VisualSettings.SearchResultStyle.TextColor), UIControlState.Normal); // give it a ref to the person so if it's clicked, it can provide that person back. newEntry.Member = member; newEntry.Button.TouchUpInside += (object sender, EventArgs e) => { newEntry.Enabled = !newEntry.Enabled; if (newEntry.Enabled == true) { newEntry.Button.BackgroundColor = Theme.GetColor(Config.Instance.VisualSettings.SelectedPersonColor); } else { newEntry.Button.BackgroundColor = Theme.GetColor(Config.Instance.VisualSettings.SearchResultStyle.BackgroundColor); } }; RootView.AddSubview(newEntry.Button); Members.Add(newEntry); } RemoveFromOtherFamiliesToggle.ToggleSide(UIToggle.Toggle.Left); }
private void InitializeYellowEditButton() { var fabButton = new FabButton { Frame = RootView.Frame, SpaceBetweenMainButtonAndActionItems = 20, ActionItemSpacing = 12 }; var mainButton = CreateMainButton(56, UIColor.FromRGB(255, 183, 5)); fabButton.Initialize(mainButton, FabAligment.BottomRight, new Margin(23, 23)); fabButton.SetActionButton(new CircleButton { BackgroundColor = UIColor.White, NormalStateImage = UIImage.FromBundle("Close"), Diameter = 46 }); fabButton.WithDefaultOverlay(UIColor.FromRGBA(0f, 0f, 0f, 0.34f)).SetOpenDirection(OpenDirections.Top); SetActionButtons(fabButton, mainButton.BackgroundColor); RootView.AddSubview(fabButton); }