RatingBar

Screenshot

Ratingbar - Reference - Enaml-native - CodeLV

Example

from enamlnative.widgets.api import *

enamldef ContentView(Flexbox):
    flex_direction = "column"
    margin = (20, 20, 20, 20)
    RatingBar: rbar1:
        num_stars = 3
        rating = 1
        #: Prevents moving
        is_indicator = True
    TextView:
        text << f"Fixed Rating {rbar1.rating} (cannot be changed)"
    RatingBar: rbar2:
        rating = 5
    TextView:
         text << f"Rating {rbar2.rating}"

Declaration

class enamlnative.widgets.rating_bar.RatingBar(parent=None, **kwargs)[source]

Bases: enamlnative.widgets.progress_bar.ProgressBar

A simple control for displaying read-only text.

is_indicator

Whether this rating bar should only be an indicator (thus non-changeable by the user).

num_stars

Sets the number of stars to show.

rating

Sets the rating (the number of stars filled).

step_size

Sets the step size (granularity) of this rating bar.

proxy

A reference to the RatingBar object.

Android Implementation

class enamlnative.android.android_rating_bar.AndroidRatingBar[source]

Bases: enamlnative.android.android_progress_bar.AndroidProgressBar, enamlnative.widgets.rating_bar.ProxyRatingBar

An Android implementation of an Enaml ProxyRatingBar.

widget

A reference to the widget created by the proxy.

default_layout

The number of stars set (via setNumStars(int) or in an XML layout) will be shown when the layout width is set to wrap content (if another layout width is set, the results may be unpredictable).

create_widget()[source]

Create the underlying widget.

init_widget()[source]

Initialize the underlying widget.

init_layout()[source]

Initialize the layout of the toolkit widget.

This method is called during the bottom-up pass. This method should initialize the layout of the widget. The child widgets will be fully initialized and layed out when this is called.

No iOS implementation found.