Custom Rating Bar

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Custom Rating Bar

Postby stelioschar » Tue Aug 24, 2010 8:37 am

Hello to everybody,

I have a problem using a custom rating bar.
The widget that i'm using is the RatingBar. Here is the code.
Code: Select all

The style that i apply to the RatingBar is called foodRatingBar, with this code:
Code: Select all
   <style name="foodRatingBar" parent="@android:style/Widget.RatingBar">
      <item name="android:progressDrawable">@layout/food_rating_bar_full</item>
      <item name="android:minHeight">48dip</item>
        <item name="android:maxHeight">48dip</item>

and the drawable has this structure:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="">
    <item android:id="@+android:id/background"
          android:drawable="@drawable/food_ratingbar_full_empty" />
    <item android:id="@+android:id/secondaryProgress"
          android:drawable="@drawable/food_ratingbar_full_empty" />
    <item android:id="@+android:id/progress"
          android:drawable="@drawable/food_ratingbar_full_filled" />

The problem is that if i drag my mouse(in the emulator) up to this rating bar, the value inside the bar changes and it is not permanent and stable.
I would like someone to give me a tip for keeping this rating custom bar unchanged..

Thanks in advance..
Junior Developer
Junior Developer
Posts: 18
Joined: Thu Aug 19, 2010 9:18 am


Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 6 guests