public Rating_Tablet() { InitializeComponent(); precisionPicker.Items.Add("Standard"); precisionPicker.Items.Add("Half"); precisionPicker.Items.Add("Exact"); precisionPicker.SelectedIndex = 0; precisionPicker.SelectedIndexChanged += precisionPicker_SelectedIndexChanged; sfRatingSettings = new SfRatingSettings(); sfRatingSettings.RatedFill = Color.FromHex("#fbd10a"); sfRatingSettings.UnRatedFill = Color.White; sfRatingSettings.RatedStroke = Color.FromHex("#fbd10a"); sfRatingSettings.RatedStrokeWidth = 1; sfRatingSettings.UnRatedStrokeWidth = 1; sfRating1.RatingSettings = sfRatingSettings; sfsecondRatingSettings = new SfRatingSettings(); sfsecondRatingSettings.UnRatedFill = Color.White; sfsecondRatingSettings.RatedStrokeWidth = 1; sfsecondRatingSettings.UnRatedStrokeWidth = 1; sfRating2.RatingSettings = sfsecondRatingSettings; sfRating1.TooltipPlacement = TooltipPlacement.None; sfRating2.TooltipPlacement = TooltipPlacement.None; sfRating2.ValueChanged += ValueChanged; }
public Rating_Tablet() { //Rating 1 rating1 = new SfRating(); rating1.ItemCount = 5; rating1.Precision = SFRatingPrecision.Standard; rating1.TooltipPlacement = SFRatingTooltipPlacement.None; rating1.ItemSize = 30; rating1.Value = 3; rating1.ItemSpacing = 30; rating1.ValueChanged += Rating_ValueChanged; //RatingSettings SfRatingSettings ratingSetting = new SfRatingSettings(); ratingSetting.RatedFill = UIColor.FromRGB(251, 209, 10); ratingSetting.RatedStroke = UIColor.FromRGB(251, 209, 10); //Rating 2 rating2 = new SfRating(); rating2.ItemCount = 5; rating2.RatingSettings = ratingSetting; rating2.Precision = SFRatingPrecision.Half; rating2.TooltipPlacement = SFRatingTooltipPlacement.None; rating2.ItemSize = 10; rating2.Readonly = true; rating2.Value = (nfloat)3.5; rating2.ItemSpacing = 5; mainPageDesign(); autoHide(); loadOptionView(); }
public Rating_Tablet() { InitializeComponent(); getPropertiesWindow(); sfRatingSettings = new SfRatingSettings(); sfRatingSettings.RatedFill = Color.FromHex("#fbd10a"); sfRatingSettings.UnRatedFill = Color.White; sfRatingSettings.RatedStroke = Color.FromHex("#fbd10a"); sfRatingSettings.RatedStrokeWidth = 1; sfRatingSettings.UnRatedStrokeWidth = 1; sfRating1.RatingSettings = sfRatingSettings; sfsecondRatingSettings = new SfRatingSettings(); sfsecondRatingSettings.UnRatedFill = Color.White; sfsecondRatingSettings.RatedStrokeWidth = 1; sfsecondRatingSettings.UnRatedStrokeWidth = 1; sfRating2.RatingSettings = sfsecondRatingSettings; sfRating1.TooltipPlacement = TooltipPlacement.TopLeft; sfRating2.TooltipPlacement = TooltipPlacement.TopLeft; if (Device.OS == TargetPlatform.Android) { sfRating2.TooltipPrecision = 1; } sfRating2.ValueChanged += ValueChanged; optionView(); }
public View GetSampleContent(Context con) { height = con.Resources.DisplayMetrics.HeightPixels / 2; width = con.Resources.DisplayMetrics.WidthPixels / 2; SamplePageContent(con); /************* **SfRating1** *************/ sfRatingSettings = new SfRatingSettings(); sfRating1 = new SfRating(con); sfRating1.ItemSize = 17; sfRating1.Precision = Precision.Exact; sfRating1.Value = 3.5; sfRating1.ReadOnly = true; sfRating1.ItemSpacing = 0; sfRating1.TooltipPlacement = TooltipPlacement.None; sfRatingSettings.RatedFill = Color.ParseColor("#fbd10a"); sfRatingSettings.UnRatedFill = Color.ParseColor("#cdcccb"); sfRatingSettings.RatedStrokeWidth = 0; sfRatingSettings.UnRatedStrokeWidth = 0; sfRating1.RatingSettings = sfRatingSettings; sfRating1.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(20 * con.Resources.DisplayMetrics.Density)); /************ **SfRating** ************/ sfRatingSetings1 = new SfRatingSettings(); sfRatingSetings1.RatedStroke = Color.ParseColor("#2095f2"); sfRating = new SfRating(con); sfRating.ItemSize = 40; sfRating.ItemSpacing = 20; sfRating.ItemCount = 5; sfRating.TooltipPrecision = 1; sfRating.Value = 3; sfRating.RatingSettings = sfRatingSetings1; sfRating.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(40 * con.Resources.DisplayMetrics.Density)); //sfRating Value Changed Listener sfRating.ValueChanged += (object sender, ValueChangedEventArgs e) => { if (!e.Value.ToString().Equals("")) { UpdateText(e.Value); } }; //mainView LinearLayout mainView = new LinearLayout(con); mainView.AddView(GetView(con)); return(mainView); }
public Rating_Default() { InitializeComponent(); //Rating Settings sfRatingSettings = new SfRatingSettings(); sfRatingSettings.RatedFill = Color.FromHex("#fbd10a"); sfRatingSettings.UnRatedFill = Color.White; sfRatingSettings.RatedStroke = Color.FromHex("#fbd10a"); sfRatingSettings.RatedStrokeWidth = 1; sfRatingSettings.UnRatedStrokeWidth = 1; sfRating1.RatingSettings = sfRatingSettings; //Rating Settings sfsecondRatingSettings = new SfRatingSettings(); sfsecondRatingSettings.UnRatedFill = Color.White; sfsecondRatingSettings.RatedStrokeWidth = 1; sfsecondRatingSettings.UnRatedStrokeWidth = 1; sfRating2.RatingSettings = sfsecondRatingSettings; Grid.SetColumn(movieImage, 0); Grid.SetColumn(descStack, 1); Grid.SetRow(title, 0); Grid.SetRow(mainGrid, 1); Grid.SetRow(bottomStack, 2); sfRating1.TooltipPlacement = TooltipPlacement.None; sfRating2.TooltipPlacement = TooltipPlacement.None; sfRating2.ValueChanged += ValueChanged; ratingValueLayout.Padding = new Thickness(0, 30, 0, 0); if (Device.RuntimePlatform == Device.Android) { sfRating2.TooltipPrecision = 1; sfRating2.ItemSize = 10; description.FontSize = 12; } if (Device.Idiom == TargetIdiom.Phone && Device.RuntimePlatform == Device.UWP) { sfRating1.ItemSize = 10; sfRating2.ItemSize = 20; description.FontSize = 11; description.Text = "In 1973, French street performer Philippe Petit is trying to make a living in Paris with juggling acts and wire walking, much to the chagrin of his father."; ratingValueLayout.Padding = new Thickness(0, 10, 0, 0); } getRating(); GetOptionPage(); }
public override View GetSampleContent(Context con1) { con = con1; InitialLayout(); TitleLayout(); ImageLayout(); //Non Editable Rating ratingLayout = new LinearLayout(con); ratingLayout.SetPadding(5, 2, 0, 0); sfRatingSettings = new SfRatingSettings(); sfRating1 = new SfRating(con); sfRating1.ItemSize = 33; sfRating1.Precision = Precision.Exact; sfRating1.Value = 3.5; sfRating1.ReadOnly = true; sfRating1.ItemSpacing = 0; sfRating1.TooltipPlacement = TooltipPlacement.None; sfRatingSettings.RatedFill = Color.ParseColor("#fbd10a"); sfRatingSettings.UnRatedFill = Color.ParseColor("#cdcccb"); sfRatingSettings.RatedStrokeWidth = 0; sfRatingSettings.UnRatedStrokeWidth = 0; sfRating1.RatingSettings = sfRatingSettings; sfRating1.LayoutParameters = new ViewGroup.LayoutParams((int)(400 * con.Resources.DisplayMetrics.Density), (int)(33 * con.Resources.DisplayMetrics.Density)); ratingLayout.AddView(sfRating1); textLayout.AddView(ratingLayout); contentLayout.AddView(textLayout); DescriptionLayout(); //Editable Rating sfRatingSetings1 = new SfRatingSettings(); sfRatingSetings1.RatedStroke = Color.ParseColor("#2095f2"); sfRating = new SfRating(con); sfRating.ItemSize = 53; sfRating.ItemSpacing = 33; sfRating.ItemCount = 5; sfRating.TooltipPrecision = 1; sfRating.Value = 3; sfRating.RatingSettings = sfRatingSetings1; sfRating.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(55 * con.Resources.DisplayMetrics.Density)); padLayout.AddView(dummyLabel); padLayout.AddView(sfRating); pageLayout.AddView(padLayout); ValueLayout(); ShowLabelLayout(); return(pageLayout); }
static void DisplayCustomRatingBar(SfRating ratingBar) { ratingBar.Precision = Precision.Exact; ratingBar.ReadOnly = true; ratingBar.ItemSize = 10; //ratingBar.ItemCount = 4; ratingBar.ItemSpacing = 4; SfRatingSettings ratingSettings = new SfRatingSettings { RatedFill = Color.Yellow, UnRatedFill = Color.Gray, RatedStroke = Color.DarkOrange, UnRatedStroke = Color.DarkGray }; ratingBar.RatingSettings = ratingSettings; }
public Rating_Mobile() { SfRatingSettings ratingSetting1 = new SfRatingSettings(); ratingSetting1.RatedStrokeWidth = 2; ratingSetting1.UnRatedStrokeWidth = 2; //Rating 1 rating1 = new SfRating(); rating1.ItemCount = 5; rating1.Precision = SFRatingPrecision.Standard; rating1.TooltipPlacement = SFRatingTooltipPlacement.None; rating1.ItemSize = 30; rating1.RatingSettings = ratingSetting1; rating1.Value = 3; rating1.ItemSpacing = 5; rating1.EnableAutoSize = true; rating1.ValueChanged += Rating_ValueChanged; //RatingSettings SfRatingSettings ratingSetting = new SfRatingSettings(); ratingSetting.RatedFill = UIColor.FromRGB(251, 209, 10); ratingSetting.RatedStroke = UIColor.FromRGB(251, 209, 10); //Rating 2 rating2 = new SfRating(); rating2.ItemCount = 5; rating2.RatingSettings = ratingSetting; rating2.Precision = SFRatingPrecision.Half; rating2.TooltipPlacement = SFRatingTooltipPlacement.None; rating2.ItemSize = 10; rating2.Readonly = true; rating2.Value = (nfloat)3.5; rating2.ItemSpacing = 5; this.AddSubview(rating1); this.AddSubview(rating2); mainPageDesign(); }
public override void OnBindListViewHolder(ListViewHolder holder, int position) { FoodiPlaceViewHolder viewHolder = (FoodiPlaceViewHolder)holder; Review review = (Review)Items[position]; viewHolder.Name.Text = review.Name; viewHolder.Date.Text = review.Date.ToShortDateString(); viewHolder.Detail.Text = review.Detail; viewHolder.Score.Precision = Precision.Exact; viewHolder.Score.ReadOnly = true; viewHolder.Score.ItemSize = 10; viewHolder.Score.ItemSpacing = 4; viewHolder.Score.Value = review.Score; SfRatingSettings ratingSettings = new SfRatingSettings { RatedFill = Color.Yellow, UnRatedFill = Color.Gray, RatedStroke = Color.DarkOrange, UnRatedStroke = Color.DarkGray }; viewHolder.Score.RatingSettings = ratingSettings; }
public Rating_Default() { InitializeComponent(); //Rating Settings sfRatingSettings = new SfRatingSettings(); sfRatingSettings.RatedFill = Color.FromHex("#fbd10a"); sfRatingSettings.UnRatedFill = Color.White; sfRatingSettings.RatedStroke = Color.FromHex("#fbd10a"); sfRatingSettings.RatedStrokeWidth = 1; sfRatingSettings.UnRatedStrokeWidth = 1; sfRating1.RatingSettings = sfRatingSettings; //Rating Settings sfsecondRatingSettings = new SfRatingSettings(); sfsecondRatingSettings.UnRatedFill = Color.White; sfsecondRatingSettings.RatedStrokeWidth = 1; sfsecondRatingSettings.UnRatedStrokeWidth = 1; sfRating2.RatingSettings = sfsecondRatingSettings; Grid.SetColumn(movieImage, 0); Grid.SetColumn(descStack, 1); Grid.SetRow(title, 0); Grid.SetRow(mainGrid, 1); Grid.SetRow(bottomStack, 2); sfRating1.TooltipPlacement = TooltipPlacement.TopLeft; sfRating2.TooltipPlacement = TooltipPlacement.TopLeft; sfRating2.ValueChanged += ValueChanged; if (Device.OS == TargetPlatform.Android) { sfRating2.TooltipPrecision = 1; } getRating(); GetOptionPage(); }