private void LabelPlacementLayout() { //LABEL PLACEMENT TextView departureLabel = new TextView(context); departureLabel.Text = " " + "Label Placement"; departureLabel.Typeface = Typeface.Create("Roboto", TypefaceStyle.Normal); departureLabel.Gravity = GravityFlags.Left; departureLabel.TextSize = 20; departureLabel.SetTextColor(Color.Black); List <String> labelList = new List <String>(); labelList.Add("BottomRight"); labelList.Add("TopLeft"); //labelSpinner labelSpinner = new Spinner(context, SpinnerMode.Dialog); labelSpinner.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => { String selectedItem = dataAdapter.GetItem(e.Position); if (selectedItem.Equals("TopLeft")) { valueplacement = ValuePlacement.TopLeft; } else if (selectedItem.Equals("BottomRight")) { valueplacement = ValuePlacement.BottomRight; } }; //labelAdapter labelAdapter = new ArrayAdapter <String>(context, Android.Resource.Layout.SimpleSpinnerItem, labelList); labelAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); labelSpinner.Adapter = labelAdapter; labelSpinner.SetPadding(0, 0, 0, 0); LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(width * 2, 7); layoutParams2.SetMargins(0, 5, 0, 0); propertylayout.AddView(departureLabel); //separate2 SeparatorView separate2 = new SeparatorView(context, width * 2); separate2.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 7); // propertylayout.AddView(separate2, layoutParams2); //snapsToLabel snapsToLabel = new TextView(context); snapsToLabel.SetHeight(20); //propertylayout.AddView(snapsToLabel); propertylayout.AddView(labelSpinner); propertylayout.SetPadding(15, 0, 15, 0); TextView adjLabel12 = new TextView(context); adjLabel12.SetHeight(20); propertylayout.AddView(adjLabel12); }
private void LabelPlacementLayout() { //Label Placement TextView departureLabel = new TextView(context); departureLabel.LayoutParameters = new FrameLayout.LayoutParams((int)(totalWidth * 0.33), ViewGroup.LayoutParams.WrapContent, GravityFlags.Center); departureLabel.Text = "Label Placement"; departureLabel.TextSize = 15; departureLabel.SetTextColor(Color.Black); //labelList List <String> labelList = new List <String>(); labelList.Add("BottomRight"); labelList.Add("TopLeft"); //labelSpinner labelSpinner = new Spinner(context, SpinnerMode.Dialog); labelSpinner.LayoutParameters = new FrameLayout.LayoutParams((int)(totalWidth * 0.33), ViewGroup.LayoutParams.WrapContent, GravityFlags.Center); labelSpinner.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => { String selectedItem = dataAdapter.GetItem(e.Position); labelPosition = e.Position; if (selectedItem.Equals("TopLeft")) { valueplacement = ValuePlacement.TopLeft; } else if (selectedItem.Equals("BottomRight")) { valueplacement = ValuePlacement.BottomRight; } ApplyChanges(); }; //labelAdapter labelAdapter = new ArrayAdapter <String>(context, Android.Resource.Layout.SimpleSpinnerItem, labelList); labelAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); labelSpinner.Adapter = labelAdapter; labelSpinner.SetSelection(labelPosition); labelSpinner.SetPadding(0, 0, 0, 0); //labelPlacementLayout LinearLayout labelPlacementLayout = new LinearLayout(context); labelPlacementLayout.Orientation = Android.Widget.Orientation.Horizontal; labelPlacementLayout.AddView(departureLabel); labelPlacementLayout.AddView(labelSpinner); proprtyOptionsLayout.AddView(labelPlacementLayout); //spaceText TextView spaceText3 = new TextView(context); spaceText3.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 40, GravityFlags.Center); proprtyOptionsLayout.AddView(spaceText3); }
public override View GetPropertyWindowLayout(Android.Content.Context context) { int width = context.Resources.DisplayMetrics.WidthPixels / 2; propertylayout = new LinearLayout(context); propertylayout.Orientation = droid.Vertical; LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams( width * 2, 5); layoutParams.SetMargins(0, 5, 0, 0); TextView textView1 = new TextView(context); textView1.Text = " " + "TICK PLACEMENT"; textView1.TextSize = 15; textView1.Typeface = Typeface.Create("Roboto", TypefaceStyle.Normal); textView1.SetTextColor(Color.White); textView1.Gravity = GravityFlags.Left; TextView textview2 = new TextView(context); textview2.SetHeight(14); propertylayout.AddView(textview2); tickSpinner = new Spinner(context); tickSpinner.SetPadding(0, 0, 0, 0); propertylayout.AddView(textView1); SeparatorView separate = new SeparatorView(context, width * 2); separate.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5); propertylayout.AddView(separate, layoutParams); TextView textview8 = new TextView(context); textview8.SetHeight(20); propertylayout.AddView(textview8); propertylayout.AddView(tickSpinner); TextView textview3 = new TextView(context); propertylayout.AddView(textview3); List <String> list = new List <String> (); list.Add("BottomRight"); list.Add("TopLeft"); list.Add("Outside"); list.Add("Inline"); list.Add("None"); dataAdapter = new ArrayAdapter <String> (context, Android.Resource.Layout.SimpleSpinnerItem, list); dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); tickSpinner.Adapter = dataAdapter; tickSpinner.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => { String selectedItem = dataAdapter.GetItem(e.Position); if (selectedItem.Equals("BottomRight")) { tickplacement = TickPlacement.BottomRight; } else if (selectedItem.Equals("TopLeft")) { tickplacement = TickPlacement.TopLeft; } else if (selectedItem.Equals("Inline")) { tickplacement = TickPlacement.Inline; } else if (selectedItem.Equals("Outside")) { tickplacement = TickPlacement.Outside; } else if (selectedItem.Equals("None")) { tickplacement = TickPlacement.None; } }; TextView textView3 = new TextView(context); textView3.Text = " " + "LABEL PLACEMENT"; textView3.Typeface = Typeface.Create("Roboto", TypefaceStyle.Normal); textView3.Gravity = GravityFlags.Left; textView3.TextSize = 15; textView3.SetTextColor(Color.White); List <String> labelList = new List <String> (); labelList.Add("BottomRight"); labelList.Add("TopLeft"); labelSpinner = new Spinner(context); labelSpinner.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => { String selectedItem = dataAdapter.GetItem(e.Position); if (selectedItem.Equals("TopLeft")) { valueplacement = ValuePlacement.TopLeft; } else if (selectedItem.Equals("BottomRight")) { valueplacement = ValuePlacement.BottomRight; } }; labelAdapter = new ArrayAdapter <String> (context, Android.Resource.Layout.SimpleSpinnerItem, labelList); labelAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); labelSpinner.Adapter = labelAdapter; labelSpinner.SetPadding(0, 0, 0, 0); LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(width * 2, 7); layoutParams2.SetMargins(0, 5, 0, 0); propertylayout.AddView(textView3); SeparatorView separate2 = new SeparatorView(context, width * 2); separate2.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 7); propertylayout.AddView(separate2, layoutParams2); TextView textview9 = new TextView(context); textview9.SetHeight(20); propertylayout.AddView(textview9); propertylayout.AddView(labelSpinner); propertylayout.SetPadding(15, 0, 15, 0); TextView textview7 = new TextView(context); textview7.SetHeight(20); propertylayout.AddView(textview7); TextView textView6 = new TextView(context); textView6.Text = " " + "Show Label"; textView6.Typeface = Typeface.Create("Roboto", TypefaceStyle.Normal); textView6.Gravity = GravityFlags.Center; textView6.TextSize = 16; Switch checkBox = new Switch(context); checkBox.Checked = true; checkBox.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => { if (e.IsChecked) { showlabel = true; } else { showlabel = false; } }; LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); layoutParams3.SetMargins(0, 10, 0, 0); LinearLayout.LayoutParams layoutParams4 = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, 55); layoutParams4.SetMargins(0, 10, 0, 0); stackView3 = new LinearLayout(context); stackView3.AddView(textView6, layoutParams4); stackView3.AddView(checkBox, layoutParams3); stackView3.Orientation = droid.Horizontal; propertylayout.AddView(stackView3); SeparatorView separate3 = new SeparatorView(context, width * 2); separate3.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5); LinearLayout.LayoutParams layoutParams7 = new LinearLayout.LayoutParams( width * 2, 5); layoutParams7.SetMargins(0, 30, 0, 0); propertylayout.AddView(separate3, layoutParams7); TextView textView7 = new TextView(context); textView7.Text = " " + "SnapsToTicks"; textView7.Typeface = Typeface.Create("Roboto", TypefaceStyle.Normal); textView7.Gravity = GravityFlags.Center; textView7.TextSize = 16; Switch checkBox2 = new Switch(context); checkBox2.Checked = false; checkBox2.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => { if (e.IsChecked) { snapsto = SnapsTo.Ticks; } else { snapsto = SnapsTo.None; } }; LinearLayout.LayoutParams layoutParams5 = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); layoutParams5.SetMargins(0, 20, 0, 0); LinearLayout.LayoutParams layoutParams6 = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, 55); layoutParams6.SetMargins(0, 20, 0, 0); stackView4 = new LinearLayout(context); stackView4.AddView(textView7, layoutParams6); stackView4.AddView(checkBox2, layoutParams5); stackView4.Orientation = droid.Horizontal; propertylayout.AddView(stackView4); SeparatorView separate4 = new SeparatorView(context, width * 2); separate4.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5); LinearLayout.LayoutParams layoutParams8 = new LinearLayout.LayoutParams( width * 2, 5); layoutParams8.SetMargins(0, 30, 0, 0); propertylayout.AddView(separate4, layoutParams8); return(propertylayout); }
public override View GetPropertyWindowLayout (Android.Content.Context context) { int width = context.Resources.DisplayMetrics.WidthPixels / 2; propertylayout = new LinearLayout (context); propertylayout.Orientation = droid.Vertical; LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams ( width * 2, 5); layoutParams.SetMargins (0, 5, 0, 0); TextView textView1 = new TextView (context); textView1.Text = " " + "TICK PLACEMENT"; textView1.TextSize = 15; textView1.Typeface = Typeface.Create("Roboto", TypefaceStyle.Normal); textView1.SetTextColor (Color.White); textView1.Gravity = GravityFlags.Left; TextView textview2 = new TextView (context); textview2.SetHeight (14); propertylayout.AddView (textview2); tickSpinner = new Spinner (context); tickSpinner.SetPadding (0, 0, 0, 0); propertylayout.AddView (textView1); SeparatorView separate = new SeparatorView (context, width * 2); separate.LayoutParameters = new ViewGroup.LayoutParams (width * 2, 5); propertylayout.AddView (separate, layoutParams); TextView textview8 = new TextView (context); textview8.SetHeight (20); propertylayout.AddView (textview8); propertylayout.AddView (tickSpinner); TextView textview3 = new TextView (context); propertylayout.AddView (textview3); List<String> list = new List<String> (); list.Add ("BottomRight"); list.Add ("TopLeft"); list.Add ("Outside"); list.Add ("Inline"); list.Add ("None"); dataAdapter = new ArrayAdapter<String> (context, Android.Resource.Layout.SimpleSpinnerItem, list); dataAdapter.SetDropDownViewResource (Android.Resource.Layout.SimpleSpinnerDropDownItem); tickSpinner.Adapter = dataAdapter; tickSpinner.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => { String selectedItem = dataAdapter.GetItem (e.Position); if (selectedItem.Equals ("BottomRight")) { tickplacement = TickPlacement.BottomRight; } else if (selectedItem.Equals ("TopLeft")) { tickplacement = TickPlacement.TopLeft; } else if (selectedItem.Equals ("Inline")) { tickplacement = TickPlacement.Inline; } else if (selectedItem.Equals ("Outside")) { tickplacement = TickPlacement.Outside; } else if (selectedItem.Equals ("None")) { tickplacement = TickPlacement.None; } }; TextView textView3 = new TextView (context); textView3.Text = " " + "LABEL PLACEMENT"; textView3.Typeface = Typeface.Create("Roboto", TypefaceStyle.Normal); textView3.Gravity = GravityFlags.Left; textView3.TextSize = 15; textView3.SetTextColor (Color.White); List<String> labelList = new List<String> (); labelList.Add ("BottomRight"); labelList.Add ("TopLeft"); labelSpinner = new Spinner (context); labelSpinner.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => { String selectedItem = dataAdapter.GetItem (e.Position); if (selectedItem.Equals ("TopLeft")) { valueplacement = ValuePlacement.TopLeft; } else if (selectedItem.Equals ("BottomRight")) { valueplacement = ValuePlacement.BottomRight; } }; labelAdapter = new ArrayAdapter<String> (context, Android.Resource.Layout.SimpleSpinnerItem, labelList); labelAdapter.SetDropDownViewResource (Android.Resource.Layout.SimpleSpinnerDropDownItem); labelSpinner.Adapter = labelAdapter; labelSpinner.SetPadding (0, 0, 0, 0); LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams (width * 2, 7); layoutParams2.SetMargins (0, 5, 0, 0); propertylayout.AddView (textView3); SeparatorView separate2 = new SeparatorView (context, width * 2); separate2.LayoutParameters = new ViewGroup.LayoutParams (width * 2, 7); propertylayout.AddView (separate2, layoutParams2); TextView textview9 = new TextView (context); textview9.SetHeight (20); propertylayout.AddView (textview9); propertylayout.AddView (labelSpinner); propertylayout.SetPadding (15, 0, 15, 0); TextView textview7 = new TextView (context); textview7.SetHeight (20); propertylayout.AddView (textview7); TextView textView6 = new TextView (context); textView6.Text = " " + "Show Label"; textView6.Typeface = Typeface.Create("Roboto", TypefaceStyle.Normal); textView6.Gravity = GravityFlags.Center; textView6.TextSize = 16; Switch checkBox = new Switch (context); checkBox.Checked = true; checkBox.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => { if (e.IsChecked) showlabel = true; else showlabel = false; }; LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams ( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); layoutParams3.SetMargins (0, 10, 0, 0); LinearLayout.LayoutParams layoutParams4 = new LinearLayout.LayoutParams ( ViewGroup.LayoutParams.WrapContent, 55); layoutParams4.SetMargins (0, 10, 0, 0); stackView3 = new LinearLayout (context); stackView3.AddView (textView6, layoutParams4); stackView3.AddView (checkBox, layoutParams3); stackView3.Orientation = droid.Horizontal; propertylayout.AddView (stackView3); SeparatorView separate3 = new SeparatorView (context, width * 2); separate3.LayoutParameters = new ViewGroup.LayoutParams (width * 2, 5); LinearLayout.LayoutParams layoutParams7 = new LinearLayout.LayoutParams ( width * 2, 5); layoutParams7.SetMargins (0, 30, 0, 0); propertylayout.AddView (separate3, layoutParams7); TextView textView7 = new TextView (context); textView7.Text = " "+"SnapsToTicks"; textView7.Typeface = Typeface.Create("Roboto", TypefaceStyle.Normal); textView7.Gravity = GravityFlags.Center; textView7.TextSize = 16; Switch checkBox2 = new Switch (context); checkBox2.Checked = false; checkBox2.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => { if (e.IsChecked) snapsto = SnapsTo.Ticks; else snapsto = SnapsTo.None; }; LinearLayout.LayoutParams layoutParams5 = new LinearLayout.LayoutParams ( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); layoutParams5.SetMargins (0, 20, 0, 0); LinearLayout.LayoutParams layoutParams6 = new LinearLayout.LayoutParams ( ViewGroup.LayoutParams.WrapContent, 55); layoutParams6.SetMargins (0, 20, 0, 0); stackView4 = new LinearLayout (context); stackView4.AddView (textView7, layoutParams6); stackView4.AddView (checkBox2, layoutParams5); stackView4.Orientation = droid.Horizontal; propertylayout.AddView (stackView4); SeparatorView separate4 = new SeparatorView (context, width * 2); separate4.LayoutParameters = new ViewGroup.LayoutParams (width * 2, 5); LinearLayout.LayoutParams layoutParams8 = new LinearLayout.LayoutParams ( width * 2, 5); layoutParams8.SetMargins (0, 30, 0, 0); propertylayout.AddView (separate4, layoutParams8); return propertylayout; }