I have an app where I have used ProgressBar in several places.
<ProgressBar
android:id="#+id/pb_loading_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
android:visibility="visible"/>
All the progressbars are not appearing in any activity.
I have tried all solutions by changing the color of the progressbar programmatically and by adding an xml drawable, but its not working.
Below is my styles.xml
<style name="MyAppCompatTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:colorPrimary">#FFFFFF</item>
<item name="android:colorPrimaryDark">#F1F1F1</item>
<item name="android:colorAccent">#EF5350</item>
</style>
Technically the progressbar should take the colorAccent, but its not appearing at all.
Posting a sample view:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/logo"
android:src="#drawable/app_icon"
android:layout_centerHorizontal="true"
android:layout_marginTop="120dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="#+id/logo"
android:textSize="18sp"
android:id="#+id/subtitle"
android:textColor="#color/secondary_text"
android:layout_marginTop="30dp"
android:text="QUICK BROWN FOX"/>
<ProgressBar
android:id="#+id/pb_loading_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
android:visibility="visible"/>
The progressbar is not overlapped by any view in any activity of the app. I dont have any other theme in my styles.xml and I am not overriding the activity theme in the manifest also. Its an application level default theme.
Even if i create a new activity with only a progressbar, it doesnt appear.
It is weird as in all the activity design previews, the progress bar appears properly but on running the app it doesnt.
Please let me know if some other info is required.
I was too facing same problem, may its there but hiding because of other views. what i did in your case would minor change in xml file
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="#+id/pb_loading_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
android:visibility="visible"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/logo"
android:src="#drawable/app_icon"
android:layout_centerHorizontal="true"
android:layout_marginTop="120dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="#+id/logo"
android:textSize="18sp"
android:id="#+id/subtitle"
android:textColor="#color/secondary_text"
android:layout_marginTop="30dp"
android:text="QUICK BROWN FOX"/>
exactly nothing but progress bar on top of other, this work for me i don't know why.
Related
This is my layout. My question is that the id is "below_button" LinearLayout is invalid that running on the phone. The phone didn’t display this LinearLayout, but others layout is right. How come?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="#+id/title"
layout="#layout/toptitlebar" />
<LinearLayout
android:id="#+id/query_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="#+id/title"
android:background="#e2dfdf"
android:layout_alignParentLeft="true">
<EditText
android:id="#+id/ram_assistinqnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="0.45"
android:hint="通知书编号"
android:maxLines="1"
/>
<TextView
android:id="#+id/ram_operate_date"
style="#style/SpinnerCtl_Wrap"
android:gravity="center"
android:layout_margin="10dp"
android:layout_weight="0.45"
android:hint="操作时间"
android:textColor="#color/black"/>
<ImageView
android:id="#+id/ram_query"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.1"
android:src="#drawable/ram_query"
android:layout_margin="10dp"/>
</LinearLayout>
<com.sdrcu.operatingdecisions.view.scrollabletbv.ScrollTableView4
android:id="#+id/scrollTableView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/query_detail"
/>
<LinearLayout
android:id="#+id/below_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="#e2dfdf"
android:layout_below="#+id/scrollTableView"
>
<ImageView
android:id="#+id/ram_arrow_previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="center"
android:layout_weight="0.3"
android:src="#drawable/ram_arrow_previous"/>
<TextView
android:id="#+id/paging"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:gravity="center"
android:text="翻页"
android:textColor="#color/text_blue"
android:textSize="20sp"
/>
<ImageView
android:id="#+id/ram_arrow_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="center"
android:layout_weight="0.3"
android:src="#drawable/ram_arrow_next"/>
<ImageView
android:id="#+id/ram_agree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.1"
android:src="#drawable/ram_agree"/>
<ImageView
android:id="#+id/ram_disagree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.1"
android:src="#drawable/ram_disagree"/>
</LinearLayout>
</RelativeLayout>
#Seal
In my layout editor's Preview I changed the "Theme in Editor" to "Theme"
And I started to get errors like your screenshot.
See:
So, I selected "All" -> "AppTheme" from the "Theme in Editor" option... Do not forget to press "Ok"
And the errors went away:
So, why do not you also try to set it to "All" -> "AppTheme"
Further it appears to me that you might have created style(s) which do not inherit from "proper parent".
Using below example: "AppTheme" inherits all the required attributes from "Theme.AppCompat.Light.DarkActionBar". And thus, you need to only specify the attributes you need modified.
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
...
<item name="colorAccent">#color/colorAccent</item>
...
</style>
replace
android:layout_below="#id/query_detail"
in
<com.sdrcu.operatingdecisions.view.scrollabletbv.ScrollTableView4
android:id="#+id/scrollTableView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/query_detail"
/>
with
android:layout_below="#+id/query_detail"
yes you miss the parameter height and weight
android:layout_width="match_parent"
android:layout_height="wrap_content"
add in your layout it works Use the Tag
I have the following layout for my custom log in dialog
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="#dimen/padding_large">
<ImageButton android:src="#drawable/ic_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/dialog.login.settings"
android:padding="#dimen/margin_medium" />
<TextView android:text="#string/dialog.login.text.user_name"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText android:id="#+id/dialog.login.user_name"
android:layout_width="match_parent"
android:gravity="center"
android:ems="20"
android:layout_height="wrap_content"
android:inputType="text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView android:text="#string/dialog.login.text.password"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText android:id="#+id/dialog.login.password"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox android:id="#+id/dialog.login.show_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/dialog.login.check.show_password"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_margin="#dimen/margin_medium"
android:checked="false" />
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button android:id="#+id/dialog.login.cancel"
android:drawableStart="#drawable/ic_exit_black"
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginEnd="#dimen/margin_medium"
android:text="#string/dialog.login.button.cancel" />
<Button android:id="#+id/dialog.login.connect"
android:text="#string/dialog.login.button.connect"
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_marginStart="#dimen/margin_medium"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
when I create the dialog and setcontentview the width of the dialog becomes equal to that of the image button on the first row
if I remove that , it becomes the size of the EditText (dialog.login.user_name) whose ems is 20
when I make the dialog's constructor call the base dialog constructor with a theme of R.style.Theme.Material.Dialog it does get the correct (about 3/4 of the screen) but the problem is that it ignores my primary and accent colours (which is normal)
Is there a way to have the dialog have the Theme.Material.Dialog size but still keep my own primary/accent colours?
thanks in advance for any help you can provide
After a lot of searching it seems that the solution is to actually replace the dialogTheme attribute of my main theme, so the solution was:
<style name="app.theme"
parent="android:Theme.Material.Light.NoActionBar.Fullscreen">
<item name="android:dialogTheme">#style/app.dialog</item>
......
</style>
<style name="app.dialog"
parent="android:Theme.Material.Light.Dialog">
<item name="android:colorPrimary">#color/primary</item>
<item name="android:colorPrimaryDark">#color/primary.dark</item>
<item name="android:colorAccent">#color/accent</item>
</style>
I want to create a progress bar in the middle of a standard button, something like this :
In the xml layout, when i click the progressbar, i do see that it's located where i wish it to be, but on realtime, i can't see it, it feels like its hiding below the button.
I've tried :
Changing the view's positioning (button above/below progressbar)
indeterminate
Playing with ProgressBar's style
Nothing seemed to be working.
Here's my xml :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<Button
android:id="#+id/button_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:elevation="1dp"
android:text="test button" />
<ProgressBar
android:id="#+id/progress"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/button_id"
android:layout_alignTop="#+id/button_id"
android:layout_centerHorizontal="true"
android:indeterminate="true"
android:indeterminateTint="#android:color/holo_blue_dark"
android:visibility="visible" />
</RelativeLayout>
The problem is related with elevation. Add elevation to the ProgressBar
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<Button
android:id="#+id/button_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:elevation="1dp"
android:text="test button" />
<ProgressBar
android:id="#+id/progress"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/button_id"
android:layout_alignTop="#+id/button_id"
android:layout_centerHorizontal="true"
android:indeterminate="true"
android:elevation="2dp"
android:indeterminateTint="#android:color/holo_blue_dark"
android:visibility="visible" />
</RelativeLayout>
In the Preview, the ProgressBar is always invisible (at least to me).
The problem is, that you applied an elevation to your button. this changes the z-level of a view. So the ProgressBar really is behind your button, because the ProgressBar does not have an elevation.
Giving the ProgressBar an elevation of 3dp worked for me.
<ProgressBar
android:id="#+id/progress"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/button_id"
android:layout_alignTop="#+id/button_id"
android:layout_centerHorizontal="true"
android:indeterminate="true"
android:elevation="3dp"
android:indeterminateTint="#android:color/holo_blue_dark"
android:visibility="visible" />
EDIT:
You will be better of, using a ProgressDialog.
ProgressDialog dialog = new ProgressDialog(this);
dialog.setMessage("Wait...");
dialog.show();
If you still need to support devices older than 21 (thus can't use android:elevation), try wrapping your button in another dummy layout. I'm using FrameLayout as an example.
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Submit" />
</FrameLayout>
<ProgressBar
android:id="#+id/progressBar"
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_gravity="center"
android:indeterminateTint="#android:color/white" />
</FrameLayout>
So I have 2 activities both with a support Toolbar. The toolbar is a different color on the 2 activities so I have defined a base color (white) in the toolbar xml and then in the other activity if override the background. For some reason if I switch between the 2 activities 5 or 6 times the background of the non default activity ends up becoming the background for the other activity.
Code time:
Layout of the toolbar:
<?xml version="1.0" encoding="utf-8"?>
<!-- We use a Toolbar so that our drawer can be displayed
in front of the action bar -->
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:minHeight="?attr/actionBarSize">
<!-- I have to use a custom view in order to set a custom font. -->
<TextView
android:id="#+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="24sp"/>
</android.support.v7.widget.Toolbar>
`
Login Layout (with changing toolbar color)
`
<include layout="#layout/toolbar"/>
<!--<include layout="#layout/toolbar_seam"/>-->
<RelativeLayout
android:id="#+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_below="#+id/toolbar"
android:background="#drawable/login_gradient"/>
<TextView
android:id="#+id/company_program_label"
style="#style/basicShadow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/toolbar"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:text=""
android:textColor="#FFFFFF"
android:textSize="24sp"/>
<RelativeLayout
android:id="#+id/platform_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/company_program_label"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="6dp">
<RelativeLayout
android:id="#+id/username_input_wrapper"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/login_field_top"
>
<EditText
android:id="#+id/username"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="15dp"
android:layout_marginStart="15dp"
android:layout_marginTop="5dp"
android:layout_toLeftOf="#+id/save_username"
android:layout_toStartOf="#+id/save_username"
android:background="#FFFFFF"
android:hint="#string/login_username_hint"
android:inputType="text"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:singleLine="true"
android:textSize="16sp"
/>
<!--android:background="#FFFFFF"-->
<ImageButton
android:id="#+id/save_username"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/username"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/username"
android:layout_centerVertical="true"
android:background="#android:color/transparent"
android:padding="12dp"
android:scaleType="centerInside"
android:src="#drawable/pin_up"
/>
</RelativeLayout>
<RelativeLayout
android:id="#+id/password_input_wrapper"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/username_input_wrapper"
android:background="#drawable/login_field"
>
<EditText
android:id="#+id/password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="15dp"
android:layout_marginStart="15dp"
android:layout_marginTop="5dp"
android:layout_toLeftOf="#+id/show_password"
android:layout_toStartOf="#+id/show_password"
android:background="#FFFFFF"
android:hint="#string/login_password_hint"
android:inputType="textPassword"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:singleLine="true"
android:textSize="16sp"
/>
<ImageButton
android:id="#+id/show_password"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/password"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/password"
android:layout_centerVertical="true"
android:background="#android:color/transparent"
android:padding="12dp"
android:scaleType="centerInside"
android:src="#drawable/eye_closed"
/>
</RelativeLayout>
<Button
android:id="#+id/login_button"
style="#style/basic_button_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/password_input_wrapper"
android:background="#drawable/login_button"
android:enabled="false"
android:text="#string/login_login_button"
/>
</RelativeLayout>
<TextView
android:id="#+id/terms"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/platform_wrapper"
android:layout_marginTop="12dp"
android:gravity="center"
android:text="#string/login_terms_and_policy"
android:textSize="11sp"
/>
<Button
android:id="#+id/forgot_button"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_below="#+id/terms"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:background="#66000000"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:text="#string/login_forgot_button"
android:textColor="#66FFFFFF"
android:textSize="12sp"
android:visibility="visible"
/>
</RelativeLayout>
</LinearLayout>
other layout (which should have the default toolbar color)
<include layout="#layout/toolbar"/>
<include layout="#layout/toolbar_seam"/>
<FrameLayout
android:id="#+id/webview_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="#+id/debug_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</FrameLayout>
</LinearLayout>
In the login activity I have the following code to change the toolbar background color:
protected void themeToolbar()
{
super.themeToolbar();
this.navigationBack();
this.titleBlank();
this.toolbar.setBackgroundColor(Color.RED);
}
In order to transition between the activities I have a textview with a custom schema that triggers the other intent via LinkMovementMethod
terms = (TextView) this.findViewById(R.id.terms);
terms.setMovementMethod(LinkMovementMethod.getInstance());
The first couple of times i transition to and from the other activity everything is fine but after about 6 times the entire background of the other activity changes to the color set in this.toolbar.setBackgroundColor(Color.RED); which is really weird because the toolbar doesn't cover the entire page. What is even worse is that views that used to be white on the login activity now show up red.
My best guess is that there is some kind of shared ColorDrawable using for all white backgrounds and that it is being overridden with the the red color but I have no idea why.
Login as it should be:
Other activity as it should be:
Other activity after switching back and forth 6 times:
Login activity after other activity screws up:
Yes, Android shares the background drawable in activities with the same Theme. So create a new Drawable if you want to explicit set it:
setBackground(new ColorDrawable(Color.RED))
Use different styles for the toolbar instead changing the background explicitly. The color of the toolbar will be per activity, you can use whatever color you want.
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<!-- For transparent toolbar -->
<style name="AppTheme.AppBarOverlay.Transparent" parent="AppTheme.AppBarOverlay" >
<item name="android:background">#color/transparent</item>
</style>
Now just set the style of the toolbar.
Regular Toolbar
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="#style/AppTheme.AppBarOverlay" />
Transparent Toolbar
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="#style/AppTheme.AppBarOverlay.Transparent" />
I have created a custom RatingBar as described in one of the tutorials given here on stack-overflow and it's looking great, the problem is with the centering of the image. here is what I've got:
As you can see the TextView is centered vertically in the LinearLayout, but the RatingBar is at the top of it. Here is my xml code of this image:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:foregroundGravity="center" >
<LinearLayout
android:layout_width="320dp"
android:layout_height="match_parent"
android:gravity="center" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<RatingBar
android:id="#+id/ratingBar1"
style="#style/starsRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:numStars="5"
android:rating="2.3"
android:stepSize="1" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:src="#drawable/ic_launcher" />
</LinearLayout>
</ScrollView>
Here is the code of the styling:
<style name="starsRatingBar" parent="#android:style/Widget.RatingBar">
<item name="android:progressDrawable">#drawable/star_ratingbar_full</item>
<item name="android:minHeight">36dip</item>
<item name="android:maxHeight">36dip</item>
</style>
Any ideas in the RatingBar would be apprisiated!
THANKS
Ok, I think I've got it.
The key issue is the ScrollView: it automatically makes things compact, unless you specifically tell it otherwise. In the scroll view, set
android:fillViewport="true"
to make it use the space available.
Hello to get all items at top you have to put:
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:text="TextView" />
instead of:
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
if you just want the rating bar centred:
just remove style="#style/starsRatingBar"
EDIT:
forget any think I said befor, it seems to work better when I changed the style to : (adjust your min/max height to get "perfect result" )
<style name="starsRatingBar" parent="#android:style/Widget.RatingBar">
<item name="android:progressDrawable">#android:drawable/star_on</item>
<item name="android:minHeight">26dip</item>
<item name="android:maxHeight">26dip</item>
</style>