I would like to create ProgressBar
along with text same as below.
Please guide me. I developed some design but I am not able to display text exactly right side of ProgressBar
as progress bar take min width. Please see below image:
I am stuck on this. Thanks in advance.
My Code is:
<RelativeLayout
android:layout_width="match_parent"
android:layout_below="@+id/lnrButtons"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginRight="30dp"
android:padding="5dp"
android:background="@drawable/white_button_selector">
<ProgressBar
android:id="@+id/progressBarHome"
android:layout_width="match_parent"
style="?android:attr/progressBarStyleHorizontal"
android:progressDrawable="@drawable/custom_progress_bar"
android:layout_height="wrap_content"
android:progress="50"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:indeterminate="false"/>
<TextView
android:id="@+id/txtProgress"
android:layout_width="wrap_content"
android:text="10%"
android:textColor="@color/light_orange"
android:background="@android:color/transparent"
android:layout_centerVertical="true"
android:layout_alignRight="@+id/progressBarHome"
android:layout_height="wrap_content"/>
</RelativeLayout>
After implementing code changes output is: