title: How to create progress bar as border of imageview
body: <p>I need to make progress bar as border of imageview. Here is my xml:</p>
  <pre><code>&lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:id=&quot;@+id/loading_status&quot;
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:layout_gravity=&quot;center&quot;
      android:gravity=&quot;center_horizontal&quot;&gt;
  
      &lt;ImageView
          android:id=&quot;@+id/image&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_alignParentStart=&quot;true&quot;
          android:layout_marginStart=&quot;13dp&quot;
          android:src=&quot;@drawable/circle&quot; /&gt;
  
      &lt;ProgressBar
          android:id=&quot;@+id/progressBar&quot;
          style=&quot;?android:attr/progressBarStyleHorizontal&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_alignStart=&quot;@+id/image&quot;
          android:layout_alignParentTop=&quot;true&quot;
          android:layout_marginStart=&quot;116dp&quot;
          android:layout_marginTop=&quot;41dp&quot;
          android:background=&quot;@drawable/circle_shape&quot;
          android:indeterminate=&quot;false&quot;
          android:max=&quot;100&quot;
          android:progress=&quot;65&quot;
          android:progressDrawable=&quot;@drawable/circular_progress_bar&quot; /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  <p>here is a circle_shpae.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;shape
      xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:shape=&quot;ring&quot;
      android:thickness=&quot;1dp&quot;
      android:innerRadius=&quot;32dp&quot;
      android:useLevel=&quot;false&quot;&gt;
      &lt;solid android:color=&quot;#f20837&quot; /&gt;
  &lt;/shape&gt;
  </code></pre>
  <p>and circular_progress_bar.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;rotate xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:fromDegrees=&quot;270&quot;
      android:toDegrees=&quot;270&quot;&gt;
      &lt;shape
          android:innerRadius=&quot;32dp&quot;
          android:shape=&quot;ring&quot;
          android:thickness=&quot;1dp&quot;
          android:useLevel=&quot;true&quot;&gt;
  
          &lt;gradient
              android:angle=&quot;0&quot;
              android:endColor=&quot;#EFCD93&quot;
              android:startColor=&quot;#EFCD93&quot;
              android:type=&quot;sweep&quot;
              android:useLevel=&quot;false&quot; /&gt;
      &lt;/shape&gt;
  &lt;/rotate&gt;
  </code></pre>
  <p>If I set  <code>android:layout_width=&quot;wrap_content&quot;</code>and <code>android:layout_height=&quot;wrap_content&quot;</code> for <code>progressBar</code>, it is how in a picture.  If I set for example  <code>android:layout_width=&quot;90dp&quot;</code>and <code>android:layout_height=&quot;90dp&quot;</code> for <code>progressBar</code> I can see progressBar but at the top of the layout.
  <a href="https://i.stack.imgur.com/2dBnv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2dBnv.png" alt="enter image description here" /></a></p>
  <p>I didn't see progressBar. I can't understand what is the trouble.</p>