title: Android indeterminate progress dialog progress bar style
body: <p>I cannot find the reason why the style of progress bar shown inside indeterminate ProgressDialog differs between Android 22 and 23.</p>
  
  <p>Let's take a very simple layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      android:paddingBottom="@dimen/activity_vertical_margin"
      tools:context="example.com.progressbarcolor.MainActivity"&gt;
  
      &lt;Button
          android:id="@+id/show_progress"
          android:text="Show progres"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerInParent="true"/&gt;
  
      &lt;ProgressBar
          android:layout_width="match_parent"
          android:layout_height="30dp"
          android:layout_alignParentBottom="true"
          android:indeterminate="true"
          android:visibility="visible"/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Pressing the button displays ProgressDialog:</p>
  
  <pre><code>ProgressDialog progressDialog = new ProgressDialog(MainActivity.this);
  progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
  progressDialog.setIndeterminate(false);
  progressDialog.setCancelable(false);
  progressDialog.setCanceledOnTouchOutside(false);
  progressDialog.show();
  </code></pre>
  
  <p>The style of the app is:</p>
  
  <pre><code>&lt;style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"&gt;
      &lt;!-- Customize your theme here. --&gt;
      &lt;item name="colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name="colorPrimaryDark"&gt;@color/colorPrimaryDark&lt;/item&gt;
      &lt;item name="colorAccent"&gt;@color/colorAccent&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>And finally the gradle file:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.3"
  
      defaultConfig {
          applicationId "example.com.progressbarcolor"
          minSdkVersion 16
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:23.3.0'
  }
  </code></pre>
  
  <p>As you can see on the images below both apps display the same progress bar when used directly inside layout but the colors are different inside ProgressDialog.</p>
  
  <p>On Android 22, the progress dialog shows green progress bar instead of red one.</p>
  
  <p>Nexus 5, API 22</p>
  
  <p><a href="https://i.stack.imgur.com/RCc02.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RCc02.png" alt="Nexus 5 - API 22"></a></p>
  
  <p>Nexus 5X, API 23</p>
  
  <p><a href="https://i.stack.imgur.com/1Kp6V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1Kp6V.png" alt="Nexus 5X - API 23"></a></p>