alexa
menu

Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download

    Show / Hide Table of Contents

    Class SfRating

    Represents a control that has a group of stars to indicate a rating with flexible precision.

    Inheritance
    System.Object
    SfRating
    Namespace: Com.Syncfusion.Rating
    Assembly: Syncfusion.SfRating.Android.dll
    Syntax
    public class SfRating : LinearLayout

    Constructors

    SfRating(Context)

    Initializes a new instance of the SfRating class.

    Declaration
    public SfRating(Context context)
    Parameters
    Type Name Description
    Android.Content.Context context

    Context Type

    SfRating(Context, IAttributeSet)

    Initializes a new instance of the SfRating class.

    Declaration
    public SfRating(Context context, IAttributeSet attrs)
    Parameters
    Type Name Description
    Android.Content.Context context

    Context Type

    Android.Util.IAttributeSet attrs

    Attribute sets

    SfRating(Context, IAttributeSet, Int32)

    Initializes a new instance of the SfRating class.

    Declaration
    public SfRating(Context context, IAttributeSet attrs, int defStyleAttr)
    Parameters
    Type Name Description
    Android.Content.Context context

    Context Type.

    Android.Util.IAttributeSet attrs

    Attribute set

    System.Int32 defStyleAttr

    Integer Type

    SfRating(Context, IAttributeSet, Int32, Int32)

    Initializes a new instance of the SfRating class.

    Declaration
    public SfRating(Context context, IAttributeSet attrs, int defStyleAttr, int devResources)
    Parameters
    Type Name Description
    Android.Content.Context context

    Context Type.

    Android.Util.IAttributeSet attrs

    Attribute set

    System.Int32 defStyleAttr

    Integer Type

    System.Int32 devResources

    default resource

    Properties

    EnableAutoSize

    Gets or sets a value indicating whether item size can automatically adjusted based on available space.

    Declaration
    public bool EnableAutoSize { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if enable auto size; otherwise, false.

    EnableCustomView

    Gets or sets a value indicating whether user can apply a custom view.

    Declaration
    public bool EnableCustomView { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if enable custom rating; otherwise, false.

    EnableViewRangeSelection

    Gets or sets a value indicating whether this SfRating enable range selection.

    Declaration
    public bool EnableViewRangeSelection { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if enable single item update; otherwise, false.

    ItemCount

    Gets or sets a value indicating whether exact number of rating item to be displayed.

    Declaration
    public int ItemCount { get; set; }
    Property Value
    Type Description
    System.Int32

    The item count.

    Items

    Gets or sets a collection of items that can be populated as Rating Items and get rendered at run-time based on the custom view provided.

    Declaration
    public List<SfRatingItem> Items { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<SfRatingItem>

    The custom view collection.

    ItemSize

    Gets or sets the size of the each item.

    Declaration
    public int ItemSize { get; set; }
    Property Value
    Type Description
    System.Int32

    The size of the item.

    ItemSpacing

    Gets or sets the space between each item.

    Declaration
    public int ItemSpacing { get; set; }
    Property Value
    Type Description
    System.Int32

    The item spacing.

    PopUpHeight

    Gets or sets the height of the pop up.

    Declaration
    public int PopUpHeight { get; set; }
    Property Value
    Type Description
    System.Int32

    The height of the pop up.

    PopUpTextSize

    Gets or sets the size of the pop up text.

    Declaration
    public int PopUpTextSize { get; set; }
    Property Value
    Type Description
    System.Int32

    The size of the pop up text.

    PopUpWidth

    Gets or sets the width of the pop up.

    Declaration
    public int PopUpWidth { get; set; }
    Property Value
    Type Description
    System.Int32

    The width of the pop up.

    Precision

    Gets or sets the mode of selection or rating to be done. By default Standard rating will be set.

    Declaration
    public Precision Precision { get; set; }
    Property Value
    Type Description
    Precision

    The precision.

    RatingSettings

    Gets or sets the properties of RatingSettings class that contains all the color customization

    Declaration
    public SfRatingSettings RatingSettings { get; set; }
    Property Value
    Type Description
    SfRatingSettings

    The rating settings.

    ReadOnly

    Gets or sets a value indicating whether user interaction should be restricted or not.

    Declaration
    public bool ReadOnly { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if read only; otherwise, false.

    TooltipBackgroundColor

    Gets or sets color value that can be applied to the background of tool tip.

    Declaration
    public Color TooltipBackgroundColor { get; set; }
    Property Value
    Type Description
    Android.Graphics.Color

    The color of the tooltip background.

    TooltipPlacement

    Gets or sets enum value indicating the placement of tool tip either top or bottom.

    Declaration
    public TooltipPlacement TooltipPlacement { get; set; }
    Property Value
    Type Description
    TooltipPlacement

    The tooltip placement.

    TooltipPrecision

    Gets or sets the precision value indicating number of digits to be displayed on the tool tip.

    Declaration
    public int TooltipPrecision { get; set; }
    Property Value
    Type Description
    System.Int32

    The tooltip precision.

    TooltipTextColor

    Gets or sets color value that can be applied to the text of the tool tip.

    Declaration
    public Color TooltipTextColor { get; set; }
    Property Value
    Type Description
    Android.Graphics.Color

    The color of the tooltip text.

    Value

    Gets or sets the value for the control which determines the number of items to be selected based on the precision set.

    Declaration
    public double Value { get; set; }
    Property Value
    Type Description
    System.Double

    The value.

    Methods

    Dispose(Boolean)

    Dispose the specified disposing.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    If set to true disposing.

    OnInterceptTouchEvent(MotionEvent)

    On the intercept touch event.

    Declaration
    public override bool OnInterceptTouchEvent(MotionEvent ev)
    Parameters
    Type Name Description
    Android.Views.MotionEvent ev

    Motion Event

    Returns
    Type Description
    System.Boolean

    return true

    OnLayout(Boolean, Int32, Int32, Int32, Int32)

    Arranges the child views

    Declaration
    protected override void OnLayout(bool changed, int left, int top, int right, int bottom)
    Parameters
    Type Name Description
    System.Boolean changed

    Is changed

    System.Int32 left

    Left origin

    System.Int32 top

    Top origin

    System.Int32 right

    Right origin

    System.Int32 bottom

    Bottom origin

    OnSizeChanged(Int32, Int32, Int32, Int32)

    Method used to notify the size changes

    Declaration
    protected override void OnSizeChanged(int w, int h, int oldw, int oldh)
    Parameters
    Type Name Description
    System.Int32 w

    To get the width

    System.Int32 h

    To get the height

    System.Int32 oldw

    To get the old width

    System.Int32 oldh

    To get the old height

    OnTouchEvent(MotionEvent)

    On the touch event.

    Declaration
    public override bool OnTouchEvent(MotionEvent e)
    Parameters
    Type Name Description
    Android.Views.MotionEvent e

    Motion Event.

    Returns
    Type Description
    System.Boolean

    return true

    Events

    ValueChanged

    Occur when user interacts the control to change the value property. Returns the value rated.

    Declaration
    public event EventHandler<ValueChangedEventArgs> ValueChanged
    Event Type
    Type
    System.EventHandler<ValueChangedEventArgs>
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved