public TaskListFragment(ProjectModel project, string listName) { this.project = project; this.listName = listName; BackgroundColor = Color.White; var template = new DataTemplate(typeof(TextCell)); template.SetBinding(TextCell.TextProperty, "Title"); list = new ListView { ItemsSource = project.GetList(listName), SeparatorColor = Color.Gray, ItemTemplate = template }; list.ItemSelected += async(sender, e) => await TaskSelected(sender as ListView); list.RefreshCommand = new Command(() => RefreshList()); Content.AddView(list, 0, 0, 1, 1); var addTaskButton = ButtonFactory.Make("+"); addTaskButton.TextColor = Color.White; addTaskButton.Clicked += async(sender, e) => await AddTask(); Content.AddView(addTaskButton, 0.5, -75, 50, 50); }
public ProjectListPage() { Title = "My Projects"; NavigationPage.SetTitleIcon(this, "bar_icon"); BackgroundColor = Color.White; var template = new DataTemplate(typeof(TextCell)); template.SetBinding(TextCell.TextProperty, "Name"); list = new ListView { ItemsSource = App.User.Projects, SeparatorColor = Color.Gray, ItemTemplate = template }; list.ItemSelected += async(sender, e) => await ProjectSelected(sender as ListView); list.RefreshCommand = new Command(() => RefreshList()); Content.AddView(list, 0, 0, 1, 1); leaveProjectButton = ButtonFactory.Make("-"); leaveProjectButton.TextColor = Color.White; leaveProjectButton.Clicked += (sender, e) => LeaveProjectPressed(); Content.AddView(leaveProjectButton, 0.4, -75, 50, 50); addProjectButton = ButtonFactory.Make("+"); addProjectButton.TextColor = Color.White; addProjectButton.Clicked += async(sender, e) => await ShowProjectForm(); Content.AddView(addProjectButton, 0.6, -75, 50, 50); }
public TaskMemberForm(ProjectModel project, TaskModel task) : base() { AddView(new BoxView { BackgroundColor = Color.Green }); var form = new StackLayout { Padding = new Thickness(15) }; var title = new Label { Text = "ADD MEMBER", VerticalOptions = LayoutOptions.Center, FontAttributes = FontAttributes.Bold, FontSize = 25 }; form.Children.Add(title); TableSection members; var table = new TableView { Intent = TableIntent.Form, Root = new TableRoot() { (members = new TableSection() { }) } }; var list = new List <UserModel> (project.Members); foreach (var m in task.Members) { list.Remove(m); } foreach (var m in list) { members.Add(new TextCell { Text = m.Email, Command = new Command(() => SelectMember(m)) }); } form.Children.Add(table); var buttons = new BaseRelativeLayout(); var cancelButton = ButtonFactory.Make("Cancel"); cancelButton.HorizontalOptions = LayoutOptions.CenterAndExpand; cancelButton.Clicked += (sender, e) => Cancel(); buttons.AddView(cancelButton, 0.5, 0, 0.47, 40); form.Children.Add(buttons); AddView(form); }
public TaskForm() : base() { AddView(new BoxView { BackgroundColor = Color.Green }); var form = new StackLayout { Padding = new Thickness(15) }; var title = new Label { Text = "CREATE TASK", VerticalOptions = LayoutOptions.Center, FontAttributes = FontAttributes.Bold, FontSize = 25 }; form.Children.Add(title); var fields = new StackLayout { Padding = new Thickness(15, 7), VerticalOptions = LayoutOptions.CenterAndExpand }; titleEntry = new Entry { Placeholder = "Title", Keyboard = Keyboard.Create(KeyboardFlags.CapitalizeSentence) }; descriptionEntry = new Entry { Placeholder = "Description" }; titleEntry.Completed += (sender, e) => descriptionEntry.Focus(); descriptionEntry.Completed += (sender, e) => Submit(); fields.Children.Add(titleEntry); fields.Children.Add(descriptionEntry); form.Children.Add(fields); var buttons = new BaseRelativeLayout(); var cancelButton = ButtonFactory.Make("Cancel"); cancelButton.HorizontalOptions = LayoutOptions.CenterAndExpand; cancelButton.Clicked += (sender, e) => Cancel(); buttons.AddView(cancelButton, 0.25, 0, 0.47, 40); var submitButton = ButtonFactory.Make("Create"); submitButton.HorizontalOptions = LayoutOptions.CenterAndExpand; submitButton.Clicked += (sender, e) => Submit(); buttons.AddView(submitButton, 0.75, 0, 0.47, 40); form.Children.Add(buttons); AddView(form); }
public LoginForm() : base() { AddView(new BoxView { BackgroundColor = Color.Green }); var form = new StackLayout { Padding = new Thickness(15) }; var title = new Label { Text = "LOG IN", VerticalOptions = LayoutOptions.Center, FontAttributes = FontAttributes.Bold, FontSize = 25 }; form.Children.Add(title); var fields = new StackLayout { Padding = new Thickness(15, 7), VerticalOptions = LayoutOptions.CenterAndExpand }; emailEntry = new Entry { Placeholder = "email", Keyboard = Keyboard.Email }; passwordEntry = new Entry { Placeholder = "password", IsPassword = true }; emailEntry.Completed += (sender, e) => passwordEntry.Focus(); passwordEntry.Completed += (sender, e) => Submit(); fields.Children.Add(emailEntry); fields.Children.Add(passwordEntry); form.Children.Add(fields); var buttons = new BaseRelativeLayout(); var cancelButton = ButtonFactory.Make("Cancel"); cancelButton.HorizontalOptions = LayoutOptions.CenterAndExpand; cancelButton.Clicked += (sender, e) => Cancel(); buttons.AddView(cancelButton, 0.25, 0, 0.47, 40); var submitButton = ButtonFactory.Make("Log in"); submitButton.HorizontalOptions = LayoutOptions.CenterAndExpand; submitButton.Clicked += (sender, e) => Submit(); buttons.AddView(submitButton, 0.75, 0, 0.47, 40); form.Children.Add(buttons); AddView(form); }
public InvitationForm(ProjectModel project) : base() { AddView(new BoxView { BackgroundColor = Color.Green }); var form = new StackLayout { Padding = new Thickness(15) }; var title = new Label { Text = "INVITE USER TO " + project.Name, VerticalOptions = LayoutOptions.Center, FontAttributes = FontAttributes.Bold, FontSize = 25 }; form.Children.Add(title); var fields = new StackLayout { Padding = new Thickness(15, 7), VerticalOptions = LayoutOptions.CenterAndExpand }; emailEntry = new Entry { Placeholder = "Email", Keyboard = Keyboard.Email }; emailEntry.Completed += (sender, e) => Submit(); fields.Children.Add(emailEntry); form.Children.Add(fields); var buttons = new BaseRelativeLayout(); var cancelButton = ButtonFactory.Make("Cancel"); cancelButton.HorizontalOptions = LayoutOptions.CenterAndExpand; cancelButton.Clicked += (sender, e) => Cancel(); buttons.AddView(cancelButton, 0.25, 0, 0.47, 40); var submitButton = ButtonFactory.Make("Invite"); submitButton.HorizontalOptions = LayoutOptions.CenterAndExpand; submitButton.Clicked += (sender, e) => Submit(); buttons.AddView(submitButton, 0.75, 0, 0.47, 40); form.Children.Add(buttons); AddView(form); }
public LandingPage() { NavigationPage.SetHasNavigationBar(this, false); BackgroundImage = "landing_bg"; var buttonGroup = new StackLayout { Orientation = StackOrientation.Vertical, WidthRequest = 200 }; var loginButton = ButtonFactory.Make("Login"); loginButton.Clicked += async(sender, e) => await ShowLogin(); buttonGroup.Children.Add(loginButton); var regButton = ButtonFactory.Make("Register"); regButton.Clicked += async(sender, e) => await ShowRegister(); buttonGroup.Children.Add(regButton); Content.AddView(buttonGroup, 0.5, 0.75, 200); }