protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); ScrollView scrollView = new ScrollView(this); TableLayout tableLayout = new TableLayout(this); TableRow tablerow = new TableRow(this); // make columns span the whole width tableLayout.SetColumnStretchable(0, true); tableLayout.SetColumnStretchable(1, true); TextView DepartCollumn = new TextView(this); DepartCollumn.Text = "Depart"; tablerow.AddView(DepartCollumn); TimetableList.TimeColumns.Add(DepartCollumn); TextView ArriveCollumn = new TextView(this); ArriveCollumn.Text = "Arrive"; tablerow.AddView(ArriveCollumn); TimetableList.TimeColumns.Add(ArriveCollumn); tableLayout.AddView(tablerow); // tableLayout.SetScrollContainer(true); scrollView.AddView(tableLayout); SetContentView(scrollView); }
private void ParseData(string JSONString) { JObject jsonResult = JObject.Parse(JSONString); //Добавляем таблицу в интерфейс TableLayout mTableLayout = new TableLayout(this); var param = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); mTableLayout.SetColumnStretchable(1, true); mTableLayout.SetColumnShrinkable(1, true); mLinearLayout.AddView(mTableLayout, param); foreach (JObject Element in jsonResult["Data"]) { CreatElement(Element, mTableLayout); } }
void BuildUI() { var hmargin = 12; var content = new LinearLayout(this) { Orientation = Orientation.Vertical, }; var scroller = new ScrollView(this) { }; scroller.AddView(content); SetContentView(scroller); // // Fields // var fields = new TableLayout(this) { LayoutParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent) { TopMargin = 12, LeftMargin = hmargin, RightMargin = hmargin, }, }; fields.SetColumnStretchable(1, true); foreach (var f in state.Authenticator.Fields) { var row = new TableRow(this); var label = new TextView(this) { Text = f.Title, LayoutParameters = new TableRow.LayoutParams(LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent) { RightMargin = 6, }, }; label.SetTextSize(ComplexUnitType.Sp, 20); row.AddView(label); var editor = new EditText(this) { Hint = f.Placeholder, }; row.AddView(editor); fieldEditors [f] = editor; fields.AddView(row); } content.AddView(fields); // // Buttons // var signInLayout = new LinearLayout(this) { Orientation = Orientation.Horizontal, LayoutParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent) { TopMargin = 24, LeftMargin = hmargin, RightMargin = hmargin, }, }; content.AddView(signInLayout); progress = new ProgressBar(this) { Visibility = state.IsSigningIn ? ViewStates.Visible : ViewStates.Gone, Indeterminate = true, }; signInLayout.AddView(progress); signIn = new Button(this) { Text = "Sign In", LayoutParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent) { }, }; signIn.Click += HandleSignIn; signInLayout.AddView(signIn); if (state.Authenticator.CreateAccountLink != null) { var createAccount = new Button(this) { Text = "Create Account", LayoutParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent) { TopMargin = 12, LeftMargin = hmargin, RightMargin = hmargin, }, }; createAccount.Click += HandleCreateAccount; content.AddView(createAccount); } }
void BuildUI () { var hmargin = 12; var content = new LinearLayout (this) { Orientation = Orientation.Vertical, }; var scroller = new ScrollView (this) { }; scroller.AddView (content); SetContentView (scroller); // // Fields // var fields = new TableLayout (this) { LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent) { TopMargin = 12, LeftMargin = hmargin, RightMargin = hmargin, }, }; fields.SetColumnStretchable (1, true); foreach (var f in state.Authenticator.Fields) { var row = new TableRow (this); var label = new TextView (this) { Text = f.Title, LayoutParameters = new TableRow.LayoutParams (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent) { RightMargin = 6, }, }; label.SetTextSize (ComplexUnitType.Sp, 20); row.AddView (label); var editor = new EditText (this) { Hint = f.Placeholder, }; row.AddView (editor); fieldEditors [f] = editor; fields.AddView (row); } content.AddView (fields); // // Buttons // var signInLayout = new LinearLayout (this) { Orientation = Orientation.Horizontal, LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent) { TopMargin = 24, LeftMargin = hmargin, RightMargin = hmargin, }, }; content.AddView (signInLayout); progress = new ProgressBar (this) { Visibility = state.IsSigningIn ? ViewStates.Visible : ViewStates.Gone, Indeterminate = true, }; signInLayout.AddView (progress); signIn = new Button (this) { Text = "Sign In", LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent) { }, }; signIn.Click += HandleSignIn; signInLayout.AddView (signIn); if (state.Authenticator.CreateAccountLink != null) { var createAccount = new Button (this) { Text = "Create Account", LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent) { TopMargin = 12, LeftMargin = hmargin, RightMargin = hmargin, }, }; createAccount.Click += HandleCreateAccount; content.AddView (createAccount); } }
private void UpdateList() { items = new List <DataDataList>(); //извлечение данных из 1с начало var mContext = this; DataSetWS dataSetWS = new DataSetWS(); string DatalistResult = string.Empty; try { DatalistResult = dataSetWS.GetList(mRef, AppVariable.Variable.getSessionParametersJSON()); } catch (Exception e) { mContext.RunOnUiThread(() => { Toast.MakeText(mContext, e.Message, ToastLength.Long).Show(); mContext.Finish(); }); return; } JObject jsonResult = JObject.Parse(DatalistResult); if (jsonResult.Property("Error") == null) { foreach (JObject Group in jsonResult["Data"]) { Newtonsoft.Json.Linq.JValue Name = (Newtonsoft.Json.Linq.JValue)Group["Name"]; Newtonsoft.Json.Linq.JValue Ref = (Newtonsoft.Json.Linq.JValue)Group["Ref"]; Newtonsoft.Json.Linq.JValue Description = (Newtonsoft.Json.Linq.JValue)Group["Description"]; items.Add(new DataDataList() { Name = (string)Name.Value, Description = (string)Description.Value, Ref = (string)Ref.Value }); } } else { mContext.RunOnUiThread(() => { Toast.MakeText(mContext, (string)jsonResult.Property("Error").Value, ToastLength.Long).Show(); mContext.Finish(); }); } //извлечение данных из 1с конец Button nButton = new Android.Support.V7.Widget.AppCompatButton(this) { Id = 0 }; nButton.Text = "Очистить"; nButton.Click += clearEquip; mLinearLayout.AddView(nButton); Button nButton2 = new Android.Support.V7.Widget.AppCompatButton(this) { Id = 1 }; nButton2.Text = "Выбрать"; nButton2.Click += finishEquip; mLinearLayout.AddView(nButton2); TableLayout mTableLayout = new TableLayout(this); var param = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); mTableLayout.SetColumnStretchable(0, true); mTableLayout.SetColumnShrinkable(0, true); mLinearLayout.AddView(mTableLayout, param); var curId = 2; foreach (var itt in items) { TableRow mNewRow = new TableRow(this); mNewRow.SetGravity(GravityFlags.CenterVertical); mTableLayout.AddView(mNewRow); TextView mTextViewDesc = new TextView(this); mTextViewDesc.Text = itt.Name; mNewRow.AddView(mTextViewDesc); TextView nTextView = new TextView(this) { Id = curId }; nTextView.SetTextSize(Android.Util.ComplexUnitType.Sp, 18); nTextView.Text = getSelItemCount(itt.Ref); mElements.Add(curId, nTextView); mNewRow.AddView(nTextView); ImageButton myImageButton1 = new ImageButton(this) { Id = curId + 1000 }; myImageButton1.SetImageResource(Resource.Drawable.ic_action_new); myImageButton1.Click += plusButtonClicked; mNewRow.AddView(myImageButton1); ImageButton myImageButton2 = new ImageButton(this) { Id = curId + 2000 }; myImageButton2.SetImageResource(Resource.Drawable.ic_action_minus); myImageButton2.Click += minusButtonClicked; mNewRow.AddView(myImageButton2); curId++; } }
void BuildUI() { var hmargin = 12; var content = new LinearLayout(this) { Orientation = Orientation.Vertical, }; var scroller = new ScrollView(this) { }; scroller.AddView(content); SetContentView(scroller); // // Fields // var fields = new TableLayout(this) { LayoutParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent) { TopMargin = 12, LeftMargin = hmargin, RightMargin = hmargin, }, }; fields.SetColumnStretchable(1, true); foreach (var f in state.Authenticator.Fields) { var row = new TableRow(this); var label = new TextView(this) { Text = f.Title, LayoutParameters = new TableRow.LayoutParams(LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent) { RightMargin = 6, }, }; label.SetTextSize(ComplexUnitType.Sp, 20); row.AddView(label); var editor = new EditText(this) { Hint = f.Placeholder, }; # region ///------------------------------------------------------------------------------------------------- /// Pull Request - manually added/fixed /// Fix : Android password field now hides the user input in FormAuthenticatorActivity #63 /// https://github.com/xamarin/Xamarin.Auth/pull/63 if (f.FieldType == FormAuthenticatorFieldType.Password) { editor.InputType = InputTypes.TextVariationPassword; editor.TransformationMethod = new Android.Text.Method.PasswordTransformationMethod(); } ///------------------------------------------------------------------------------------------------- # endregion
void BuildUI() { var hmargin = 12; var content = new LinearLayout(this) { Orientation = Orientation.Vertical, }; var scroller = new ScrollView(this) { }; scroller.AddView(content); SetContentView(scroller); // // Fields // var fields = new TableLayout(this) { LayoutParameters = new LinearLayout.LayoutParams ( LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent ) { TopMargin = 12, LeftMargin = hmargin, RightMargin = hmargin, }, }; fields.SetColumnStretchable(1, true); foreach (var f in state.Authenticator.Fields) { var row = new TableRow(this); var label = new TextView(this) { Text = f.Title, LayoutParameters = new TableRow.LayoutParams ( LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent ) { RightMargin = 6, }, }; label.SetTextSize(ComplexUnitType.Sp, 20); row.AddView(label); var editor = new EditText(this) { Hint = f.Placeholder, }; #region ///------------------------------------------------------------------------------------------------- /// Pull Request - manually added/fixed /// Fix : Android password field now hides the user input in FormAuthenticatorActivity #63 /// https://github.com/xamarin/Xamarin.Auth/pull/63 if (f.FieldType == FormAuthenticatorFieldType.Password) { editor.InputType = InputTypes.TextVariationPassword; editor.TransformationMethod = new global::Android.Text.Method.PasswordTransformationMethod(); } ///------------------------------------------------------------------------------------------------- #endregion row.AddView(editor); fieldEditors[f] = editor; fields.AddView(row); } content.AddView(fields); // // Buttons // var signInLayout = new LinearLayout(this) { Orientation = Orientation.Horizontal, LayoutParameters = new LinearLayout.LayoutParams ( //mc++ LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent ) { TopMargin = 24, LeftMargin = hmargin, RightMargin = hmargin, }, }; content.AddView(signInLayout); progress = new ProgressBar(this) { Visibility = state.IsSigningIn ? ViewStates.Visible : ViewStates.Gone, Indeterminate = true, }; signInLayout.AddView(progress); signIn = new Button(this) { Text = "Sign In", LayoutParameters = new LinearLayout.LayoutParams ( //mc++ LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent ) { }, }; signIn.Click += HandleSignIn; signInLayout.AddView(signIn); if (state.Authenticator.CreateAccountLink != null) { var createAccount = new Button(this) { Text = "Create Account", LayoutParameters = new LinearLayout.LayoutParams ( //LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent ) { TopMargin = 12, LeftMargin = hmargin, RightMargin = hmargin, }, }; createAccount.Click += HandleCreateAccount; content.AddView(createAccount); } }
public void LoadAllWorkOrders() { SqlConnection conn = new SqlConnection("Data Source=vcnsql88.webhost4life.com,1433;Initial Catalog=sonrai001;Persist Security Info=True;User ID=alinaqvi;Password=Sonrai33#"); conn.Open(); string command = "Select WorkOrderProgressiveID, Address_1, City, State, Zip, WorkOrderType, CartType, Status, Notes from [WorkOrderProgressive] where Program='" + Resources.GetString(Resource.String.program_code) + "' AND AssignedTo='" + Resources.GetString(Resource.String.truck_number) + "' AND status='O'"; SqlDataAdapter sqlData = new SqlDataAdapter(command, conn); DataSet ds = new DataSet(); DataTable dt = new DataTable(); sqlData.Fill(ds); dt = ds.Tables[0]; ShapeDrawable TextView_Border = new ShapeDrawable(); TextView_Border.SetBounds(10, 10, 10, 10); ScrollView scrollView1 = FindViewById <ScrollView>(Resource.Id.scrollView1); TableLayout workOrderTable = FindViewById <TableLayout>(Resource.Id.tableLayout1); workOrderTable.SetColumnStretchable(0, true); TableRow tableHeader = new TableRow(this); TextView header1 = new TextView(this); tableHeader.AddView(header1); header1.Text = "Address"; header1.Background = TextView_Border; TextView header2 = new TextView(this); tableHeader.AddView(header2); header1.Text = "WO Type"; header1.Background = TextView_Border; TextView header3 = new TextView(this); tableHeader.AddView(header3); header1.Text = "Cart Type"; header1.Background = TextView_Border; TextView header4 = new TextView(this); tableHeader.AddView(header4); header1.Text = "Status"; header1.Background = TextView_Border; TextView header5 = new TextView(this); tableHeader.AddView(header5); header1.Text = "Address"; header1.Background = TextView_Border; workOrderTable.AddView(tableHeader); for (int i = 0; i <= dt.Rows.Count - 1; i++) { TableRow tableRow = new TableRow(this); //tableRow.GenerateLayoutParams(); Button SelectWO = new Button(this); tableRow.AddView(SelectWO); SelectWO.Text = "SELECT"; //SelectWO.SetOnClickListener(this); //SelectWO.PerformClick(SelectButtonClicked(true)); TextView Address = new TextView(this); tableRow.AddView(Address); Address.Background = TextView_Border; Address.Text = dt.Rows[i][1].ToString() + ", " + dt.Rows[i][2].ToString() + ", " + dt.Rows[i][3].ToString() + " " + dt.Rows[i][4].ToString(); TextView WorkOrderType = new TextView(this); tableRow.AddView(WorkOrderType); WorkOrderType.Background = TextView_Border; WorkOrderType.Text = dt.Rows[i][5].ToString(); TextView CartType = new TextView(this); tableRow.AddView(CartType); CartType.Background = TextView_Border; CartType.Text = dt.Rows[i][6].ToString(); TextView Status = new TextView(this); tableRow.AddView(Status); Status.Background = TextView_Border; Status.Text = dt.Rows[i][7].ToString(); TextView Notes = new TextView(this); tableRow.AddView(Notes); Notes.Background = TextView_Border; Notes.Text = dt.Rows[i][8].ToString(); TextView WorkOrderID = new TextView(this); tableRow.AddView(WorkOrderID); WorkOrderID.Background = TextView_Border; WorkOrderID.Text = dt.Rows[i][0].ToString(); SelectWO.SetTag(Resource.Id.Button_ID, WorkOrderID); SelectWO.Click += delegate(object sender, EventArgs e) { SelectedWorkOrder(sender, e, WorkOrderID.Text); }; workOrderTable.AddView(tableRow); } }