public override void Destroy() { if (sfschedule != null) { sfschedule.Dispose(); sfschedule = null; } if (workHour_rangeSlider != null) { workHour_rangeSlider.RangeChanged -= workHour_rangeSlider_RangeChanged; workHour_rangeSlider.Dispose(); workHour_rangeSlider = null; } if (show_Non_Accessible_Block_checkBox != null) { show_Non_Accessible_Block_checkBox.CheckedChange -= show_Non_Accessible_Block_checkBox_CheckedChange; show_Non_Accessible_Block_checkBox.Dispose(); show_Non_Accessible_Block_checkBox = null; } if (show_Blackout_Dates != null) { show_Blackout_Dates.CheckedChange -= show_Blackout_Dates_CheckedChange; show_Blackout_Dates.Dispose(); show_Blackout_Dates = null; } if (show_week_number != null) { show_week_number.CheckedChange -= show_week_number_CheckedChange; show_week_number.Dispose(); show_week_number = null; } base.Destroy(); }
public Orientation() { //RangeSlider 1 rangeSlider1 = new SfRangeSlider(); rangeSlider1.Maximum = 12; rangeSlider1.Minimum = -12; rangeSlider1.RangeStart = -12; rangeSlider1.RangeEnd = (nfloat)2.2; rangeSlider1.Value = (nfloat)2.2; rangeSlider1.TickPlacement = SFTickPlacement.SFTickPlacementNone; rangeSlider1.TickFrequency = 12; rangeSlider1.Orientation = SFOrientation.SFOrientationVertical; rangeSlider1.ValuePlacement = SFValuePlacement.SFValuePlacementTopLeft; rangeSlider1.SnapsTo = SFSnapsTo.SFSnapsToNone; rangeSlider1.KnobColor = UIColor.White; rangeSlider1.TrackSelectionColor = UIColor.FromRGB(182, 182, 182); rangeSlider1.TrackColor = UIColor.FromRGB(182, 182, 182); rangeSlider1.ShowRange = false; //RangeSlider 2 rangeSlider2 = new SfRangeSlider(); rangeSlider2.Maximum = 12; rangeSlider2.Minimum = -12; rangeSlider2.RangeStart = -12; rangeSlider2.RangeEnd = (nfloat)(-4.7); rangeSlider2.Value = (nfloat)(-4.7); rangeSlider2.TickPlacement = SFTickPlacement.SFTickPlacementNone; rangeSlider2.TickFrequency = 12; rangeSlider2.Orientation = SFOrientation.SFOrientationVertical; rangeSlider2.ValuePlacement = SFValuePlacement.SFValuePlacementTopLeft; rangeSlider2.SnapsTo = SFSnapsTo.SFSnapsToNone; rangeSlider2.KnobColor = UIColor.White; rangeSlider2.ShowRange = false; rangeSlider2.TrackSelectionColor = UIColor.FromRGB(182, 182, 182); rangeSlider2.TrackColor = UIColor.FromRGB(182, 182, 182); //RangeSlider 3 rangeSlider3 = new SfRangeSlider(); rangeSlider3.Maximum = 12; rangeSlider3.Minimum = -12; rangeSlider3.RangeStart = -12; rangeSlider3.RangeEnd = (nfloat)6; rangeSlider3.Value = (nfloat)6; rangeSlider3.TickPlacement = SFTickPlacement.SFTickPlacementNone; rangeSlider3.TickFrequency = 12; rangeSlider3.Orientation = SFOrientation.SFOrientationVertical; rangeSlider3.ValuePlacement = SFValuePlacement.SFValuePlacementTopLeft; rangeSlider3.SnapsTo = SFSnapsTo.SFSnapsToNone; rangeSlider3.KnobColor = UIColor.White; rangeSlider3.ShowRange = false; rangeSlider3.TrackSelectionColor = UIColor.FromRGB(182, 182, 182); rangeSlider3.TrackColor = UIColor.FromRGB(182, 182, 182); rangeSlider1.ValueChange += Slider_ValueChange; rangeSlider2.ValueChange += Slider_ValueChange; rangeSlider3.ValueChange += Slider_ValueChange; this.AddSubview(rangeSlider3); this.AddSubview(rangeSlider1); this.AddSubview(rangeSlider2); mainPageDesign(); }
public override View GetSampleContent(Context con) { SamplePageContent(con); /*************** **RangeSlider** ***************/ range = new SfRangeSlider(con); range.Minimum = 0; range.Maximum = 100; range.Value = 100; range.ShowRange = false; range.SnapsTo = SnapsTo.None; range.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Horizontal; range.TickPlacement = TickPlacement.BottomRight; range.ShowValueLabel = true; range.TickFrequency = 20; range.ValuePlacement = ValuePlacement.BottomRight; range.LayoutParameters = (new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, GettingStarted_Mobile.getDimensionPixelSize(con, Resource.Dimension.range_ht))); range.ValueChanged += ValueChanged; range.SetY(-30); //Frame Layout FrameLayout frame = new FrameLayout(con); frame.SetBackgroundColor(Color.White); frame.LayoutParameters = (new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.Center)); frame.AddView(GetView(con)); return(frame); }
public Configuration() { schedule = new SFSchedule(); schedule.ScheduleView = SFScheduleView.SFScheduleViewWeek; //Intializing configurationc controls picker_scheduleView = new UIPickerView(); _rangeslider = new SfRangeSlider(); label_scheduleView = new UILabel(); button_scheduleView = new UIButton(); label_workingHours = new UILabel(); label_weekNumber = new UILabel(); label_showNonAccess = new UILabel(); label_blackOutDays = new UILabel(); switch_blackOutDates = new UISwitch(); switch_nonAccessbleBlock = new UISwitch(); switch_weekNumber = new UISwitch(); switch_nonAccessbleBlock.On = true; switch_blackOutDates.On = true; switch_weekNumber.On = true; SetNonWorkingHours(); SetMonthSettings(); //schedule.AppointmentStyle.BorderColor = UIColor.LightGray; //schedule.AppointmentStyle.SelectionBorderColor = UIColor.Red; //schedule.AppointmentStyle.SelectionTextColor = UIColor.Orange; //schedule.AppointmentStyle.BorderWidth = 5; //schedule.AppointmentStyle.TextColor = UIColor.Magenta; schedule.Appointments = CreateAppointments(); this.AddSubview(schedule); this.OptionView = new UIView(); //control = this; }
public override View GetPropertyWindowLayout(Context context) { propertylayout = new LinearLayout(context); propertylayout.Orientation = Android.Widget.Orientation.Vertical; width = context.Resources.DisplayMetrics.WidthPixels / 2; TextView textView = new TextView(context); textView.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); textView.Text = "Rim Radius"; if (IsTabletDevice(context)) { textView.SetPadding(3, 0, 0, 0); } textView.TextSize = 16; propertylayout.AddView(textView); SfRangeSlider seekBar = new SfRangeSlider(context); seekBar.Minimum = 100; seekBar.Maximum = 200; seekBar.Value = 100; seekBar.ShowRange = false; seekBar.ShowValueLabel = false; seekBar.TickPlacement = TickPlacement.None; seekBar.ToolTipPlacement = ToolTipPlacement.None; seekBar.ValueChanged += SeekBar_ValueChanged; seekBar.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WrapContent, 200); propertylayout.AddView(seekBar); SnapsToLayout(context); ShowLabelLayout(context); return(propertylayout); }
public Configuration() { schedule = new SFSchedule(); schedule.ScheduleView = SFScheduleView.SFScheduleViewWeek; //Initializing configuration controls pickerScheduleView = new UIPickerView(); rangeslider = new SfRangeSlider(); labelScheduleView = new UILabel(); buttonScheduleView = new UIButton(); labelWorkingHours = new UILabel(); labelWeekNumber = new UILabel(); labelShowNonAccess = new UILabel(); labelBlackOutDays = new UILabel(); switchBlackOutDates = new UISwitch(); switchNonAccessbleBlock = new UISwitch(); switchWeekNumber = new UISwitch(); switchNonAccessbleBlock.On = true; switchBlackOutDates.On = true; switchWeekNumber.On = true; SetNonWorkingHours(); SetMonthSettings(); schedule.ItemsSource = viewModel.CreateAppointments(); this.AddSubview(schedule); this.OptionView = new UIView(); }
public View GetSampleContent(Context con1) { con = con1; linearLayout = new LinearLayout(con); linearLayout.SetPadding(20, 20, 20, 30); linearLayout.SetBackgroundColor(Color.Rgb(236, 235, 242)); linearLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); linearLayout.Orientation = Android.Widget.Orientation.Vertical; rangeHeight = getDimensionPixelSize(con, Resource.Dimension.range_ht); DepatureLayout(); //RangeSlider range = new SfRangeSlider(con); range.Minimum = 0; range.Maximum = 12; range.TickFrequency = 2; range.ShowValueLabel = true; range.StepFrequency = 6; range.DirectionReversed = false; range.ValuePlacement = Com.Syncfusion.Sfrangeslider.ValuePlacement.BottomRight; range.RangeEnd = 12; range.RangeStart = 0; range.TickPlacement = Com.Syncfusion.Sfrangeslider.TickPlacement.BottomRight; range.ShowRange = true; range.SnapsTo = Com.Syncfusion.Sfrangeslider.SnapsTo.None; range.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Horizontal; range.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, rangeHeight); TimeLabelLayout(); linearLayout.AddView(range); ArrivalLabelLayout(); //rangeSlider range2 = new SfRangeSlider(con); range2.Minimum = 0; range2.Maximum = 12; range2.TickFrequency = 2; range2.ShowValueLabel = true; range2.StepFrequency = 6; range2.DirectionReversed = false; range2.ValuePlacement = Com.Syncfusion.Sfrangeslider.ValuePlacement.BottomRight; range2.RangeEnd = 12; range2.RangeStart = 0; range2.TickPlacement = Com.Syncfusion.Sfrangeslider.TickPlacement.BottomRight; range2.ShowRange = true; range2.SnapsTo = Com.Syncfusion.Sfrangeslider.SnapsTo.None; range2.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Horizontal; range2.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, rangeHeight); TimeLableLayout2(); return(linearLayout); }
public override View GetSampleContent(Context con1) { con = con1; InitialMethod(); DepatureLayout(); //rangeSlider range = new SfRangeSlider(con); range.Minimum = 0; range.Maximum = 12; range.TickFrequency = 2; range.ShowValueLabel = true; range.StepFrequency = 6; range.DirectionReversed = false; range.ValuePlacement = Com.Syncfusion.Sfrangeslider.ValuePlacement.BottomRight; range.RangeEnd = 12; range.RangeStart = 0; range.TickPlacement = Com.Syncfusion.Sfrangeslider.TickPlacement.BottomRight; range.ShowRange = true; range.SnapsTo = Com.Syncfusion.Sfrangeslider.SnapsTo.None; range.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Horizontal; range.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, rangeHeight); TimeLabelLayout(); linearLayout.AddView(range); ArrivalLabelLayout(); //rangeSlider range2 = new SfRangeSlider(con); range2.Minimum = 0; range2.Maximum = 12; range2.TickFrequency = 2; range2.ShowValueLabel = true; range2.StepFrequency = 6; range2.DirectionReversed = false; range2.ValuePlacement = Com.Syncfusion.Sfrangeslider.ValuePlacement.BottomRight; range2.RangeEnd = 12; range2.RangeStart = 0; range2.TickPlacement = Com.Syncfusion.Sfrangeslider.TickPlacement.BottomRight; range2.ShowRange = true; range2.SnapsTo = Com.Syncfusion.Sfrangeslider.SnapsTo.None; range2.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Horizontal; range2.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, rangeHeight); TimeLableLayout2(); FinalLayout(); return(frame); }
public override View GetSampleContent(Context con) { int height = con.Resources.DisplayMetrics.HeightPixels / 2; LinearLayout linearLayout = new LinearLayout(con); linearLayout.SetGravity(Android.Views.GravityFlags.CenterHorizontal); linearLayout.Orientation = Android.Widget.Orientation.Vertical; linearLayout.SetBackgroundColor(Color.White); img = new ImageView(con); img.SetImageResource(Resource.Drawable.mount); linearLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); linearLayout.SetPadding(20, 20, 20, 20); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(height + (height / 3.5)), GravityFlags.Center); img.SetPadding(12, 0, 10, 0); img.LayoutParameters = (layoutParams); range = new SfRangeSlider(con); range.Minimum = 0; range.Maximum = 100; range.Value = 100; range.ShowRange = false; range.SnapsTo = SnapsTo.None; range.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Horizontal; range.TickPlacement = TickPlacement.BottomRight; range.ShowValueLabel = true; range.TickFrequency = 20; range.ValuePlacement = ValuePlacement.BottomRight; range.LayoutParameters = (new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 150)); range.ValueChanged += ValueChanged; linearLayout.AddView(img); TextView text1 = new TextView(con); text1.Text = " Opacity"; text1.TextSize = 20; text1.Gravity = GravityFlags.Left; range.SetY(-30); linearLayout.AddView(text1); linearLayout.AddView(range); FrameLayout frame = new FrameLayout(con); frame.SetBackgroundColor(Color.White); frame.LayoutParameters = (new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.Center)); frame.AddView(linearLayout); return(frame); }
public void SetValue(SfRangeSlider r, nfloat value) { nfloat f = (nfloat)Math.Round(value, 1); if (r == rangeSlider1) { decibelLabel1.Text = f.ToString() + "db"; } else if (r == rangeSlider2) { decibelLabel2.Text = f.ToString() + "db"; } else { decibelLabel3.Text = f.ToString() + "db"; } }
public override View GetSampleContent (Context con) { int height = con.Resources.DisplayMetrics.HeightPixels/2; LinearLayout linearLayout = new LinearLayout(con); linearLayout.SetGravity (Android.Views.GravityFlags.CenterHorizontal); linearLayout.Orientation = Android.Widget.Orientation.Vertical; linearLayout.SetBackgroundColor(Color.White); img = new ImageView(con); img.SetImageResource (Resource.Drawable.mount); linearLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); linearLayout.SetPadding(20, 20, 20, 20); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(height+(height/3.5)),GravityFlags.Center); img.SetPadding(12, 0, 10, 0); img.LayoutParameters = (layoutParams); range=new SfRangeSlider(con); range.Minimum = 0;range.Maximum = 100; range.Value = 100; range.ShowRange = false; range.SnapsTo = SnapsTo.None; range.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Horizontal; range.TickPlacement = TickPlacement.BottomRight; range.ShowValueLabel = true; range.TickFrequency = 20; range.ValuePlacement = ValuePlacement.BottomRight; range.LayoutParameters = (new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 150)); range.ValueChanged += ValueChanged ; linearLayout.AddView(img); TextView text1 = new TextView(con); text1.Text = " Opacity"; text1.TextSize=20; text1.Gravity = GravityFlags.Left; range.SetY(-30); linearLayout.AddView(text1); linearLayout.AddView(range); FrameLayout frame = new FrameLayout(con); frame.SetBackgroundColor (Color.White); frame.LayoutParameters = ( new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent,GravityFlags.Center)); frame.AddView(linearLayout); return frame; }
public RangeSliderGettingStarted_Tablet() { //RangeSlider 1 rangeSlider1 = new SfRangeSlider(); rangeSlider1.Maximum = 12; rangeSlider1.Minimum = 0; rangeSlider1.RangeStart = 0; rangeSlider1.RangeEnd = 12; rangeSlider1.TickPlacement = SFTickPlacement.SFTickPlacementBottomRight; rangeSlider1.TickFrequency = 2; rangeSlider1.ToolTipPlacement = SFToolTipPlacement.SFToolTipPlacementTopLeft; rangeSlider1.ValuePlacement = SFValuePlacement.SFValuePlacementBottomRight; rangeSlider1.SnapsTo = SFSnapsTo.SFSnapsToNone; rangeSlider1.KnobColor = UIColor.White; rangeSlider1.TrackSelectionColor = UIColor.FromRGB(65, 115, 185); rangeSlider1.TrackColor = UIColor.FromRGB(182, 182, 182); //RangeSlider 2 rangeSlider2 = new SfRangeSlider(); rangeSlider2.Frame = new CGRect(10, 100, this.Frame.Size.Width, this.Frame.Size.Height); rangeSlider2.Maximum = 12; rangeSlider2.Minimum = 0; rangeSlider2.RangeStart = 0; rangeSlider2.RangeEnd = 12; rangeSlider2.TickPlacement = SFTickPlacement.SFTickPlacementBottomRight; rangeSlider2.TickFrequency = 2; rangeSlider2.ValuePlacement = SFValuePlacement.SFValuePlacementBottomRight; rangeSlider2.ToolTipPlacement = SFToolTipPlacement.SFToolTipPlacementTopLeft; rangeSlider2.SnapsTo = SFSnapsTo.SFSnapsToNone; rangeSlider2.KnobColor = UIColor.White; rangeSlider2.TrackSelectionColor = UIColor.FromRGB(65, 115, 185); rangeSlider2.TrackColor = UIColor.FromRGB(182, 182, 182); controlView.AddSubview(rangeSlider1); controlView.AddSubview(rangeSlider2); rangeSlider2.RangeValueChange += Slider_RangeValueChange; rangeSlider1.RangeValueChange += Slider_RangeValueChange; this.AddSubview(controlView); mainPageDesign(); loadOptionView(); }
public Slider() { //RangeSlider RangeSliderSample = new SfRangeSlider(); RangeSliderSample.Maximum = 100; RangeSliderSample.Minimum = 0; RangeSliderSample.Value = 100; RangeSliderSample.RangeStart = 0; RangeSliderSample.RangeEnd = 100; RangeSliderSample.TickPlacement = SFTickPlacement.SFTickPlacementBottomRight; RangeSliderSample.ValuePlacement = SFValuePlacement.SFValuePlacementBottomRight; RangeSliderSample.TickFrequency = 20; RangeSliderSample.ToolTipPlacement = SFToolTipPlacement.SFToolTipPlacementTopLeft; RangeSliderSample.SnapsTo = SFSnapsTo.SFSnapsToNone; RangeSliderSample.ShowRange = false; RangeSliderSample.KnobColor = UIColor.White; RangeSliderSample.TrackSelectionColor = UIColor.FromRGB(66, 115, 185); RangeSliderSample.TrackColor = UIColor.FromRGB(182, 182, 182); RangeSliderSample.ValueChange += Slider_ValueChange; this.AddSubview(RangeSliderSample); mainPageDesign(); }
protected override void Dispose(bool disposing) { if (disposing) { if (schedule != null) { schedule.Dispose(); schedule = null; } if (OptionView != null) { this.OptionView.RemoveFromSuperview(); this.OptionView.Dispose(); this.OptionView = null; } if (button_scheduleView != null) { button_scheduleView.TouchUpInside -= ShowPicker1; button_scheduleView.Dispose(); button_scheduleView = null; } if (doneButton != null) { doneButton.TouchUpInside -= HidePicker; doneButton.Dispose(); doneButton = null; } if (_rangeslider != null) { _rangeslider.RangeValueChange -= Slider_RangeValueChange; _rangeslider.Dispose(); _rangeslider = null; } } base.Dispose(disposing); }
public void Dispose() { if (sfschedule != null) { sfschedule.Dispose(); sfschedule = null; } if (propertylayout != null) { propertylayout.Dispose(); propertylayout = null; } if (monthViewLayout != null) { monthViewLayout.Dispose(); monthViewLayout = null; } if (otherviewsLayout != null) { otherviewsLayout.Dispose(); otherviewsLayout = null; } if (workHourRangeSlider != null) { workHourRangeSlider.RangeChanged -= WorkHour_rangeSlider_RangeChanged; workHourRangeSlider.Dispose(); workHourRangeSlider = null; } if (showWeekNumber != null) { showWeekNumber.CheckedChange -= Show_week_number_CheckedChange; showWeekNumber.Dispose(); showWeekNumber = null; } if (workingHoursTxtBlock != null) { workingHoursTxtBlock.Dispose(); workingHoursTxtBlock = null; } if (showNonAccessibleBlockcheckBox != null) { showNonAccessibleBlockcheckBox.CheckedChange -= Show_Non_Accessible_Block_checkBox_CheckedChange; showNonAccessibleBlockcheckBox.Dispose(); showNonAccessibleBlockcheckBox = null; } if (showBlackoutDates != null) { showBlackoutDates.CheckedChange -= Show_Blackout_Dates_CheckedChange; showBlackoutDates.Dispose(); showBlackoutDates = null; } if (monthViewLayout != null) { monthViewLayout.Dispose(); monthViewLayout = null; } }
public override View GetSampleContent(Context con) { height = con.Resources.DisplayMetrics.HeightPixels / 2; width = con.Resources.DisplayMetrics.WidthPixels / 3; SamplePageContent(con); sliderLayout = new FrameLayout.LayoutParams(width, height + (height / 4)); /**************** **RangeSlider1** ****************/ slider1 = new SfRangeSlider(con); slider1.Minimum = -12; slider1.Maximum = 12; slider1.TickFrequency = 12; slider1.TrackSelectionColor = Color.Gray; slider1.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Vertical; slider1.TickPlacement = TickPlacement.None; slider1.ValuePlacement = ValuePlacement.TopLeft; slider1.ShowValueLabel = true; slider1.SnapsTo = SnapsTo.None; slider1.Value = 6; slider1.ValueChanged += (object sender, ValueChangedEventArgs e) => { String decibelString = (string)(Math.Round(e.Value) + ".0db"); decibelLabel.Text = decibelString; }; /**************** **RangeSlider2** ****************/ slider2 = new SfRangeSlider(con); slider2.Minimum = -12; slider2.Maximum = 12; slider2.TickFrequency = 12; slider2.TrackSelectionColor = Color.Gray; slider2.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Vertical; slider2.TickPlacement = TickPlacement.None; slider2.ValuePlacement = ValuePlacement.TopLeft; slider2.ShowValueLabel = true; slider2.SnapsTo = SnapsTo.None; slider2.Value = -3; slider2.LayoutParameters = sliderLayout; slider2.ValueChanged += (object sender, ValueChangedEventArgs e) => { decibelLabel1.Text = Convert.ToString(Math.Round(e.Value) + ".0db"); }; /**************** **RangeSlider3** ****************/ slider3 = new SfRangeSlider(con); slider3.Minimum = -12; slider3.Maximum = 12; slider3.TickFrequency = 12; slider3.TrackSelectionColor = Color.Gray; slider3.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Vertical; slider3.TickPlacement = TickPlacement.None; slider3.ValuePlacement = ValuePlacement.TopLeft; slider3.ShowValueLabel = true; slider3.SnapsTo = SnapsTo.None; slider3.Value = 12; slider3.LayoutParameters = sliderLayout; slider3.ValueChanged += (object sender, ValueChangedEventArgs e) => { decibelLabel2.Text = Convert.ToString(Math.Round(e.Value) + ".0db"); }; LinearLayout mainView = GetView(con); return(mainView); }
public override View GetSampleContent (Context con) { LinearLayout mainLayout,layout1,layout2,layout3;; int height = con.Resources.DisplayMetrics.HeightPixels/2; int width = con.Resources.DisplayMetrics.WidthPixels/3; /** * Defining Linear Layout */ mainLayout = new LinearLayout(con); mainLayout.SetBackgroundColor(Color.White); mainLayout.SetGravity(GravityFlags.Center); LinearLayout parentLayout=new LinearLayout(con); parentLayout.Orientation=droid.Vertical; parentLayout.SetBackgroundColor(Color.White); parentLayout.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); FrameLayout.LayoutParams sliderLayout = new FrameLayout.LayoutParams(width,height+(height/4)); textView = new TextView(con); textView7 = new TextView(con); textView8 = new TextView(con); textView9 = new TextView(con); textView9.Text=""; textView.Typeface= Typeface.Create("Roboto", TypefaceStyle.Normal); textView9.TextSize=20; textView9.Gravity=GravityFlags.Center; textView9.SetTextColor (Color.Argb(255,182,182,182)); //parentLayout.AddView(textView9); textView10 = new TextView(con); parentLayout.AddView(textView10); parentLayout.AddView(mainLayout); parentLayout.SetGravity(GravityFlags.Center); /** * Defining First Slider */ slider1 = new SfRangeSlider(con); slider1.Minimum=-12; slider1.Maximum=12; slider1.TickFrequency=12; slider1.TrackSelectionColor=Color.Gray; slider1.Orientation=Com.Syncfusion.Sfrangeslider.Orientation.Vertical; slider1.TickPlacement=TickPlacement.None; slider1.ValuePlacement=ValuePlacement.TopLeft; slider1.ShowValueLabel=true; slider1.SnapsTo=SnapsTo.None; slider1.Value=6; // slider1.setLayoutParams(sliderLayout); slider1.ValueChanged += (object sender, SfRangeSlider.ValueChangedEventArgs e) => { String str=(string)(Math.Round(e.P1)+".0db"); textView4.Text=str; }; layout1 = new LinearLayout(con); layout1.Orientation=droid.Vertical; layout1.SetGravity(GravityFlags.Center); textView1=new TextView(con); textView1.Text="60HZ"; textView1.TextSize=20; textView1.SetTextColor(Color.Black); textView1.Gravity=GravityFlags.Center; textView1.Typeface = Typeface.Create("Helvetica", TypefaceStyle.Normal); textView4 = new TextView(con); textView4.TextSize=14; textView4.SetTextColor(Color.Argb(255, 50, 180, 228)); textView4.Text="0.0db"; textView4.Typeface=Typeface.Create("Helvetica", TypefaceStyle.Normal); textView4.Gravity=GravityFlags.Center; layout1.AddView(textView1); layout1.AddView(textView4); layout1.AddView(textView); layout1.AddView(slider1,sliderLayout); /** * Defining Second Slider */ slider2 = new SfRangeSlider(con); slider2.Minimum=-12; slider2.Maximum=12; slider2.TickFrequency=12; slider2.TrackSelectionColor=Color.Gray; slider2.Orientation=Com.Syncfusion.Sfrangeslider.Orientation.Vertical; slider2.TickPlacement=TickPlacement.None; slider2.ValuePlacement=ValuePlacement.TopLeft; slider2.ShowValueLabel=true; slider2.SnapsTo=SnapsTo.None; slider2.Value=-3; slider2.LayoutParameters=sliderLayout; slider2.ValueChanged+= (object sender, SfRangeSlider.ValueChangedEventArgs e) => { textView5.Text=Convert.ToString(Math.Round(e.P1)+".0db"); }; layout2 = new LinearLayout(con); layout2.Orientation=droid.Vertical; layout2.SetGravity(GravityFlags.Center); textView2=new TextView(con); textView2.Text="170HZ"; textView2.TextSize=20; textView2.SetTextColor(Color.Black); textView2.Gravity=GravityFlags.Center; textView2.Typeface = Typeface.Create("Helvetica", TypefaceStyle.Normal); textView5 = new TextView(con); textView5.TextSize=14; textView5.SetTextColor(Color.Argb(255, 50, 180, 228)); textView5.Text="0.0db"; textView5.Typeface=Typeface.Create("Helvetica", TypefaceStyle.Normal); textView5.Gravity=GravityFlags.Center; layout2.AddView(textView2); layout2.AddView(textView5); layout2.AddView(textView7); layout2.AddView(slider2,sliderLayout); /** * Defining Third Slider */ slider3 = new SfRangeSlider(con); slider3.Minimum=-12; slider3.Maximum=12; slider3.TickFrequency=12; slider3.TrackSelectionColor=Color.Gray; slider3.Orientation=Com.Syncfusion.Sfrangeslider.Orientation.Vertical; slider3.TickPlacement=TickPlacement.None; slider3.ValuePlacement=ValuePlacement.TopLeft; slider3.ShowValueLabel=true; slider3.SnapsTo=SnapsTo.None; slider3.Value=12; slider3.LayoutParameters=sliderLayout; slider3.ValueChanged+= (object sender, SfRangeSlider.ValueChangedEventArgs e) => { textView6.Text=Convert.ToString(Math.Round(e.P1)+".0db"); }; layout3 = new LinearLayout(con); layout3.Orientation=droid.Vertical; layout3.SetGravity(GravityFlags.Center); textView3=new TextView(con); textView3.Text="310HZ"; textView3.TextSize=20; textView3.SetTextColor(Color.Black); textView3.Gravity=GravityFlags.Center; textView3.Typeface = Typeface.Create("Helvetica", TypefaceStyle.Normal); textView6 = new TextView(con); textView6.TextSize=14; textView6.SetTextColor(Color.Argb(255, 50, 180, 228)); textView6.Text="0.0db"; textView6.Typeface=Typeface.Create("Helvetica", TypefaceStyle.Normal); textView6.Gravity=GravityFlags.Center; layout3.AddView(textView3); layout3.AddView(textView6); layout3.AddView(textView8); layout3.AddView(slider3,sliderLayout); /** * Adding sliders to Layout */ mainLayout.AddView(layout1); mainLayout.AddView(layout2); mainLayout.AddView(layout3); return parentLayout; }
public override View GetSampleContent(Context con) { LinearLayout mainLayout, layout1, layout2, layout3;; int height = con.Resources.DisplayMetrics.HeightPixels / 2; int width = con.Resources.DisplayMetrics.WidthPixels / 3; /** * Defining Linear Layout */ mainLayout = new LinearLayout(con); mainLayout.SetBackgroundColor(Color.White); mainLayout.SetGravity(GravityFlags.Center); LinearLayout parentLayout = new LinearLayout(con); parentLayout.Orientation = droid.Vertical; parentLayout.SetBackgroundColor(Color.White); parentLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); FrameLayout.LayoutParams sliderLayout = new FrameLayout.LayoutParams(width, height + (height / 4)); textView = new TextView(con); textView7 = new TextView(con); textView8 = new TextView(con); textView9 = new TextView(con); textView9.Text = ""; textView.Typeface = Typeface.Create("Roboto", TypefaceStyle.Normal); textView9.TextSize = 20; textView9.Gravity = GravityFlags.Center; textView9.SetTextColor(Color.Argb(255, 182, 182, 182)); //parentLayout.AddView(textView9); textView10 = new TextView(con); parentLayout.AddView(textView10); parentLayout.AddView(mainLayout); parentLayout.SetGravity(GravityFlags.Center); /** * Defining First Slider */ slider1 = new SfRangeSlider(con); slider1.Minimum = -12; slider1.Maximum = 12; slider1.TickFrequency = 12; slider1.TrackSelectionColor = Color.Gray; slider1.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Vertical; slider1.TickPlacement = TickPlacement.None; slider1.ValuePlacement = ValuePlacement.TopLeft; slider1.ShowValueLabel = true; slider1.SnapsTo = SnapsTo.None; slider1.Value = 6; // slider1.setLayoutParams(sliderLayout); slider1.ValueChanged += (object sender, SfRangeSlider.ValueChangedEventArgs e) => { String str = (string)(Math.Round(e.P1) + ".0db"); textView4.Text = str; }; layout1 = new LinearLayout(con); layout1.Orientation = droid.Vertical; layout1.SetGravity(GravityFlags.Center); textView1 = new TextView(con); textView1.Text = "60HZ"; textView1.TextSize = 20; textView1.SetTextColor(Color.Black); textView1.Gravity = GravityFlags.Center; textView1.Typeface = Typeface.Create("Helvetica", TypefaceStyle.Normal); textView4 = new TextView(con); textView4.TextSize = 14; textView4.SetTextColor(Color.Argb(255, 50, 180, 228)); textView4.Text = "0.0db"; textView4.Typeface = Typeface.Create("Helvetica", TypefaceStyle.Normal); textView4.Gravity = GravityFlags.Center; layout1.AddView(textView1); layout1.AddView(textView4); layout1.AddView(textView); layout1.AddView(slider1, sliderLayout); /** * Defining Second Slider */ slider2 = new SfRangeSlider(con); slider2.Minimum = -12; slider2.Maximum = 12; slider2.TickFrequency = 12; slider2.TrackSelectionColor = Color.Gray; slider2.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Vertical; slider2.TickPlacement = TickPlacement.None; slider2.ValuePlacement = ValuePlacement.TopLeft; slider2.ShowValueLabel = true; slider2.SnapsTo = SnapsTo.None; slider2.Value = -3; slider2.LayoutParameters = sliderLayout; slider2.ValueChanged += (object sender, SfRangeSlider.ValueChangedEventArgs e) => { textView5.Text = Convert.ToString(Math.Round(e.P1) + ".0db"); }; layout2 = new LinearLayout(con); layout2.Orientation = droid.Vertical; layout2.SetGravity(GravityFlags.Center); textView2 = new TextView(con); textView2.Text = "170HZ"; textView2.TextSize = 20; textView2.SetTextColor(Color.Black); textView2.Gravity = GravityFlags.Center; textView2.Typeface = Typeface.Create("Helvetica", TypefaceStyle.Normal); textView5 = new TextView(con); textView5.TextSize = 14; textView5.SetTextColor(Color.Argb(255, 50, 180, 228)); textView5.Text = "0.0db"; textView5.Typeface = Typeface.Create("Helvetica", TypefaceStyle.Normal); textView5.Gravity = GravityFlags.Center; layout2.AddView(textView2); layout2.AddView(textView5); layout2.AddView(textView7); layout2.AddView(slider2, sliderLayout); /** * Defining Third Slider */ slider3 = new SfRangeSlider(con); slider3.Minimum = -12; slider3.Maximum = 12; slider3.TickFrequency = 12; slider3.TrackSelectionColor = Color.Gray; slider3.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Vertical; slider3.TickPlacement = TickPlacement.None; slider3.ValuePlacement = ValuePlacement.TopLeft; slider3.ShowValueLabel = true; slider3.SnapsTo = SnapsTo.None; slider3.Value = 12; slider3.LayoutParameters = sliderLayout; slider3.ValueChanged += (object sender, SfRangeSlider.ValueChangedEventArgs e) => { textView6.Text = Convert.ToString(Math.Round(e.P1) + ".0db"); }; layout3 = new LinearLayout(con); layout3.Orientation = droid.Vertical; layout3.SetGravity(GravityFlags.Center); textView3 = new TextView(con); textView3.Text = "310HZ"; textView3.TextSize = 20; textView3.SetTextColor(Color.Black); textView3.Gravity = GravityFlags.Center; textView3.Typeface = Typeface.Create("Helvetica", TypefaceStyle.Normal); textView6 = new TextView(con); textView6.TextSize = 14; textView6.SetTextColor(Color.Argb(255, 50, 180, 228)); textView6.Text = "0.0db"; textView6.Typeface = Typeface.Create("Helvetica", TypefaceStyle.Normal); textView6.Gravity = GravityFlags.Center; layout3.AddView(textView3); layout3.AddView(textView6); layout3.AddView(textView8); layout3.AddView(slider3, sliderLayout); /** * Adding sliders to Layout */ mainLayout.AddView(layout1); mainLayout.AddView(layout2); mainLayout.AddView(layout3); return(parentLayout); }
public override View GetSampleContent(Context con) { LinearLayout linearLayout = new LinearLayout(con); linearLayout.SetPadding(20, 20, 20, 30); linearLayout.SetBackgroundColor(Color.Rgb(236, 235, 242)); linearLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); linearLayout.Orientation = Android.Widget.Orientation.Vertical; TextView textView3 = new TextView(con); textView3.TextSize = 20; textView3.Text = " " + "Departure"; textView3.SetTextColor(Color.Black); range = new SfRangeSlider(con); range.Minimum = 0; range.Maximum = 12; range.TickFrequency = 2; range.ShowValueLabel = showlabel; range.StepFrequency = 6; range.DirectionReversed = false; range.ValuePlacement = valueplacement; range.RangeEnd = 12; range.RangeStart = 0; range.TickPlacement = tickplacement; range.ShowRange = showlabel; range.SnapsTo = snapsto; range.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Horizontal; range.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 150); LinearLayout depstack = new LinearLayout(con); depstack.Orientation = Android.Widget.Orientation.Horizontal; depstack.AddView(textView3); TextView textView4 = new TextView(con); textView4.TextSize = 13; textView4.Text = " " + "(in Hours)"; textView4.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.MatchParent); textView4.SetTextColor(Color.ParseColor("#939394")); textView4.Gravity = GravityFlags.Center; depstack.AddView(textView4); TextView textView7 = new TextView(con); textView7.SetHeight(50); linearLayout.AddView(textView7); linearLayout.AddView(depstack); TextView textView10 = new TextView(con); TextView textView12 = new TextView(con); linearLayout.AddView(textView12); linearLayout.AddView(textView10); linearLayout.AddView(range); textView10.TextSize = 13; val3 = "12"; val4 = Math.Round(range.RangeEnd).ToString(); textView10.SetTextColor(Color.ParseColor("#939394")); textView10.Text = " " + "Time: " + val3 + "AM " + " - " + val4 + " PM"; textView10.Gravity = GravityFlags.Left; range.RangeChanged += (object sender, SfRangeSlider.RangeChangedEventArgs e) => { String pmstr2 = "AM", pmstr1 = "AM"; if (Math.Round(e.P1).ToString() == "0") { val3 = "12"; pmstr1 = "AM"; } else { val3 = Convert.ToString(Math.Round(e.P1)); } if (e.P2 <= 12) { val4 = Convert.ToString(Math.Round(e.P2)); } if (Math.Round(e.P2).ToString() == "12") { pmstr2 = "PM"; } if (Math.Round(e.P2).ToString() == "12") { pmstr2 = "PM"; } if (Convert.ToString(Math.Round(e.P1)).Equals(Convert.ToString(Math.Round(e.P2)))) { if (Math.Round(e.P1).ToString() == "0") { textView10.Text = " " + "Time: " + val3 + " " + pmstr1; } else if (Math.Round(e.P2).ToString() == "12") { textView10.Text = " " + "Time: " + val4 + " " + pmstr2; } else { textView10.Text = " " + "Time: " + val3 + " " + pmstr1; } } else { textView10.Text = " " + "Time: " + val3 + " " + pmstr1 + " - " + val4 + " " + pmstr2; } }; TextView textView6 = new TextView(con); textView6.SetHeight(70); linearLayout.AddView(textView6); TextView textView2 = new TextView(con); textView2.TextSize = 20; textView2.Text = " " + "Arrival"; textView2.SetTextColor(Color.Black); //linearLayout.AddView(textView2); range2 = new SfRangeSlider(con); range2.Minimum = 0; range2.Maximum = 12; range2.TickFrequency = 2; range2.ShowValueLabel = showlabel; range2.StepFrequency = 6; range2.DirectionReversed = false; range2.ValuePlacement = valueplacement; range2.RangeEnd = 12; range2.RangeStart = 0; range2.TickPlacement = tickplacement; range2.ShowRange = showlabel; range2.SnapsTo = snapsto; range2.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Horizontal; range2.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 150); TextView textView5 = new TextView(con); textView5.TextSize = 13; textView5.Text = " " + "(in Hours)"; textView5.Gravity = GravityFlags.Center; textView5.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.MatchParent); textView5.SetTextColor(Color.ParseColor("#939394")); TextView textView8 = new TextView(con); textView8.SetHeight(50); LinearLayout arrivestack = new LinearLayout(con); arrivestack.Orientation = Android.Widget.Orientation.Horizontal; arrivestack.AddView(textView2); arrivestack.AddView(textView5); linearLayout.AddView(textView8); linearLayout.AddView(arrivestack); TextView textView13 = new TextView(con); linearLayout.AddView(textView13); TextView textView9 = new TextView(con); linearLayout.AddView(textView9); linearLayout.AddView(range2); textView9.TextSize = 13; textView9.SetTextColor(Color.ParseColor("#939394")); val1 = "12"; val2 = Math.Round(range2.RangeEnd).ToString(); textView9.Text = " " + "Time: " + val1 + "AM " + " - " + val2 + " PM"; textView9.Gravity = GravityFlags.Left; range2.RangeChanged += (object sender, SfRangeSlider.RangeChangedEventArgs e) => { String pmstr2 = "AM", pmstr1 = "AM"; if (Math.Round(e.P1).ToString() == "0") { val1 = "12"; pmstr1 = "AM"; } else { val1 = Convert.ToString(Math.Round(e.P1)); } if (e.P2 <= 12) { val2 = Convert.ToString(Math.Round(e.P2)); } if (Math.Round(e.P2).ToString() == "12") { pmstr2 = "PM"; } if (Convert.ToString(Math.Round(e.P1)).Equals(Convert.ToString(Math.Round(e.P2)))) { if (Math.Round(e.P1).ToString() == "0") { textView9.Text = " " + "Time: " + val1 + " " + pmstr1; } else if (Math.Round(e.P2).ToString() == "12") { textView9.Text = " " + "Time: " + val2 + " " + pmstr2; } else { textView9.Text = " " + "Time: " + val1 + " " + pmstr1; } } else { textView9.Text = " " + "Time: " + val1 + " " + pmstr1 + " - " + val2 + " " + pmstr2; } }; return(linearLayout); }
public void SetValue(SfRangeSlider r, nfloat start, nfloat end) { if (r == rangeSlider1) { if (Math.Round(start) < 1) { if (Math.Round(end) == 12) { timeLabel2.Text = "Time: 12 AM - " + Math.Round(end) + " PM"; } else { timeLabel2.Text = "Time: 12 AM - " + Math.Round(end) + " AM"; } } else { if (Math.Round(end) == 12) { timeLabel2.Text = "Time: " + Math.Round(start) + " AM - " + Math.Round(end) + " PM"; } else { timeLabel2.Text = "Time: " + Math.Round(start) + " AM - " + Math.Round(end) + " AM"; } } if (Math.Round(start) == Math.Round(end)) { if (Math.Round(start) < 1) { timeLabel2.Text = "Time: 12 AM"; } else if (Math.Round(start) == 12) { timeLabel2.Text = "Time: 12 PM"; } else { timeLabel2.Text = "Time: " + Math.Round(start) + " AM"; } } } else if (r == rangeSlider2) { if (Math.Round(start) < 1) { if (Math.Round(end) == 12) { timeLabel3.Text = "Time: 12 AM - " + Math.Round(end) + " PM"; } else { timeLabel3.Text = "Time: 12 AM - " + Math.Round(end) + " AM"; } } else { if (Math.Round(end) == 12) { timeLabel3.Text = "Time: " + Math.Round(start) + " AM - " + Math.Round(end) + " PM"; } else { timeLabel3.Text = "Time: " + Math.Round(start) + " AM - " + Math.Round(end) + " AM"; } } if (Math.Round(start) == Math.Round(end)) { if (Math.Round(start) < 1) { timeLabel3.Text = "Time: 12 AM"; } else if (Math.Round(start) == 12) { timeLabel3.Text = "Time: 12 PM"; } else { timeLabel3.Text = "Time: " + Math.Round(start) + " AM"; } } } }
private StackLayout GetRangeSlider() { SfRangeSlider sfRangeSlider1; Label label,label1,label3; Image image = new Image (); image.WidthRequest = 280; image.HeightRequest = 280; image.Source = ImageSource.FromFile ("mount.jpg"); sfRangeSlider1 = new SfRangeSlider(); sfRangeSlider1.ShowRange = false; sfRangeSlider1.HeightRequest = 80; sfRangeSlider1.WidthRequest = 200; sfRangeSlider1.Minimum = 0; sfRangeSlider1.Maximum = 100; sfRangeSlider1.TickFrequency = 20; sfRangeSlider1.ShowValueLabel = true; sfRangeSlider1.Value = 100; sfRangeSlider1.SnapsTo = SnapsTo.None; sfRangeSlider1.Orientation = Syncfusion.SfRangeSlider.XForms.Orientation.Horizontal; sfRangeSlider1.TickPlacement = TickPlacement.BottomRight; sfRangeSlider1.ValueChanging+= (object sender, ValueEventArgs e) => { image.Opacity = (double)(e.Value/100); }; this.BackgroundColor = Color.White; label = new Label () { Text = "", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; label1 = new Label () { Text = " Opacity", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; if (Device.OS == TargetPlatform.iOS) { label3 = new Label () { Text = "\n Slider", HeightRequest = 20, YAlign = TextAlignment.Start, TextColor = Color.Black, XAlign = TextAlignment.Start }; } else { label3 = new Label () { Text = "Slider", HeightRequest = 30, YAlign = TextAlignment.Start, TextColor = Color.Black, XAlign = TextAlignment.Center }; } label3.FontAttributes = FontAttributes.Bold; if(Device.OS == TargetPlatform.WinPhone) { sfRangeSlider1.BackgroundColor = Color.Gray; sfRangeSlider1.HeightRequest = 130; this.BackgroundColor = Color.Black; sfRangeSlider1.KnobColor = Color.White; label1.TextColor = Color.White; label.TextColor = Color.White; image.WidthRequest = 400; image.HeightRequest = 400; image.Aspect = Aspect.AspectFit; image.Source = ImageSource.FromFile("mount.jpg"); } if (Device.OS == TargetPlatform.Windows) { //sfRangeSlider1.BackgroundColor = Color.Gray; sfRangeSlider1.HeightRequest = 150; this.BackgroundColor = Color.Black; sfRangeSlider1.KnobColor = Color.Gray; label1.TextColor = Color.Black; label.TextColor = Color.Black; image.WidthRequest = 400; image.HeightRequest = 400; image.Aspect = Aspect.AspectFit; image.Source = ImageSource.FromFile("mount.jpg"); if (Device.Idiom != TargetIdiom.Tablet) { sfRangeSlider1.TrackColor = Color.Gray; this.BackgroundColor = Color.Black; label1.TextColor = Color.White; label.TextColor = Color.White; } } var mainStack1 = new StackLayout { Spacing = 0, VerticalOptions = LayoutOptions.Center, Padding = Device.OnPlatform(iOS: 0, Android: 0, WinPhone: 30), Children = { label1, sfRangeSlider1 } }; var mainStack = new StackLayout(); if (Device.OS == TargetPlatform.WinPhone) { mainStack = new StackLayout { Spacing = 20, VerticalOptions = LayoutOptions.Center, Padding = Device.OnPlatform(iOS: 10, Android: 10, WinPhone: 10), Children = {label3, image, mainStack1 } }; } else { mainStack = new StackLayout { Spacing = 20, VerticalOptions = LayoutOptions.Center, Padding = Device.OnPlatform(iOS: 10, Android: 10, WinPhone: 10), Children = {image, mainStack1 } }; } return mainStack; }
private StackLayout GetRangeSlider() { SfRangeSlider sfRangeSlider1; Label label, label1, label3; Image image = new Image(); image.WidthRequest = 280; image.HeightRequest = 280; image.Source = ImageSource.FromFile("mount.jpg"); sfRangeSlider1 = new SfRangeSlider(); sfRangeSlider1.ShowRange = false; sfRangeSlider1.HeightRequest = 80; sfRangeSlider1.WidthRequest = 200; sfRangeSlider1.Minimum = 0; sfRangeSlider1.Maximum = 100; sfRangeSlider1.TickFrequency = 20; sfRangeSlider1.ShowValueLabel = true; sfRangeSlider1.Value = 100; sfRangeSlider1.SnapsTo = SnapsTo.None; sfRangeSlider1.Orientation = Syncfusion.SfRangeSlider.XForms.Orientation.Horizontal; sfRangeSlider1.TickPlacement = TickPlacement.BottomRight; sfRangeSlider1.ValueChanging += (object sender, ValueEventArgs e) => { image.Opacity = (double)(e.Value / 100); }; this.BackgroundColor = Color.White; label = new Label() { Text = "", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; label1 = new Label() { Text = " Opacity", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; if (Device.OS == TargetPlatform.iOS) { label3 = new Label() { Text = "\n Slider", HeightRequest = 20, YAlign = TextAlignment.Start, TextColor = Color.Black, XAlign = TextAlignment.Start }; } else { label3 = new Label() { Text = "Slider", HeightRequest = 30, YAlign = TextAlignment.Start, TextColor = Color.Black, XAlign = TextAlignment.Center }; } label3.FontAttributes = FontAttributes.Bold; if (Device.OS == TargetPlatform.WinPhone) { sfRangeSlider1.BackgroundColor = Color.Gray; sfRangeSlider1.HeightRequest = 130; this.BackgroundColor = Color.Black; sfRangeSlider1.KnobColor = Color.White; label1.TextColor = Color.White; label.TextColor = Color.White; image.WidthRequest = 400; image.HeightRequest = 400; image.Aspect = Aspect.AspectFit; image.Source = ImageSource.FromFile("mount.jpg"); } if (Device.OS == TargetPlatform.Windows) { //sfRangeSlider1.BackgroundColor = Color.Gray; sfRangeSlider1.HeightRequest = 150; this.BackgroundColor = Color.Black; sfRangeSlider1.KnobColor = Color.Gray; label1.TextColor = Color.Black; label.TextColor = Color.Black; image.WidthRequest = 400; image.HeightRequest = 400; image.Aspect = Aspect.AspectFit; image.Source = ImageSource.FromFile("mount.jpg"); if (Device.Idiom != TargetIdiom.Tablet) { sfRangeSlider1.TrackColor = Color.Gray; this.BackgroundColor = Color.Black; label1.TextColor = Color.White; label.TextColor = Color.White; } } var mainStack1 = new StackLayout { Spacing = 0, VerticalOptions = LayoutOptions.Center, Padding = Device.OnPlatform(iOS: 0, Android: 0, WinPhone: 30), Children = { label1, sfRangeSlider1 } }; var mainStack = new StackLayout(); if (Device.OS == TargetPlatform.WinPhone) { mainStack = new StackLayout { Spacing = 20, VerticalOptions = LayoutOptions.Center, Padding = Device.OnPlatform(iOS: 10, Android: 10, WinPhone: 10), Children = { label3, image, mainStack1 } }; } else { mainStack = new StackLayout { Spacing = 20, VerticalOptions = LayoutOptions.Center, Padding = Device.OnPlatform(iOS: 10, Android: 10, WinPhone: 10), Children = { image, mainStack1 } }; } return(mainStack); }
private StackLayout GetRangeSlider() { SfRangeSlider sfRangeSlider1; SfRangeSlider sfRangeSlider2; SfRangeSlider sfRangeSlider3; Label label, label1, label2, label3, label4, label5, label6; sfRangeSlider1 = new SfRangeSlider (); sfRangeSlider1.HeightRequest = 400; sfRangeSlider1.WidthRequest = 85; sfRangeSlider1.Minimum = -12; sfRangeSlider1.Maximum = 12; sfRangeSlider1.RangeStart = -12; sfRangeSlider1.RangeEnd = 2.2; sfRangeSlider1.Value = 2.2; sfRangeSlider1.TickFrequency = 12; sfRangeSlider1.SnapsTo = SnapsTo.None; sfRangeSlider1.Orientation = Syncfusion.SfRangeSlider.XForms.Orientation.Vertical; sfRangeSlider1.ValuePlacement = ValuePlacement.TopLeft; sfRangeSlider1.TickPlacement = TickPlacement.None; sfRangeSlider1.ShowRange = false; sfRangeSlider1.TrackSelectionColor = Color.Gray; //sfRangeSlider1.SetValue (0); sfRangeSlider2 = new SfRangeSlider (); sfRangeSlider2.HeightRequest = 400; sfRangeSlider2.WidthRequest = 85; sfRangeSlider2.Minimum = -12; sfRangeSlider2.Maximum = 12; sfRangeSlider2.RangeStart = -12; sfRangeSlider2.RangeEnd = -4.7; sfRangeSlider2.Value = -4.7; sfRangeSlider2.TickFrequency = 12; sfRangeSlider2.SnapsTo = SnapsTo.None; sfRangeSlider2.Orientation = Syncfusion.SfRangeSlider.XForms.Orientation.Vertical; sfRangeSlider2.TickPlacement = TickPlacement.None; sfRangeSlider2.ValuePlacement = ValuePlacement.TopLeft; sfRangeSlider2.ShowRange = false; sfRangeSlider2.TrackSelectionColor = Color.Gray; //sfRangeSlider2.SetValue (12); sfRangeSlider3 = new SfRangeSlider (); sfRangeSlider3.HeightRequest = 400; sfRangeSlider3.WidthRequest = 85; sfRangeSlider3.Minimum = -12; sfRangeSlider3.Maximum = 12; sfRangeSlider3.RangeStart = -12; sfRangeSlider3.Value = 6; sfRangeSlider3.RangeEnd = 6; sfRangeSlider3.TickFrequency = 12; sfRangeSlider3.SnapsTo = SnapsTo.None; sfRangeSlider3.Orientation = Syncfusion.SfRangeSlider.XForms.Orientation.Vertical; sfRangeSlider3.TickPlacement = TickPlacement.None; sfRangeSlider3.ValuePlacement = ValuePlacement.TopLeft; sfRangeSlider3.ShowRange = false; sfRangeSlider3.TrackSelectionColor = Color.Gray; //sfRangeSlider3.SetValue (-12); this.BackgroundColor = Color.White; if (Device.OS == TargetPlatform.WinPhone) { label = new Label() { FontSize = 20, Text = "\t\t" + "60Hz", HeightRequest = 24, YAlign = TextAlignment.Center, TextColor = Color.FromRgb(109, 109, 114), XAlign = TextAlignment.Center }; label1 = new Label() { FontSize = 20, Text = "\t\t" + "170Hz", HeightRequest = 24, YAlign = TextAlignment.Center, TextColor = Color.FromRgb(109, 109, 114), XAlign = TextAlignment.Center }; label2 = new Label() { FontSize = 20, Text = "\t\t" + "310Hz", HeightRequest = 24, YAlign = TextAlignment.Center, TextColor = Color.FromRgb(109, 109, 114), XAlign = TextAlignment.Center }; label3 = new Label() { FontSize = 12, Text = "\t\t\t" + "2.2db", HeightRequest = 30, YAlign = TextAlignment.Start, TextColor = Color.FromRgb(57, 181, 247), XAlign = TextAlignment.Center }; label4 = new Label() { FontSize = 12, Text = "\t\t\t" + "-4.7db", HeightRequest = 30, YAlign = TextAlignment.Start, TextColor = Color.FromRgb(57, 181, 247), XAlign = TextAlignment.Center }; label5 = new Label() { FontSize = 12, Text = "\t\t\t" + "6db", HeightRequest = 30, YAlign = TextAlignment.Start, TextColor = Color.FromRgb(57, 181, 247), XAlign = TextAlignment.Center }; } else { label = new Label() { FontSize = 20, Text ="60Hz", HeightRequest = 24, YAlign = TextAlignment.Center, TextColor = Color.FromRgb(109, 109, 114), XAlign = TextAlignment.Center }; label1 = new Label() { FontSize = 20, Text ="170Hz", HeightRequest = 24, YAlign = TextAlignment.Center, TextColor = Color.FromRgb(109, 109, 114), XAlign = TextAlignment.Center }; label2 = new Label() { FontSize = 20, Text ="310Hz", HeightRequest = 24, YAlign = TextAlignment.Center, TextColor = Color.FromRgb(109, 109, 114), XAlign = TextAlignment.Center }; label3 = new Label() { FontSize = 12, Text ="2.2db", HeightRequest = 30, YAlign = TextAlignment.Start, TextColor = Color.FromRgb(57, 181, 247), XAlign = TextAlignment.Center }; label4 = new Label() { FontSize = 12, Text ="-4.7db", HeightRequest = 30, YAlign = TextAlignment.Start, TextColor = Color.FromRgb(57, 181, 247), XAlign = TextAlignment.Center }; label5 = new Label() { FontSize = 12, Text ="6db", HeightRequest = 30, YAlign = TextAlignment.Start, TextColor = Color.FromRgb(57, 181, 247), XAlign = TextAlignment.Center }; } label6 = new Label () { FontSize = 20, Text = "", HeightRequest = 1, YAlign = TextAlignment.End, TextColor = Color.FromRgb(109,109,114), XAlign = TextAlignment.Center }; if (Device.OS == TargetPlatform.WinPhone) { sfRangeSlider1.BackgroundColor = Color.Gray; sfRangeSlider2.BackgroundColor = Color.Gray; sfRangeSlider3.BackgroundColor = Color.Gray; this.BackgroundColor = Color.Black; } if (Device.OS == TargetPlatform.iOS) { sfRangeSlider1.WidthRequest = 90; sfRangeSlider2.WidthRequest = 90; sfRangeSlider3.WidthRequest = 90; sfRangeSlider1.HeightRequest = 300; sfRangeSlider2.HeightRequest = 300; sfRangeSlider3.HeightRequest = 300; } else if(Device.OS == TargetPlatform.WinPhone) { sfRangeSlider1.WidthRequest = 120; sfRangeSlider2.WidthRequest = 120; sfRangeSlider3.WidthRequest = 120; sfRangeSlider1.HeightRequest = 600; sfRangeSlider2.HeightRequest = 600; sfRangeSlider3.HeightRequest = 600; sfRangeSlider1.KnobColor = Color.White; sfRangeSlider2.KnobColor = Color.White; sfRangeSlider3.KnobColor = Color.White; sfRangeSlider1.TrackSelectionColor = Color.Gray; sfRangeSlider2.TrackSelectionColor = Color.Gray; sfRangeSlider3.TrackSelectionColor = Color.Gray; } else if (Device.OS == TargetPlatform.Windows && Device.Idiom != TargetIdiom.Tablet) { this.BackgroundColor = Color.Black; label.TextColor = label1.TextColor = label2.TextColor = label3.TextColor = label4.TextColor = label5.TextColor = label6.TextColor = Color.White; sfRangeSlider1.TrackSelectionColor = sfRangeSlider2.TrackSelectionColor = sfRangeSlider3.TrackSelectionColor = Color.Gray; sfRangeSlider1.TrackColor = sfRangeSlider2.TrackColor = sfRangeSlider3.TrackColor = Color.Gray; } sfRangeSlider1.ValueChanging += (object sender, ValueEventArgs e) => { double f = Math.Round(e.Value,1); if(Device.OS == TargetPlatform.WinPhone) label3.Text = "\t\t\t" + f + "db"; else label3.Text = f + "db"; }; sfRangeSlider2.ValueChanging+= (object sender, ValueEventArgs e) => { double f = Math.Round(e.Value,1); if (Device.OS == TargetPlatform.WinPhone) label4.Text = "\t\t\t" + f + "db"; else label4.Text = f + "db"; }; sfRangeSlider3.ValueChanging+= (object sender, ValueEventArgs e) => { double f = Math.Round(e.Value,1); if(Device.OS == TargetPlatform.WinPhone) label5.Text = "\t\t\t" + f + "db"; else label5.Text = f + "db"; }; var mainStack1 = new StackLayout { Spacing = 1, Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.Center, Padding = Device.OnPlatform (iOS: 10, Android : 10, WinPhone : 10), Children = { label, label3, sfRangeSlider1 } }; var mainStack2 = new StackLayout { Spacing = 1, Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.Center, Padding = Device.OnPlatform (iOS: 10, Android : 10, WinPhone : 10), Children = { label1, label4, sfRangeSlider2 } }; var mainStack3 = new StackLayout { Spacing = 1, Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.Center, Padding = Device.OnPlatform (iOS: 10, Android : 10, WinPhone : 10), Children = { label2, label5, sfRangeSlider3 } }; var mainStack = new StackLayout { Spacing = 1, Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.Center, Padding = Device.OnPlatform(iOS: 0, Android : 0, WinPhone : 0), Children = { mainStack1, mainStack2, mainStack3 } }; var mainStack4 = new StackLayout { Spacing = 1, Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.FillAndExpand, Padding = Device.OnPlatform (iOS: 10, Android : 10, WinPhone : 1), Children = { label6, mainStack } }; return mainStack4; }
public RangeSlider () { //InitializeComponent (); sfRangeSlider1 = new SfRangeSlider(); sfRangeSlider2 = new SfRangeSlider(); sfRangeSlider1.HeightRequest = 90; sfRangeSlider1.WidthRequest = 200; sfRangeSlider1.Minimum = 0; sfRangeSlider1.Maximum = 12; sfRangeSlider1.RangeStart = 0; sfRangeSlider1.RangeEnd = 12; sfRangeSlider1.TickFrequency = 2; sfRangeSlider1.SnapsTo = SnapsTo.None; sfRangeSlider1.Orientation = Syncfusion.SfRangeSlider.XForms.Orientation.Horizontal; sfRangeSlider1.TickPlacement = TickPlacement.BottomRight; sfRangeSlider2.HeightRequest = 90; sfRangeSlider2.WidthRequest = 200; sfRangeSlider2.Minimum = 0; sfRangeSlider2.Maximum = 12; sfRangeSlider2.RangeStart = 0; sfRangeSlider2.RangeEnd = 12; sfRangeSlider2.TickFrequency = 2; sfRangeSlider2.SnapsTo = SnapsTo.None; sfRangeSlider2.Orientation = Syncfusion.SfRangeSlider.XForms.Orientation.Horizontal; sfRangeSlider2.TickPlacement = TickPlacement.BottomRight; Title = "Getting Started"; toggleButton = new Switch(); toggleButton2 = new Switch(); picker1 = new PickerExt(); picker2 = new PickerExt(); sfRangeSlider1.RangeChanging += (object sender, RangeEventArgs e) => { if (Math.Round (e.Start) < 1) { if (Math.Round (e.End) == 12) label10.Text = "12 AM - " + Math.Round (e.End) + " PM"; else label10.Text = "12 AM - " + Math.Round (e.End) + " AM"; } else { if (Math.Round (e.End) == 12) label10.Text = Math.Round (e.Start) + " AM - " + Math.Round (e.End) + " PM"; else label10.Text = Math.Round (e.Start) + " AM - " + Math.Round (e.End) + " AM"; } if (Math.Round (e.Start) == Math.Round (e.End)) { if (Math.Round (e.Start) < 1) label10.Text = "12 AM"; else if(Math.Round (e.Start) == 12) label10.Text = "12 PM"; else label10.Text = Math.Round (e.Start) + " AM"; } }; sfRangeSlider2.RangeChanging+= (object sender, RangeEventArgs e) => { if (Math.Round (e.Start) < 1) { if (Math.Round (e.End) == 12) label11.Text = "12 AM - " + Math.Round (e.End) + " PM"; else label11.Text = "12 AM - " + Math.Round (e.End) + " AM"; } else { if (Math.Round (e.End) == 12) label11.Text = Math.Round (e.Start) + " AM - " + Math.Round (e.End) + " PM"; else label11.Text = Math.Round (e.Start) + " AM - " + Math.Round (e.End) + " AM"; } if (Math.Round (e.Start) == Math.Round (e.End)) { if (Math.Round (e.Start) < 1) label11.Text = "12 AM"; else if(Math.Round (e.Start) == 12) label11.Text = "12 PM"; else label11.Text = Math.Round (e.Start) + " AM"; } }; toggleButton.Toggled += toggleStateChanged; toggleButton2.Toggled += toggleStateChanged1; toggleButton.IsToggled = true; picker1.Items.Add("TopLeft"); picker1.Items.Add("BottomRight"); picker1.Items.Add("Inline"); picker1.Items.Add("Outside"); picker1.Items.Add("None"); picker1.HeightRequest = 40; picker1.SelectedIndex = 1; picker1.SelectedIndexChanged += picker1_SelectedIndexChanged; picker2.Items.Add("TopLeft"); picker2.Items.Add("BottomRight"); picker2.HeightRequest = 40; picker2.SelectedIndex = 1; picker2.SelectedIndexChanged += picker2_SelectedIndexChanged; picker1.BackgroundColor = Color.White; picker2.BackgroundColor = Color.White; label6 = new Label() { Text = " " + "Settings", FontSize = 60, HeightRequest = 60, YAlign = TextAlignment.End, TextColor = Color.White }; label3 = new Label() { Text = "Tick Placement", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; label4 = new Label() { Text = "Label Placement", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; label5 = new Label() { Text = "Label", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.Black, }; label9 = new Label() { Text = "SnapsToTick", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.Black }; if (Device.OS == TargetPlatform.Windows && Device.Idiom != TargetIdiom.Tablet) { label9.TextColor = Color.White; } label10 = new Label() { FontSize = 12, Text = "12 AM - 12 PM", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; label11 = new Label() { FontSize = 12, Text = "12 AM - 12 PM", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; if (Device.OS == TargetPlatform.Android) { time = new Label() { FontSize = 12, Text = " Time: ", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; time1 = new Label() { FontSize = 12, Text = " Time: ", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; label = new Label() { XAlign = TextAlignment.Start, Text = " Departure", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; label1 = new Label() { XAlign = TextAlignment.Start, Text = " Arrival", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; } else if (Device.OS == TargetPlatform.iOS) { time = new Label() { FontSize = 12, Text = " Time: ", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; time1 = new Label() { FontSize = 12, Text = " Time: ", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; label = new Label() { XAlign = TextAlignment.Start, Text = " Departure", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; label1 = new Label() { XAlign = TextAlignment.Start, Text = " Arrival", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; } else { time1 = new Label() { FontSize = 12, Text = "Time: ", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; time = new Label() { FontSize = 12, Text = "Time: ", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; label = new Label() { XAlign = TextAlignment.Start, Text = "Departure", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; label1 = new Label() { XAlign = TextAlignment.Start, Text = "Arrival", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; if (Device.OS == TargetPlatform.Windows && Device.Idiom != TargetIdiom.Tablet) { label.TextColor = Color.White; label1.TextColor = Color.White; } } if (Device.OS == TargetPlatform.Android) { picker1.BackgroundColor = Color.FromRgb(239, 239, 239); picker2.BackgroundColor = Color.FromRgb(239, 239, 239); label3.FontSize = 20; label4.FontSize = 20; label5.FontSize = 20; label9.FontSize = 20; } label10.WidthRequest = sfRangeSlider1.Width; label11.WidthRequest = sfRangeSlider1.Width; label5.WidthRequest = label9.Width; ContentView = GetRangeSlider(); PropertyView = GetOptionPage (); }
private FrameLayout SetOptionPage(Context context) { FrameLayout propertyLayout = new FrameLayout(context); LinearLayout layout = new LinearLayout(context); layout.Orientation = Android.Widget.Orientation.Vertical; layout.SetBackgroundColor(Color.White); layout.SetPadding(15, 15, 15, 20); monthViewLayout = new LinearLayout(context); monthViewLayout.Orientation = Android.Widget.Orientation.Vertical; monthViewLayout.SetBackgroundColor(Color.White); monthViewLayout.SetPadding(15, 15, 15, 20); otherviewsLayout = new LinearLayout(context); otherviewsLayout.Orientation = Android.Widget.Orientation.Vertical; otherviewsLayout.SetBackgroundColor(Color.White); otherviewsLayout.SetPadding(15, 15, 15, 20); //Schedule Type TextView scheduleType_txtBlock = new TextView(context); scheduleType_txtBlock.Text = "Select the Schedule Type"; scheduleType_txtBlock.TextSize = 20; scheduleType_txtBlock.SetPadding(0, 0, 0, 10); scheduleType_txtBlock.SetTextColor(Color.Black); Spinner sType_spinner = new Spinner(context, SpinnerMode.Dialog); sType_spinner.SetMinimumHeight(60); sType_spinner.SetBackgroundColor(Color.Gray); sType_spinner.DropDownWidth = 600; sType_spinner.SetPadding(10, 10, 0, 10); sType_spinner.SetGravity(GravityFlags.CenterHorizontal); layout.AddView(scheduleType_txtBlock); layout.AddView(sType_spinner); List <String> list = new List <String>(); list.Add("Week View"); list.Add("Day View"); list.Add("Work Week View"); list.Add("Month View"); ArrayAdapter <String> dataAdapter = new ArrayAdapter <String>(context, Android.Resource.Layout.SimpleSpinnerItem, list); dataAdapter.SetDropDownViewResource (Android.Resource.Layout.SimpleSpinnerDropDownItem); sType_spinner.Adapter = dataAdapter; sType_spinner.ItemSelected += sType_spinner_ItemSelected; View divider1 = new View(context); divider1.LayoutParameters = (new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 2)); divider1.SetBackgroundColor(Color.Gray); otherviewsLayout.AddView(divider1); //Working Hours Duration workingHours_txtBlock = new TextView(context); workingHours_txtBlock.SetPadding(0, 20, 0, 0); workingHours_txtBlock.Text = "Working Hours Duration"; workingHours_txtBlock.TextSize = 20; workingHours_txtBlock.SetTextColor(Color.Black); workHour_rangeSlider = new SfRangeSlider(context); workHour_rangeSlider.SetPadding(0, 0, 0, 30); workHour_rangeSlider.Minimum = 0; workHour_rangeSlider.Maximum = 24; workHour_rangeSlider.TickFrequency = 2; workHour_rangeSlider.StepFrequency = 1; workHour_rangeSlider.RangeStart = weekViewSetting.WorkStartHour; workHour_rangeSlider.RangeEnd = weekViewSetting.WorkEndHour; workHour_rangeSlider.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 100); workHour_rangeSlider.RangeChanged += workHour_rangeSlider_RangeChanged; workHour_rangeSlider.ShowRange = true; workHour_rangeSlider.ValuePlacement = ValuePlacement.TopLeft; workHour_rangeSlider.ToolTipPlacement = ToolTipPlacement.None; workHour_rangeSlider.TickPlacement = TickPlacement.None; workHour_rangeSlider.ShowValueLabel = true; workHour_rangeSlider.SnapsTo = SnapsTo.StepValues; if (context.Resources.DisplayMetrics.Density < 2) { workHour_rangeSlider.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 150); } else if (context.Resources.DisplayMetrics.Density == 2) { workHour_rangeSlider.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 200); } else { workHour_rangeSlider.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 250); } otherviewsLayout.AddView(workingHours_txtBlock); otherviewsLayout.AddView(workHour_rangeSlider); View divider2 = new View(context); divider2.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 2); divider2.SetBackgroundColor(Color.Gray); otherviewsLayout.AddView(divider2); show_Non_Accessible_Block_checkBox = new CheckBox(context); show_Non_Accessible_Block_checkBox.SetPadding(0, 10, 0, 10); show_Non_Accessible_Block_checkBox.Text = "Show Non-Accessible Blocks"; show_Non_Accessible_Block_checkBox.TextSize = 20; show_Non_Accessible_Block_checkBox.SetTextColor(Color.Black); show_Non_Accessible_Block_checkBox.Checked = true; show_Non_Accessible_Block_checkBox.CheckedChange += show_Non_Accessible_Block_checkBox_CheckedChange; otherviewsLayout.AddView(show_Non_Accessible_Block_checkBox); View monthlayoutDivider = new View(context); monthlayoutDivider.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 2); monthlayoutDivider.SetBackgroundColor(Color.Gray); monthViewLayout.AddView(monthlayoutDivider); //Show black out dates show_Blackout_Dates = new CheckBox(context); show_Blackout_Dates.SetPadding(0, 10, 0, 10); show_Blackout_Dates.Text = "Show Blackout days"; show_Blackout_Dates.TextSize = 20; show_Blackout_Dates.Checked = true; show_Blackout_Dates.SetTextColor(Color.Black); show_Blackout_Dates.CheckedChange += show_Blackout_Dates_CheckedChange; monthViewLayout.AddView(show_Blackout_Dates); //Show week number show_week_number = new CheckBox(context); show_week_number.SetPadding(0, 10, 0, 10); show_week_number.Text = "Show Week number"; show_week_number.TextSize = 20; show_week_number.Checked = true; show_week_number.SetTextColor(Color.Black); show_week_number.CheckedChange += show_week_number_CheckedChange; monthViewLayout.AddView(show_week_number); View monthLayoutdivider2 = new View(context); monthLayoutdivider2.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 2); monthLayoutdivider2.SetBackgroundColor(Color.Gray); monthViewLayout.AddView(monthLayoutdivider2); View divider5 = new View(context); divider5.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 2); divider5.SetBackgroundColor(Color.Gray); otherviewsLayout.AddView(divider5); FrameLayout collapsedLayouts = new FrameLayout(context); collapsedLayouts.AddView(otherviewsLayout); collapsedLayouts.AddView(monthViewLayout); layout.AddView(collapsedLayouts); if (sfschedule.ScheduleView != ScheduleView.MonthView) { monthViewLayout.Visibility = ViewStates.Invisible; } propertyLayout.AddView(layout); return(propertyLayout); }
public CustomToolbar() { parentView = new UIView(this.Frame); initialStream = typeof(CustomToolbar).GetTypeInfo().Assembly.GetManifestResourceStream("SampleBrowser.Samples.PDFViewer.Assets.F# Succinctly.pdf"); loadedDocument = new PdfLoadedDocument(initialStream); PopulateInitialBookmarkList(); var tap = new UITapGestureRecognizer(OnSingleTap); tap.CancelsTouchesInView = false; //for iOS5 highFont = UIFont.FromName("Final_PDFViewer_IOS_FontUpdate", 30); fontSizeFont = UIFont.FromName("Font size Font", 30); signatureFont = UIFont.FromName("Signature_PDFViewer_FONT", 30); //Font that defines the icons for the bookmark toolbar buttons bookmarkFont = UIFont.FromName("PdfViewer_FONT", 30); this.AddGestureRecognizer(tap); helper = new TextMarkupAnnotationHelper(this); inkHelper = new InkAnnotationHelper(this); annotHelper = new AnnotationHelper(this); rangeSlider = new SfRangeSlider(); edittextHelper = new EditTextAnnotationHelper(this); shapeHelper = new ShapeAnnotationHelper(this); opacitybutton.TouchUpInside += inkHelper.Opacitybutton_TouchUpInside; pdfViewerControl = new SfPdfViewer(); pdfViewerControl.Toolbar.Enabled = false; pdfViewerControl.PageChanged += ViewerControl_PageChanged; pdfViewerControl.TextMarkupSelected += helper.PdfViewerControl_TextMarkupSelected; pdfViewerControl.TextMarkupDeselected += helper.PdfViewerControl_TextMarkupDeselected; pdfViewerControl.CanUndoModified += PdfViewerControl_CanUndoModified; pdfViewerControl.CanRedoModified += PdfViewerControl_CanRedoModified; pdfViewerControl.CanUndoInkModified += inkHelper.PdfViewerControl_CanUndoInkModified; pdfViewerControl.CanRedoInkModified += inkHelper.PdfViewerControl_CanRedoInkModified; pdfViewerControl.InkSelected += inkHelper.PdfViewerControl_InkSelected; pdfViewerControl.InkDeselected += inkHelper.PdfViewerControl_InkDeselected; pdfViewerControl.FreeTextAnnotationAdded += edittextHelper.PdfViewerControl_FreeTextAnnotationAdded; pdfViewerControl.FreeTextAnnotationDeselected += edittextHelper.PdfViewerControl_FreeTextAnnotationDeselected; pdfViewerControl.FreeTextAnnotationSelected += edittextHelper.PdfViewerControl_FreeTextAnnotationSelected; pdfViewerControl.FreeTextPopupDisappeared += edittextHelper.PdfViewerControl_FreeTextPopupDisappearing; pdfViewerControl.ShapeAnnotationSelected += shapeHelper.PdfViewerControl_ShapeAnnotationSelected; pdfViewerControl.ShapeAnnotationDeselected += shapeHelper.PdfViewerControl_ShapeAnnotationDeselected; BoldBtn1.TouchUpInside += inkHelper.BoldColorBtn1_TouchUpInside; BoldColorBtn1.TouchUpInside += inkHelper.BoldColorBtn1_TouchUpInside; BoldBtn2.TouchUpInside += inkHelper.BoldColorBtn2_TouchUpInside; BoldColorBtn2.TouchUpInside += inkHelper.BoldColorBtn2_TouchUpInside; BoldBtn3.TouchUpInside += inkHelper.BoldColorBtn3_TouchUpInside; BoldColorBtn3.TouchUpInside += inkHelper.BoldColorBtn3_TouchUpInside; BoldColorBtn4.TouchUpInside += inkHelper.BoldColorBtn4_TouchUpInside; BoldBtn4.TouchUpInside += inkHelper.BoldColorBtn4_TouchUpInside; BoldColorBtn5.TouchUpInside += inkHelper.BoldColorBtn5_TouchUpInside; BoldBtn5.TouchUpInside += inkHelper.BoldColorBtn5_TouchUpInside; inkColorButton.TouchUpInside += helper.ColorButton_TouchUpInside; colorButton.TouchUpInside += helper.ColorButton_TouchUpInside; inkAnnotationButton.TouchUpInside += inkHelper.InkAnnotationButton_TouchUpInside; inkThicknessButton.TouchUpInside += inkHelper.InkThicknessButton_TouchUpInside; shapeThicknessButton.TouchUpInside += inkHelper.InkThicknessButton_TouchUpInside; edittextThicknessButton.TouchUpInside += edittextHelper.EditTextThicknessButton_TouchUpInside; edittextColorButton.TouchUpInside += helper.ColorButton_TouchUpInside; shapeColorButton.TouchUpInside += helper.ColorButton_TouchUpInside; pageNumberField.Text = "1"; CreateTopToolbar(); bottomToolBar = CreateBottomToolbar(); toolbar = toolBar; parentView.AddSubview(pdfViewerControl); AddSubview(parentView); AddSubview(toolbar); AddSubview(bottomToolBar); topBorder.BackgroundColor = UIColor.FromRGBA(red: 0.86f, green: 0.86f, blue: 0.86f, alpha: 1.0f); AddSubview(topBorder); activityDialog = new ActivityIndicator(); activityDialog.Frame = new CGRect(UIScreen.MainScreen.Bounds.Width / 2 - 125, UIScreen.MainScreen.Bounds.Height / 2 - 50, 250, 100); popUpAlertView = new UIAlertView(); dropDownMenu = CreateDropDownMenu(); dropDownMenu.DropDownMenuItemChanged += (e, a) => { fileStream = typeof(CustomToolbar).GetTypeInfo().Assembly.GetManifestResourceStream("SampleBrowser.Samples.PDFViewer.Assets." + a.DisplayText + ".pdf"); loadedDocument = new PdfLoadedDocument(fileStream); PopulateInitialBookmarkList(); pdfViewerControl.LoadDocument(fileStream); isBookmarkPaneVisible = false; if (bookmarkToolbar != null && bookmarkToolbar.Superview != null) { bookmarkToolbar.RemoveFromSuperview(); } ResetToolBar(); annotHelper.RemoveAllToolbars(false); dropDownMenu.Close(); }; }
public void ValueChanged(object sender, SfRangeSlider.ValueChangedEventArgs e) { float alpha = (float)(e.P1 / 100); img.Alpha = alpha; }
private StackLayout GetRangeSlider() { SfRangeSlider sfRangeSlider1; SfRangeSlider sfRangeSlider2; SfRangeSlider sfRangeSlider3; Label label, label1, label2, label3, label4, label5, label6; sfRangeSlider1 = new SfRangeSlider(); sfRangeSlider1.HeightRequest = 400; sfRangeSlider1.WidthRequest = 85; sfRangeSlider1.Minimum = -12; sfRangeSlider1.Maximum = 12; sfRangeSlider1.RangeStart = -12; sfRangeSlider1.RangeEnd = 2.2; sfRangeSlider1.Value = 2.2; sfRangeSlider1.TickFrequency = 12; sfRangeSlider1.SnapsTo = SnapsTo.None; sfRangeSlider1.Orientation = Syncfusion.SfRangeSlider.XForms.Orientation.Vertical; sfRangeSlider1.ValuePlacement = ValuePlacement.TopLeft; sfRangeSlider1.TickPlacement = TickPlacement.None; sfRangeSlider1.ShowRange = false; sfRangeSlider1.TrackSelectionColor = Color.Gray; //sfRangeSlider1.SetValue (0); sfRangeSlider2 = new SfRangeSlider(); sfRangeSlider2.HeightRequest = 400; sfRangeSlider2.WidthRequest = 85; sfRangeSlider2.Minimum = -12; sfRangeSlider2.Maximum = 12; sfRangeSlider2.RangeStart = -12; sfRangeSlider2.RangeEnd = -4.7; sfRangeSlider2.Value = -4.7; sfRangeSlider2.TickFrequency = 12; sfRangeSlider2.SnapsTo = SnapsTo.None; sfRangeSlider2.Orientation = Syncfusion.SfRangeSlider.XForms.Orientation.Vertical; sfRangeSlider2.TickPlacement = TickPlacement.None; sfRangeSlider2.ValuePlacement = ValuePlacement.TopLeft; sfRangeSlider2.ShowRange = false; sfRangeSlider2.TrackSelectionColor = Color.Gray; //sfRangeSlider2.SetValue (12); sfRangeSlider3 = new SfRangeSlider(); sfRangeSlider3.HeightRequest = 400; sfRangeSlider3.WidthRequest = 85; sfRangeSlider3.Minimum = -12; sfRangeSlider3.Maximum = 12; sfRangeSlider3.RangeStart = -12; sfRangeSlider3.Value = 6; sfRangeSlider3.RangeEnd = 6; sfRangeSlider3.TickFrequency = 12; sfRangeSlider3.SnapsTo = SnapsTo.None; sfRangeSlider3.Orientation = Syncfusion.SfRangeSlider.XForms.Orientation.Vertical; sfRangeSlider3.TickPlacement = TickPlacement.None; sfRangeSlider3.ValuePlacement = ValuePlacement.TopLeft; sfRangeSlider3.ShowRange = false; sfRangeSlider3.TrackSelectionColor = Color.Gray; //sfRangeSlider3.SetValue (-12); this.BackgroundColor = Color.White; if (Device.OS == TargetPlatform.WinPhone) { label = new Label() { FontSize = 20, Text = "\t\t" + "60Hz", HeightRequest = 24, YAlign = TextAlignment.Center, TextColor = Color.FromRgb(109, 109, 114), XAlign = TextAlignment.Center }; label1 = new Label() { FontSize = 20, Text = "\t\t" + "170Hz", HeightRequest = 24, YAlign = TextAlignment.Center, TextColor = Color.FromRgb(109, 109, 114), XAlign = TextAlignment.Center }; label2 = new Label() { FontSize = 20, Text = "\t\t" + "310Hz", HeightRequest = 24, YAlign = TextAlignment.Center, TextColor = Color.FromRgb(109, 109, 114), XAlign = TextAlignment.Center }; label3 = new Label() { FontSize = 12, Text = "\t\t\t" + "2.2db", HeightRequest = 30, YAlign = TextAlignment.Start, TextColor = Color.FromRgb(57, 181, 247), XAlign = TextAlignment.Center }; label4 = new Label() { FontSize = 12, Text = "\t\t\t" + "-4.7db", HeightRequest = 30, YAlign = TextAlignment.Start, TextColor = Color.FromRgb(57, 181, 247), XAlign = TextAlignment.Center }; label5 = new Label() { FontSize = 12, Text = "\t\t\t" + "6db", HeightRequest = 30, YAlign = TextAlignment.Start, TextColor = Color.FromRgb(57, 181, 247), XAlign = TextAlignment.Center }; } else { label = new Label() { FontSize = 20, Text = "60Hz", HeightRequest = 24, YAlign = TextAlignment.Center, TextColor = Color.FromRgb(109, 109, 114), XAlign = TextAlignment.Center }; label1 = new Label() { FontSize = 20, Text = "170Hz", HeightRequest = 24, YAlign = TextAlignment.Center, TextColor = Color.FromRgb(109, 109, 114), XAlign = TextAlignment.Center }; label2 = new Label() { FontSize = 20, Text = "310Hz", HeightRequest = 24, YAlign = TextAlignment.Center, TextColor = Color.FromRgb(109, 109, 114), XAlign = TextAlignment.Center }; label3 = new Label() { FontSize = 12, Text = "2.2db", HeightRequest = 30, YAlign = TextAlignment.Start, TextColor = Color.FromRgb(57, 181, 247), XAlign = TextAlignment.Center }; label4 = new Label() { FontSize = 12, Text = "-4.7db", HeightRequest = 30, YAlign = TextAlignment.Start, TextColor = Color.FromRgb(57, 181, 247), XAlign = TextAlignment.Center }; label5 = new Label() { FontSize = 12, Text = "6db", HeightRequest = 30, YAlign = TextAlignment.Start, TextColor = Color.FromRgb(57, 181, 247), XAlign = TextAlignment.Center }; } label6 = new Label() { FontSize = 20, Text = "", HeightRequest = 1, YAlign = TextAlignment.End, TextColor = Color.FromRgb(109, 109, 114), XAlign = TextAlignment.Center }; if (Device.OS == TargetPlatform.WinPhone) { sfRangeSlider1.BackgroundColor = Color.Gray; sfRangeSlider2.BackgroundColor = Color.Gray; sfRangeSlider3.BackgroundColor = Color.Gray; this.BackgroundColor = Color.Black; } if (Device.OS == TargetPlatform.iOS) { sfRangeSlider1.WidthRequest = 90; sfRangeSlider2.WidthRequest = 90; sfRangeSlider3.WidthRequest = 90; sfRangeSlider1.HeightRequest = 300; sfRangeSlider2.HeightRequest = 300; sfRangeSlider3.HeightRequest = 300; } else if (Device.OS == TargetPlatform.WinPhone) { sfRangeSlider1.WidthRequest = 120; sfRangeSlider2.WidthRequest = 120; sfRangeSlider3.WidthRequest = 120; sfRangeSlider1.HeightRequest = 600; sfRangeSlider2.HeightRequest = 600; sfRangeSlider3.HeightRequest = 600; sfRangeSlider1.KnobColor = Color.White; sfRangeSlider2.KnobColor = Color.White; sfRangeSlider3.KnobColor = Color.White; sfRangeSlider1.TrackSelectionColor = Color.Gray; sfRangeSlider2.TrackSelectionColor = Color.Gray; sfRangeSlider3.TrackSelectionColor = Color.Gray; } else if (Device.OS == TargetPlatform.Windows && Device.Idiom != TargetIdiom.Tablet) { this.BackgroundColor = Color.Black; label.TextColor = label1.TextColor = label2.TextColor = label3.TextColor = label4.TextColor = label5.TextColor = label6.TextColor = Color.White; sfRangeSlider1.TrackSelectionColor = sfRangeSlider2.TrackSelectionColor = sfRangeSlider3.TrackSelectionColor = Color.Gray; sfRangeSlider1.TrackColor = sfRangeSlider2.TrackColor = sfRangeSlider3.TrackColor = Color.Gray; } sfRangeSlider1.ValueChanging += (object sender, ValueEventArgs e) => { double f = Math.Round(e.Value, 1); if (Device.OS == TargetPlatform.WinPhone) { label3.Text = "\t\t\t" + f + "db"; } else { label3.Text = f + "db"; } }; sfRangeSlider2.ValueChanging += (object sender, ValueEventArgs e) => { double f = Math.Round(e.Value, 1); if (Device.OS == TargetPlatform.WinPhone) { label4.Text = "\t\t\t" + f + "db"; } else { label4.Text = f + "db"; } }; sfRangeSlider3.ValueChanging += (object sender, ValueEventArgs e) => { double f = Math.Round(e.Value, 1); if (Device.OS == TargetPlatform.WinPhone) { label5.Text = "\t\t\t" + f + "db"; } else { label5.Text = f + "db"; } }; var mainStack1 = new StackLayout { Spacing = 1, Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.Center, Padding = Device.OnPlatform(iOS: 10, Android: 10, WinPhone: 10), Children = { label, label3, sfRangeSlider1 } }; var mainStack2 = new StackLayout { Spacing = 1, Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.Center, Padding = Device.OnPlatform(iOS: 10, Android: 10, WinPhone: 10), Children = { label1, label4, sfRangeSlider2 } }; var mainStack3 = new StackLayout { Spacing = 1, Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.Center, Padding = Device.OnPlatform(iOS: 10, Android: 10, WinPhone: 10), Children = { label2, label5, sfRangeSlider3 } }; var mainStack = new StackLayout { Spacing = 1, Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.Center, Padding = Device.OnPlatform(iOS: 0, Android: 0, WinPhone: 0), Children = { mainStack1, mainStack2, mainStack3 } }; var mainStack4 = new StackLayout { Spacing = 1, Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.FillAndExpand, Padding = Device.OnPlatform(iOS: 10, Android: 10, WinPhone: 1), Children = { label6, mainStack } }; return(mainStack4); }
protected override void Dispose(bool disposing) { if (disposing) { if (schedule != null) { schedule.Dispose(); schedule = null; } if (OptionView != null) { this.OptionView.RemoveFromSuperview(); this.OptionView.Dispose(); this.OptionView = null; } if (buttonScheduleView != null) { buttonScheduleView.TouchUpInside -= ShowPicker1; buttonScheduleView.Dispose(); buttonScheduleView = null; } if (doneButton != null) { doneButton.TouchUpInside -= HidePicker; doneButton.Dispose(); doneButton = null; } if (rangeslider != null) { rangeslider.RangeValueChange -= Slider_RangeValueChange; rangeslider.Dispose(); rangeslider = null; } if (daySettings != null) { daySettings.Dispose(); daySettings = null; } if (labelBlackOutDays != null) { labelBlackOutDays.Dispose(); labelBlackOutDays = null; } if (labelScheduleView != null) { labelScheduleView.Dispose(); labelScheduleView = null; } if (labelShowNonAccess != null) { labelShowNonAccess.Dispose(); labelShowNonAccess = null; } if (labelWeekNumber != null) { labelWeekNumber.Dispose(); labelWeekNumber = null; } if (labelWorkingHours != null) { labelWorkingHours.Dispose(); labelWorkingHours = null; } if (monthSettings != null) { monthSettings.Dispose(); monthSettings = null; } if (pickerScheduleView != null) { pickerScheduleView.Dispose(); pickerScheduleView = null; } if (switchBlackOutDates != null) { switchBlackOutDates.Dispose(); switchBlackOutDates = null; } if (switchNonAccessbleBlock != null) { switchNonAccessbleBlock.Dispose(); switchNonAccessbleBlock = null; } if (switchWeekNumber != null) { switchWeekNumber.Dispose(); switchWeekNumber = null; } if (weekSettings != null) { weekSettings.Dispose(); weekSettings = null; } if (workWeekSettings != null) { workWeekSettings.Dispose(); workWeekSettings = null; } } base.Dispose(disposing); }
public RangeSlider() { //InitializeComponent (); sfRangeSlider1 = new SfRangeSlider(); sfRangeSlider2 = new SfRangeSlider(); sfRangeSlider1.HeightRequest = 90; sfRangeSlider1.WidthRequest = 200; sfRangeSlider1.Minimum = 0; sfRangeSlider1.Maximum = 12; sfRangeSlider1.RangeStart = 0; sfRangeSlider1.RangeEnd = 12; sfRangeSlider1.TickFrequency = 2; sfRangeSlider1.SnapsTo = SnapsTo.None; sfRangeSlider1.Orientation = Syncfusion.SfRangeSlider.XForms.Orientation.Horizontal; sfRangeSlider1.TickPlacement = TickPlacement.BottomRight; sfRangeSlider2.HeightRequest = 90; sfRangeSlider2.WidthRequest = 200; sfRangeSlider2.Minimum = 0; sfRangeSlider2.Maximum = 12; sfRangeSlider2.RangeStart = 0; sfRangeSlider2.RangeEnd = 12; sfRangeSlider2.TickFrequency = 2; sfRangeSlider2.SnapsTo = SnapsTo.None; sfRangeSlider2.Orientation = Syncfusion.SfRangeSlider.XForms.Orientation.Horizontal; sfRangeSlider2.TickPlacement = TickPlacement.BottomRight; Title = "Getting Started"; toggleButton = new Switch(); toggleButton2 = new Switch(); picker1 = new PickerExt(); picker2 = new PickerExt(); sfRangeSlider1.RangeChanging += (object sender, RangeEventArgs e) => { if (Math.Round(e.Start) < 1) { if (Math.Round(e.End) == 12) { label10.Text = "12 AM - " + Math.Round(e.End) + " PM"; } else { label10.Text = "12 AM - " + Math.Round(e.End) + " AM"; } } else { if (Math.Round(e.End) == 12) { label10.Text = Math.Round(e.Start) + " AM - " + Math.Round(e.End) + " PM"; } else { label10.Text = Math.Round(e.Start) + " AM - " + Math.Round(e.End) + " AM"; } } if (Math.Round(e.Start) == Math.Round(e.End)) { if (Math.Round(e.Start) < 1) { label10.Text = "12 AM"; } else if (Math.Round(e.Start) == 12) { label10.Text = "12 PM"; } else { label10.Text = Math.Round(e.Start) + " AM"; } } }; sfRangeSlider2.RangeChanging += (object sender, RangeEventArgs e) => { if (Math.Round(e.Start) < 1) { if (Math.Round(e.End) == 12) { label11.Text = "12 AM - " + Math.Round(e.End) + " PM"; } else { label11.Text = "12 AM - " + Math.Round(e.End) + " AM"; } } else { if (Math.Round(e.End) == 12) { label11.Text = Math.Round(e.Start) + " AM - " + Math.Round(e.End) + " PM"; } else { label11.Text = Math.Round(e.Start) + " AM - " + Math.Round(e.End) + " AM"; } } if (Math.Round(e.Start) == Math.Round(e.End)) { if (Math.Round(e.Start) < 1) { label11.Text = "12 AM"; } else if (Math.Round(e.Start) == 12) { label11.Text = "12 PM"; } else { label11.Text = Math.Round(e.Start) + " AM"; } } }; toggleButton.Toggled += toggleStateChanged; toggleButton2.Toggled += toggleStateChanged1; toggleButton.IsToggled = true; picker1.Items.Add("TopLeft"); picker1.Items.Add("BottomRight"); picker1.Items.Add("Inline"); picker1.Items.Add("Outside"); picker1.Items.Add("None"); picker1.HeightRequest = 40; picker1.SelectedIndex = 1; picker1.SelectedIndexChanged += picker1_SelectedIndexChanged; picker2.Items.Add("TopLeft"); picker2.Items.Add("BottomRight"); picker2.HeightRequest = 40; picker2.SelectedIndex = 1; picker2.SelectedIndexChanged += picker2_SelectedIndexChanged; picker1.BackgroundColor = Color.White; picker2.BackgroundColor = Color.White; label6 = new Label() { Text = " " + "Settings", FontSize = 60, HeightRequest = 60, YAlign = TextAlignment.End, TextColor = Color.White }; label3 = new Label() { Text = "Tick Placement", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; label4 = new Label() { Text = "Label Placement", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; label5 = new Label() { Text = "Label", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.Black, }; label9 = new Label() { Text = "SnapsToTick", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.Black }; if (Device.OS == TargetPlatform.Windows && Device.Idiom != TargetIdiom.Tablet) { label9.TextColor = Color.White; } label10 = new Label() { FontSize = 12, Text = "12 AM - 12 PM", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; label11 = new Label() { FontSize = 12, Text = "12 AM - 12 PM", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; if (Device.OS == TargetPlatform.Android) { time = new Label() { FontSize = 12, Text = " Time: ", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; time1 = new Label() { FontSize = 12, Text = " Time: ", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; label = new Label() { XAlign = TextAlignment.Start, Text = " Departure", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; label1 = new Label() { XAlign = TextAlignment.Start, Text = " Arrival", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; } else if (Device.OS == TargetPlatform.iOS) { time = new Label() { FontSize = 12, Text = " Time: ", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; time1 = new Label() { FontSize = 12, Text = " Time: ", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; label = new Label() { XAlign = TextAlignment.Start, Text = " Departure", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; label1 = new Label() { XAlign = TextAlignment.Start, Text = " Arrival", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; } else { time1 = new Label() { FontSize = 12, Text = "Time: ", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; time = new Label() { FontSize = 12, Text = "Time: ", HeightRequest = 20, YAlign = TextAlignment.Center, TextColor = Color.FromHex("#939394"), XAlign = TextAlignment.Start }; label = new Label() { XAlign = TextAlignment.Start, Text = "Departure", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; label1 = new Label() { XAlign = TextAlignment.Start, Text = "Arrival", HeightRequest = 20, YAlign = TextAlignment.End, TextColor = Color.Black }; if (Device.OS == TargetPlatform.Windows && Device.Idiom != TargetIdiom.Tablet) { label.TextColor = Color.White; label1.TextColor = Color.White; } } if (Device.OS == TargetPlatform.Android) { picker1.BackgroundColor = Color.FromRgb(239, 239, 239); picker2.BackgroundColor = Color.FromRgb(239, 239, 239); label3.FontSize = 20; label4.FontSize = 20; label5.FontSize = 20; label9.FontSize = 20; } label10.WidthRequest = sfRangeSlider1.Width; label11.WidthRequest = sfRangeSlider1.Width; label5.WidthRequest = label9.Width; ContentView = GetRangeSlider(); PropertyView = GetOptionPage(); }
public override View GetSampleContent (Context con) { LinearLayout linearLayout = new LinearLayout(con); linearLayout.SetPadding(20, 20, 20, 30); linearLayout.SetBackgroundColor(Color.Rgb(236, 235, 242)); linearLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); linearLayout.Orientation = Android.Widget.Orientation.Vertical; TextView textView3 = new TextView(con); textView3.TextSize=20; textView3.Text=" "+"Departure"; textView3.SetTextColor (Color.Black); range = new SfRangeSlider(con); range.Minimum= 0; range.Maximum=12; range.TickFrequency=2; range.ShowValueLabel=showlabel; range.StepFrequency=6; range.DirectionReversed=false; range.ValuePlacement=valueplacement; range.RangeEnd=12; range.RangeStart=0; range.TickPlacement=tickplacement; range.ShowRange=showlabel; range.SnapsTo=snapsto; range.Orientation=Com.Syncfusion.Sfrangeslider.Orientation.Horizontal; range.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 150); LinearLayout depstack =new LinearLayout (con); depstack.Orientation = Android.Widget.Orientation.Horizontal; depstack.AddView (textView3); TextView textView4 = new TextView(con); textView4.TextSize=13; textView4.Text=" "+"(in Hours)"; textView4.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.MatchParent); textView4.SetTextColor (Color.ParseColor("#939394")); textView4.Gravity = GravityFlags.Center; depstack.AddView (textView4); TextView textView7 = new TextView(con); textView7.SetHeight (50); linearLayout.AddView (textView7); linearLayout.AddView (depstack); TextView textView10 = new TextView(con); TextView textView12 = new TextView(con); linearLayout.AddView (textView12); linearLayout.AddView (textView10); linearLayout.AddView(range); textView10.TextSize=13; val3 = "12"; val4 = Math.Round (range.RangeEnd).ToString (); textView10.SetTextColor (Color.ParseColor ("#939394")); textView10.Text = " "+"Time: "+val3 +"AM " +" - "+ val4 +" PM"; textView10.Gravity = GravityFlags.Left; range.RangeChanged += (object sender, SfRangeSlider.RangeChangedEventArgs e) => { String pmstr2="AM",pmstr1 = "AM"; if(Math.Round(e.P1).ToString() =="0" ) { val3 = "12"; pmstr1 = "AM"; } else val3 = Convert.ToString(Math.Round(e.P1)); if (e.P2 <= 12) val4 = Convert.ToString(Math.Round(e.P2)); if(Math.Round(e.P2).ToString()=="12") pmstr2 = "PM"; if(Math.Round(e.P2).ToString()=="12") pmstr2 = "PM"; if(Convert.ToString(Math.Round(e.P1)).Equals(Convert.ToString(Math.Round(e.P2)))){ if(Math.Round(e.P1).ToString() =="0" ) textView10.Text=" "+"Time: "+val3 +" "+ pmstr1; else if(Math.Round(e.P2).ToString()=="12") textView10.Text=" "+"Time: "+val4 +" "+ pmstr2; else textView10.Text=" "+"Time: "+val3 +" "+ pmstr1; } else textView10.Text=" "+"Time: " +val3+" "+ pmstr1 + " - "+ val4+" " + pmstr2; }; TextView textView6 = new TextView(con); textView6.SetHeight (70); linearLayout.AddView (textView6); TextView textView2 = new TextView(con); textView2.TextSize=20; textView2.Text=" "+"Arrival"; textView2.SetTextColor (Color.Black); //linearLayout.AddView(textView2); range2 = new SfRangeSlider(con); range2.Minimum= 0; range2.Maximum=12; range2.TickFrequency=2; range2.ShowValueLabel=showlabel; range2.StepFrequency=6; range2.DirectionReversed=false; range2.ValuePlacement=valueplacement; range2.RangeEnd=12; range2.RangeStart=0; range2.TickPlacement=tickplacement; range2.ShowRange=showlabel; range2.SnapsTo=snapsto; range2.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Horizontal; range2.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 150); TextView textView5 = new TextView(con); textView5.TextSize=13; textView5.Text=" "+"(in Hours)"; textView5.Gravity = GravityFlags.Center; textView5.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.MatchParent); textView5.SetTextColor (Color.ParseColor("#939394")); TextView textView8 = new TextView(con); textView8.SetHeight (50); LinearLayout arrivestack =new LinearLayout (con); arrivestack.Orientation = Android.Widget.Orientation.Horizontal; arrivestack.AddView (textView2); arrivestack.AddView (textView5); linearLayout.AddView (textView8); linearLayout.AddView (arrivestack); TextView textView13 = new TextView(con); linearLayout.AddView (textView13); TextView textView9 = new TextView(con); linearLayout.AddView (textView9); linearLayout.AddView(range2); textView9.TextSize=13; textView9.SetTextColor (Color.ParseColor ("#939394")); val1 = "12"; val2 = Math.Round (range2.RangeEnd).ToString (); textView9.Text = " "+"Time: "+val1 +"AM " +" - "+ val2 +" PM"; textView9.Gravity = GravityFlags.Left; range2.RangeChanged += (object sender, SfRangeSlider.RangeChangedEventArgs e) => { String pmstr2="AM",pmstr1 = "AM"; if(Math.Round(e.P1).ToString() =="0" ) { val1 = "12"; pmstr1 = "AM"; } else val1 = Convert.ToString(Math.Round(e.P1)); if (e.P2 <= 12) val2 = Convert.ToString(Math.Round(e.P2)); if(Math.Round(e.P2).ToString()=="12") pmstr2 = "PM"; if(Convert.ToString(Math.Round(e.P1)).Equals(Convert.ToString(Math.Round(e.P2)))){ if(Math.Round(e.P1).ToString() =="0" ) textView9.Text=" "+"Time: "+val1 +" "+ pmstr1; else if(Math.Round(e.P2).ToString()=="12") textView9.Text=" "+"Time: "+val2 +" "+ pmstr2; else textView9.Text=" "+"Time: "+val1 +" "+ pmstr1; } else textView9.Text=" "+"Time: " +val1+" "+ pmstr1 + " - "+ val2+" " + pmstr2; }; return linearLayout; }