圆形进度条的圆角

Round a corner of a circular progress bar

我有这个循环进度条

我想绕过最后一个拐角,所以它看起来像这样

可以这样做吗?

这是我的 XML 实际进度条:

<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:pivotX="50%"
android:pivotY="50%"
android:fromDegrees="0"
android:toDegrees="360">
<shape
    android:shape="ring"
    android:innerRadiusRatio="3"
    android:thicknessRatio="9"
    android:useLevel="false">

<gradient
    android:type="sweep"
    android:startColor="@android:color/holo_orange_light"
    android:endColor="@android:color/holo_red_light" />

</shape>

</rotate>

还有我的 ProgresBar:

<ProgressBar
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:indeterminateDrawable="@drawable/progress"/>

我看到了 Horizo​​ntalProgressBar 是怎么做的,但是 CircularProgressBar 没有看到,请问可以实现这个效果吗?它是怎么做到的?

我试过了但是没用

你必须像这样扩展你的可绘制对象:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <rotate android:fromDegrees="270" android:toDegrees="270">
            <shape
                android:innerRadiusRatio="2.55"
                android:shape="ring"
                android:thickness="4dp"
                android:useLevel="true">
                <solid android:color="@color/yourcolor" />
            </shape>
        </rotate>
    </item>
    <item android:bottom="261dp">
        <shape
            android:innerRadiusRatio="100000"
            android:shape="ring"
            android:thickness="2dp"
            android:useLevel="false">
            <solid android:color="@color/yourcolor" />
        </shape>
    </item>
    <item>
        <rotate>
            <inset android:insetBottom="261dp">
                <shape
                    android:innerRadiusRatio="100000"
                    android:shape="ring"
                    android:thickness="2dp"
                    android:useLevel="false">
                    <solid android:color="@color/yourcolor" />
                </shape>
            </inset>
        </rotate>
    </item>
</layer-list>

这样你就可以在环上画一个点。当然你必须微调半径和厚度。

最后我使用了这个库https://github.com/lopspower/CircularProgressBar它和我想要的非常相似