title: Changing translucent background color of progressbar android
body: <p>I want to change background color of the progressbar having black translucent background with opacity less than 50%. 
  I searched a lot about this but not able to find solution. 
  I don't know whether i'm right or not but it has some thing to do with mdecor property of the progressbar.</p>
  
  <p>Following is the code I am using it.</p>
  
  <pre><code>pd = ProgressDialog.show(getActivity(), null, null,true);       
  pd.setContentView(R.layout.remove_border);
  </code></pre>
  
  <p>The code for remove border layout is:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@android:color/transparent"
  android:orientation="vertical" &gt;
  
  &lt;ProgressBar
      android:id="@+id/progressBar1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center"
      android:background="@android:color/transparent"
      android:indeterminateDrawable="@drawable/my_progress_indeterminate" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>The code for my_progress_indeterminate is:</p>
  
  <pre><code>&lt;animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
  android:drawable="@drawable/loadingiconblack"
  android:pivotX="50%"
  android:pivotY="50%" /&gt;
  </code></pre>
  
  <p>Following is the image the background area is marked in red circle. I want to change color to white with same opacity.</p>
  
  <p><img src="https://i.stack.imgur.com/UsYUr.png" alt="enter image description here"></p>
  
  <p><strong>EDIT:</strong></p>
  
  <p><strong>Final solution to my issue thanks to Sripathi and user3298272 combining both solutions here is my updated answer:</strong></p>
  
  <pre><code>pd = new Dialog(this, android.R.style.Theme_Black);
  View view = LayoutInflater.from(this).inflate(R.layout.remove_border, null);
  pd.requestWindowFeature(Window.FEATURE_NO_TITLE);
  pd.getWindow().setBackgroundDrawableResource(R.color.transparent);
  pd.setContentView(view);
  pd.show();
  </code></pre>
  
  <p>remove_border xml code:
  Here android:gravity = "center" is added in linear layout code of mine.</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@android:color/transparent"
  android:gravity="center"
  android:orientation="vertical" &gt;
  
  &lt;ProgressBar
      android:id="@+id/progressBar1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center"
      android:background="@android:color/transparent"
      android:indeterminateDrawable="@drawable/my_progress_indeterminate" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>color xml code:</p>
  
  <pre><code>&lt;resources&gt;
  
    &lt;color name="transparent"&gt;#80FFFFFF&lt;/color&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p>In #80FFFFFF 80 is the opacity value 50% which i took from user3298272.</p>