public void AddPrevFields(string title, string value) { var field = new Spinner(this.Context); var titleField = new TextView(this.Context); titleField.SetPadding(15, 20, 15, 20); titleField.SetTextColor(Color.White); titleField.TextSize = 14; titleField.SetText(title, TextView.BufferType.Normal); var adapter = new SpinAdapter(this.Activity, new List <string> { value }); field.Adapter = adapter; fieldsLayout.AddView(titleField); fieldsLayout.AddView(field); }
public void ShowAvailableCars(List <string> cars) { var carCount = fieldsLayout.FindViewWithTag("carListCount") as TextView; if (carCount == null) { var titleField = new TextView(this.Context); titleField.Tag = "carListCount"; titleField.SetPadding(15, 20, 15, 20); titleField.SetTextColor(Color.White); titleField.TextSize = 14; titleField.SetText("Найдено автомобилей: " + cars.Count, TextView.BufferType.Normal); fieldsLayout.AddView(titleField); } else { carCount.Text = "Найдено автомобилей: " + cars.Count; } var carList = fieldsLayout.FindViewWithTag("carListView") as Spinner; if (carList == null) { var field = new Spinner(this.Context); field.Tag = "carListView"; var adapter = new SpinAdapter(this.Activity, cars); field.Adapter = adapter; field.ItemSelected += (s, e) => { }; //field.ItemClick += (s, e) => // { // e.Position // }; fieldsLayout.AddView(field); } else { carList.Adapter = new SpinAdapter(this.Activity, cars); } }
public void AddCurrentFields(string title, List <string> values, List <string> ssd) { var field = new Spinner(this.Context); var titleField = new TextView(this.Context); titleField.SetPadding(15, 20, 15, 20); titleField.SetTextColor(Color.White); titleField.TextSize = 14; titleField.SetText(title, TextView.BufferType.Normal); var adapter = new SpinAdapter(this.Activity, values, ssd); field.Adapter = adapter; field.ItemSelected += (s, e) => { if (e.Position != 0) { var selectedSSD = ((s as Spinner).Adapter as SpinAdapter).ssd[e.Position - 1]; presenter.SSD = selectedSSD; presenter.SelectionStep(); } }; fieldsLayout.AddView(titleField); fieldsLayout.AddView(field); }