Ссылка поверх ссылки на изображение

Так как Api 21 вы можете сделать что-то подобное: предположив, что ваш ProgressBar так не работает:

 <ProgressBar xmlns:android="http://schemas.android.com/apk/res/android"
    style="?android:attr/progressBarStyleLarge"
    android:id="@+id/progress_bar"
    android:layout_width="@dimen/item_width"
    android:layout_height="@dimen/item_height"
    android:clickable="false"
    android:indeterminate="true"
    android:indeterminateDrawable="@drawable/progress"/>

, и это progress.xml:

<shape
    android:innerRadiusRatio="3"
    android:shape="ring"
    android:thicknessRatio="8"
    android:useLevel="false" >

    <size
        android:height="76dip"
        android:width="76dip" />

    <gradient
        android:angle="0"
        android:endColor="@color/colorGrayText"
        android:startColor="@android:color/transparent"
        android:type="sweep"
        android:useLevel="false" />

</shape>

Теперь вы можете сделать это на своем ProgressBar:

 ProgressBar progressBar = (ProgressBar) findViewById(R.id.progress_bar);
        if (progressBar != null) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                RotateDrawable rotateDrawable = (RotateDrawable) progressBar.getIndeterminateDrawable();
                rotateDrawable.setToDegrees(0);
            }
        }
0
задан double-beep 11 March 2019 в 14:01
поделиться