After loading the UI progressBar circle continuously rotating.
I have tried various solutions and out of all those following solution works for me to stop the circle spinning.
circle.xml :
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="ring"
android:innerRadiusRatio="2.3"
android:thicknessRatio="15.0"
android:useLevel="true">
<solid android:color="#0099ff"/>
</shape>
main_activity.xml :
RelativeLayout
android:layout_width="45dp"
android:layout_height="45dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginRight="24dp">
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_centerInParent="true"
android:indeterminate="false"
android:clickable="false"
android:progress="80"
android:max="10"
style="?android:progressBarStyleHorizontal"
android:progressDrawable="@drawable/circular" />
<TextView
android:id="@+id/txtProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="134"
android:layout_centerInParent="true"
android:textSize="8sp"
android:textColor="#FFF" />
</RelativeLayout>

No comments:
Post a Comment