0

Here is the code i need to change the color of the progressbar spinner or loader

    <android.support.constraint.ConstraintLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.conceptchest.conceptchest.mainConcept">

     <WebView
      android:id="@+id/mainWebView"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:layout_constraintRight_toRightOf="parent"
      app:layout_constraintLeft_toLeftOf="parent"
      app:layout_constraintBottom_toTopOf="@+id/progress1"
      app:layout_constraintTop_toTopOf="parent" />

     <ProgressBar
      android:id="@+id/progress1"
      aenter code herendroid:layout_centerHorizontal="true"
      android:layout_centerVertical="true"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:layout_constraintRight_toRightOf="parent"
      app:layout_constraintLeft_toLeftOf="parent"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintTop_toTopOf="parent"
      />


     />
    </android.support.constraint.ConstraintLayout>

Please help as i not able to change the color I have tried adding style and its not working

DumbCoder
  • 5,696
  • 3
  • 29
  • 40
kode sensei
  • 165
  • 1
  • 12

2 Answers2

1

Programmatically change your progress bar color look like this:

ProgressBar spinner = new android.widget.ProgressBar(getApplicationContext(), null, android.R.attr.progressBarStyle);
    spinner.getIndeterminateDrawable().setColorFilter(Color.parseColor("#FF0481"), PorterDuff.Mode.MULTIPLY);
Anand Diamond
  • 339
  • 1
  • 9
0

This solved my issue How to change color in circular progress bar?

My current code is

       <ProgressBar
          android:id="@+id/progress1"
          android:layout_centerHorizontal="true"
          android:layout_centerVertical="true"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          android:background ="@xml/progress"
          />
Community
  • 1
  • 1
kode sensei
  • 165
  • 1
  • 12