Skip to content

tdhman/IndicatorRatingBar

Repository files navigation

IndicatorRatingBar for Android

Standalone Android widget for custom rating bar that uses square or rectangle cell with the top/bottom indicator text. The indicator text is only shown if the selected rate is set.

Screenshot

Usage

###For simple numeric rating bar

Include IndicatorRatingBar in your layout XML.

<com.helado.indicatorratingbar.IndicatorRatingBar
        android:id="@+id/indicator_rating_view_1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_marginBottom="20dp"
        custom:rateType="numeric"
        custom:rateShape="square"
        custom:minRate="1"
        custom:maxRate="7"
        custom:selectedRate="4"
        custom:selectable="true"
        custom:indicatorPosition="indicatorDown"
        custom:indicatorTitle="Numeric Square Rating">
    </com.helado.indicatorratingbar.IndicatorRatingBar>

###For custom rating values

Set the values in code

IndicatorRatingBar indicatorRatingBar = (IndicatorRatingBar) findViewById(R.id.indicator_rating_view_3);
indicatorRatingBar.setRateList(Arrays.asList("New star", "Rising star", "Super star"));
indicatorRatingBar.setSelectedRate("Super star");
indicatorRatingBar.setCellSelectable(false);

Custom attributes

rateType : numeric (default) | custom
rateShape : rectangle (default) | square
minRate : [0 - 9]
maxRate : [0 - 9] && maxRate > minRate
selectedRate : [minRate, maxRate]
indicatorPosition : UP | DOWN
indicatorTitle : Title text of indicator bar
selectable : true (default) | false

About

An Android component that provides a custom view for rating bar.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages