There is a ProgressBar

<ProgressBar style="?android:attr/progressBarStyleHorizontal" android:id="@+id/progressbar" android:layout_width="250dp" android:layout_height="270dp" android:indeterminate="false" android:max="10" android:progress="0" android:progressDrawable="@drawable/progressbar" /> 

preogressbar.xml

 <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="8" > <solid android:color="#51ff00" /> </shape> </item> </layer-list> 

The question is how to change the starting point of the progressbar (in the form of a ring), i.e. I currently have 0% on the right (3 hours by the hour), how to make the start at the top (12 hours by the hour).

    1 answer 1

    The code pulled out of your project, everything works fine.

    Progressbar

     <ProgressBar android:id="@+id/pb_btn_popular" android:layout_width="60dp" android:layout_height="60dp" android:indeterminate="false" android:layout_centerInParent="true" android:progressDrawable="@drawable/circular_progress_bar" android:background="@drawable/circle_shape" style="?android:attr/progressBarStyleHorizontal" android:max="100" android:progress="0"/> 

    circular_progress_bar

     <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="270" android:toDegrees="270"> <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thickness="5dp" android:useLevel="true"><!-- this line fixes the issue for lollipop api 21 --> <gradient android:angle="0" android:endColor="#ffffff" android:startColor="#ffffff" android:type="sweep" android:useLevel="false" /> </shape> </rotate> 

    circle_shape

     <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="ring" android:innerRadiusRatio="2.5" android:thickness="5dp" android:useLevel="false"> <solid android:color="@android:color/transparent" /> </shape>