Just testing the new developer preview and noticed that my existing ring drawables are not rendering properly. Instead of a ring it's a full circle. Is it a bug or has something changed or am I doing it wrong to begin with? Any possible solutions?
here's the code:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@android:id/progress">
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="7.0">
<solid android:color="#ff5698fb"/>
</shape>
</item>
</layer-list>
Thanks!
Update
I've updated the shape as follows:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="7.0">
<solid android:color="#ff5698fb"/>
</shape>
</item>
<item >
<shape
android:innerRadiusRatio="4"
android:shape="ring"
android:thicknessRatio="5.5">
<solid android:color="#ffffff"/>
</shape>
</item>
</layer-list>
which produces a ring by overlaying two circles. But the progress bar that I'm using it in doesn't work.
Here is the code for the progress bar:
<ProgressBar
android:id="@+id/progressCircle"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:indeterminate="false"
android:max="100"
android:progress="65"
android:rotation="270"
android:progressDrawable="@drawable/progress_circle"
android:visibility="visible"/>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…