Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys today i'am trying to do my custom progress bar, for that i created a spinner_inner and a spinner_outer, but my inner size seems to be to large and overlaps the outer, but it's smaller.
Somewhere in the code the drawable is being resized.

my activity xml

XML
<ProgressBar
           style="@style/Spinner"
           android:layout_width="100dp"
           android:layout_height="100dp"
           android:indeterminateDrawable="@drawable/loading" />

       <TextView
           android:id="@+id/login_status_message"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:layout_marginBottom="16dp"
           android:fontFamily="sans-serif-light"
           android:text="@string/login_progress_signing_in"
           android:textAppearance="?android:attr/textAppearanceMedium" />
   </LinearLayout>


my style xml

XML
<style name="Spinner">
       <item name="android:indeterminate">true</item>
       <item name="android:indeterminateDrawable">@drawable/spinner_outer</item>
       <item name="android:indeterminateDuration">2000</item>
       <item name="android:indeterminateOnly">true</item>
   </style>



my layer list to rotate and deploy the draws

XML
    <?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <item android:drawable="@drawable/spinner_inner"/>
    <item>
        <rotate
            android:fromDegrees="0"
            android:interpolator="@android:anim/linear_interpolator"
            android:pivotX="50%"
            android:pivotY="50%"
            android:toDegrees="360" >
            <bitmap
                android:antialias="true"
                android:filter="true"
                android:src="@drawable/spinner_outer" />
        </rotate>
    </item>

</layer-list>


I had already searched for an answer but no sucess

WHAT i'am getting
http://i.stack.imgur.com/UB2r8.png

What i pretend

http://i.imgur.com/hLoJG5b.png
Posted
Updated 24-Sep-13 3:00am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900