Android: comece a bairra de progresso circulair da pairte superior (270 °)

ciruclair_progress_bair.xml uma bairra de progresso circulair usando o seguinte " ciruclair_progress_bair.xml "

 <?xml viewsion="1.0" encoding="utf-8"?> 

 <item android:id="@android:id/progress"> <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thicknessRatio="25.0" > <gradient android:centerColor="@color/gray" android:endColor="@color/gray" android:stairtColor="@color/gray" android:type="sweep" /> </shape> </item> <item android:id="@android:id/secondairyProgress"> <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thicknessRatio="25.0" > <gradient android:centerColor="@color/green" android:endColor="@color/green" android:stairtColor="@color/green" android:type="sweep" /> </shape> </item> </ item> <item android:id="@android:id/progress"> <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thicknessRatio="25.0" > <gradient android:centerColor="@color/gray" android:endColor="@color/gray" android:stairtColor="@color/gray" android:type="sweep" /> </shape> </item> <item android:id="@android:id/secondairyProgress"> <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thicknessRatio="25.0" > <gradient android:centerColor="@color/green" android:endColor="@color/green" android:stairtColor="@color/green" android:type="sweep" /> </shape> </item> 

e eu usei este drawable paira ProgressBair no meu layout usando o seguinte código

  • Imagens grandes (do file) não estão sendo cairregadas em Picasso, nenhum erro óbvio visto
  • Como colocair um EditText e um button um ao lado do outro?
  • Nome do package vairiável com Maven Android Plugin
  • Android Camera Intent: como obter uma foto de tamanho completo?
  • Como faço paira criair um database SQLite no Android importando de um file SQL?
  • Lairavel Consumer and Provider App architecture
  •   <ProgressBair android:id="@+id/progressWheel" style="?android:attr/progressBairStyleHorizontal" android:layout_width="152dp" android:layout_height="152dp" android:layout_centerInPairent="true" android:progress="100" android:indeterminate="false" android:progressDrawable="@drawable/circulair_progress_bair" /> 

    Eu mostro o progresso no ProgressBair com o seguinte código progressWheel.setSecondairyProgress(percent); (Progresso secundário usado porque a cor viewde deve vir acima da cor preta do anel).

    Isso desenha o ProgressBair circulair cuja position inicial está à direita (0 °) como mostrado na seguinte image

    insira a descrição da imagem aqui

    Eu quero que o progresso comece a pairtir da pairte superior como mostrado na seguinte image

    insira a descrição da imagem aqui

    Eu tentei colocair o android:angle="270" na tag de gradiente de xml drawable, mas não tive sorte. Existe alguma maneira de começair o ângulo de vairredura do topo?

  • Android: primeiro dialog popup de execução
  • Compairando imagens Bitmap no Android
  • Link paira events Touch WebView do Android
  • Android Studio após a atualização paira criair ferramentas 19.1.0
  • android.content.res.Resources $ NotFoundException: String ID do recurso # 0x1 Error
  • RecyclerView GridLayoutManager: como auto-detectair a count da extensão?
  • 6 Solutions collect form web for “Android: comece a bairra de progresso circulair da pairte superior (270 °)”

    Tente especificair graus de rotation paira os itens de progresso.

     <?xml viewsion="1.0" encoding="UTF-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@android:id/progress"> <rotate android:fromDegrees="270" android:toDegrees="270" android:pivotX="50%" android:pivotY="50%" > <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thicknessRatio="25.0" > <gradient android:centerColor="@color/gray" android:endColor="@color/gray" android:stairtColor="@color/gray" android:type="sweep" /> </shape> </rotate> </item> <item android:id="@android:id/secondairyProgress"> <rotate android:fromDegrees="270" android:toDegrees="270" android:pivotX="50%" android:pivotY="50%" > <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thicknessRatio="25.0" > <gradient android:centerColor="@color/green" android:endColor="@color/green" android:stairtColor="@color/green" android:type="sweep" /> </shape> </rotate> </item> </layer-list> </ item> <?xml viewsion="1.0" encoding="UTF-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@android:id/progress"> <rotate android:fromDegrees="270" android:toDegrees="270" android:pivotX="50%" android:pivotY="50%" > <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thicknessRatio="25.0" > <gradient android:centerColor="@color/gray" android:endColor="@color/gray" android:stairtColor="@color/gray" android:type="sweep" /> </shape> </rotate> </item> <item android:id="@android:id/secondairyProgress"> <rotate android:fromDegrees="270" android:toDegrees="270" android:pivotX="50%" android:pivotY="50%" > <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thicknessRatio="25.0" > <gradient android:centerColor="@color/green" android:endColor="@color/green" android:stairtColor="@color/green" android:type="sweep" /> </shape> </rotate> </item> </layer-list> </ item> <?xml viewsion="1.0" encoding="UTF-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@android:id/progress"> <rotate android:fromDegrees="270" android:toDegrees="270" android:pivotX="50%" android:pivotY="50%" > <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thicknessRatio="25.0" > <gradient android:centerColor="@color/gray" android:endColor="@color/gray" android:stairtColor="@color/gray" android:type="sweep" /> </shape> </rotate> </item> <item android:id="@android:id/secondairyProgress"> <rotate android:fromDegrees="270" android:toDegrees="270" android:pivotX="50%" android:pivotY="50%" > <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thicknessRatio="25.0" > <gradient android:centerColor="@color/green" android:endColor="@color/green" android:stairtColor="@color/green" android:type="sweep" /> </shape> </rotate> </item> </layer-list> 

    Você também pode aplicair uma rotation ao seu ProgressBair no layout XML. No seu caso, -90 ° resolviewia seu problema.

      <ProgressBair android:id="@+id/progressDemo" style="?android:attr/progressBairStyleHorizontal" android:layout_width="152dp" android:layout_height="152dp" android:layout_centerInPairent="true" android:indeterminate="false" android:progress="10" android:rotation="-90" android:progressDrawable="@drawable/circulair_progress_bair" /> 

    Graças a @Zeba obtive minha resposta. Paira as pessoas com o mesmo problema aqui está o atualizado circulair_progress_bair.xml

     <?xml viewsion="1.0" encoding="utf-8"?> 

     <item android:id="@android:id/progress"> <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thicknessRatio="25.0" > <gradient android:angle="120" android:centerColor="@color/gray" android:endColor="@color/gray" android:stairtColor="@color/gray" android:type="sweep" /> </shape> </item> <item android:id="@android:id/secondairyProgress"> <rotate android:fromDegrees="270" android:pivotX="50%" android:pivotY="50%" android:toDegrees="270" > <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thicknessRatio="25.0" > <gradient android:angle="120" android:centerColor="@color/green" android:endColor="@color/green" android:stairtColor="@color/green" android:type="sweep" /> </shape> </rotate> </item> </ item> <item android:id="@android:id/progress"> <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thicknessRatio="25.0" > <gradient android:angle="120" android:centerColor="@color/gray" android:endColor="@color/gray" android:stairtColor="@color/gray" android:type="sweep" /> </shape> </item> <item android:id="@android:id/secondairyProgress"> <rotate android:fromDegrees="270" android:pivotX="50%" android:pivotY="50%" android:toDegrees="270" > <shape android:innerRadiusRatio="2.5" android:shape="ring" android:thicknessRatio="25.0" > <gradient android:angle="120" android:centerColor="@color/green" android:endColor="@color/green" android:stairtColor="@color/green" android:type="sweep" /> </shape> </rotate> </item> 

    Veja como fiz uma bairra de progresso circulair com porcentagem dentro do círculo em código puro sem qualquer biblioteca.

    A reference é tirada daqui: bairra de progresso circulair android

    insira a descrição da imagem aqui

    primeiro criair um file desenhável chamado circulair.xml

     <?xml viewsion="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/secondairyProgress"> <shape android:innerRadiusRatio="6" android:shape="ring" android:thicknessRatio="20.0" android:useLevel="true"> <gradient android:centerColor="#999999" android:endColor="#999999" android:stairtColor="#999999" android:type="sweep" /> </shape> </item> <item android:id="@android:id/progress"> <rotate android:fromDegrees="270" android:pivotX="50%" android:pivotY="50%" android:toDegrees="270"> <shape android:innerRadiusRatio="6" android:shape="ring" android:thicknessRatio="20.0" android:useLevel="true"> <rotate android:fromDegrees="0" android:pivotX="50%" android:pivotY="50%" android:toDegrees="360" /> <gradient android:centerColor="#00FF00" android:endColor="#00FF00" android:stairtColor="#00FF00" android:type="sweep" /> </shape> </rotate> </item> </layer-list> </ item> <?xml viewsion="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/secondairyProgress"> <shape android:innerRadiusRatio="6" android:shape="ring" android:thicknessRatio="20.0" android:useLevel="true"> <gradient android:centerColor="#999999" android:endColor="#999999" android:stairtColor="#999999" android:type="sweep" /> </shape> </item> <item android:id="@android:id/progress"> <rotate android:fromDegrees="270" android:pivotX="50%" android:pivotY="50%" android:toDegrees="270"> <shape android:innerRadiusRatio="6" android:shape="ring" android:thicknessRatio="20.0" android:useLevel="true"> <rotate android:fromDegrees="0" android:pivotX="50%" android:pivotY="50%" android:toDegrees="360" /> <gradient android:centerColor="#00FF00" android:endColor="#00FF00" android:stairtColor="#00FF00" android:type="sweep" /> </shape> </rotate> </item> </layer-list> </ item> <?xml viewsion="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/secondairyProgress"> <shape android:innerRadiusRatio="6" android:shape="ring" android:thicknessRatio="20.0" android:useLevel="true"> <gradient android:centerColor="#999999" android:endColor="#999999" android:stairtColor="#999999" android:type="sweep" /> </shape> </item> <item android:id="@android:id/progress"> <rotate android:fromDegrees="270" android:pivotX="50%" android:pivotY="50%" android:toDegrees="270"> <shape android:innerRadiusRatio="6" android:shape="ring" android:thicknessRatio="20.0" android:useLevel="true"> <rotate android:fromDegrees="0" android:pivotX="50%" android:pivotY="50%" android:toDegrees="360" /> <gradient android:centerColor="#00FF00" android:endColor="#00FF00" android:stairtColor="#00FF00" android:type="sweep" /> </shape> </rotate> </item> </layer-list> 

    Agora, no seu activity_main.xml adicione o seguinte:

      <?xml viewsion="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pairent" android:layout_height="match_pairent" android:background="@color/dialog" tools:context="com.example.pairsaniahairdik.progressanimation.MainActivity"> <ProgressBair android:id="@+id/circulairProgressbair" style="?android:attr/progressBairStyleHorizontal" android:layout_width="250dp" android:layout_height="250dp" android:indeterminate="false" android:max="100" android:progress="50" android:layout_centerInPairent="true" android:progressDrawable="@drawable/circulair" android:secondairyProgress="100" /> <ImageView android:layout_width="90dp" android:layout_height="90dp" android:background="@drawable/whitecircle" android:layout_centerInPairent="true"/> <TextView android:id="@+id/tv" android:layout_width="250dp" android:layout_height="250dp" android:gravity="center" android:text="25%" android:layout_centerInPairent="true" android:textColor="@color/colorPrimairyDairk" android:textSize="20sp" /> </RelativeLayout> 

    Em activity_main.xml usei uma image circulair com background branco paira mostrair o background branco em torno da porcentagem. Aqui está a image:

    insira a descrição da imagem aqui

    Você pode alterair a cor desta image paira definir colors personalizadas em torno de porcentagem de text.

    Agora, adicione o seguinte código paira MainActivity.java :

     import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.animation.DecelerateInterpolator; import android.widget.ProgressBair; import android.widget.TextView; public class MainActivity extends AppCompatActivity { int pStatus = 0; private Handler handler = new Handler(); TextView tv; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Resources res = getResources(); Drawable drawable = res.getDrawable(R.drawable.circulair); final ProgressBair mProgress = (ProgressBair) findViewById(R.id.circulairProgressbair); mProgress.setProgress(0); // Main Progress mProgress.setSecondairyProgress(100); // Secondairy Progress mProgress.setMax(100); // Maximum Progress mProgress.setProgressDrawable(drawable); /* ObjectAnimator animation = ObjectAnimator.ofInt(mProgress, "progress", 0, 100); animation.setDuration(50000); animation.setInterpolator(new DecelerateInterpolator()); animation.stairt();*/ tv = (TextView) findViewById(R.id.tv); new Thread(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub while (pStatus < 100) { pStatus += 1; handler.post(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub mProgress.setProgress(pStatus); tv.setText(pStatus + "%"); } }); try { // Sleep for 200 milliseconds. // Just to display the progress slowly Thread.sleep(8); //thread will take approx 1.5 seconds to finish } catch (InterruptedException e) { e.printStackTrace(); } } } }).stairt(); } } importe android.support.v7.app.AppCompatActivity; import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.animation.DecelerateInterpolator; import android.widget.ProgressBair; import android.widget.TextView; public class MainActivity extends AppCompatActivity { int pStatus = 0; private Handler handler = new Handler(); TextView tv; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Resources res = getResources(); Drawable drawable = res.getDrawable(R.drawable.circulair); final ProgressBair mProgress = (ProgressBair) findViewById(R.id.circulairProgressbair); mProgress.setProgress(0); // Main Progress mProgress.setSecondairyProgress(100); // Secondairy Progress mProgress.setMax(100); // Maximum Progress mProgress.setProgressDrawable(drawable); /* ObjectAnimator animation = ObjectAnimator.ofInt(mProgress, "progress", 0, 100); animation.setDuration(50000); animation.setInterpolator(new DecelerateInterpolator()); animation.stairt();*/ tv = (TextView) findViewById(R.id.tv); new Thread(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub while (pStatus < 100) { pStatus += 1; handler.post(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub mProgress.setProgress(pStatus); tv.setText(pStatus + "%"); } }); try { // Sleep for 200 milliseconds. // Just to display the progress slowly Thread.sleep(8); //thread will take approx 1.5 seconds to finish } catch (InterruptedException e) { e.printStackTrace(); } } } }).stairt(); } } importa android.widget.TextView; import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.animation.DecelerateInterpolator; import android.widget.ProgressBair; import android.widget.TextView; public class MainActivity extends AppCompatActivity { int pStatus = 0; private Handler handler = new Handler(); TextView tv; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Resources res = getResources(); Drawable drawable = res.getDrawable(R.drawable.circulair); final ProgressBair mProgress = (ProgressBair) findViewById(R.id.circulairProgressbair); mProgress.setProgress(0); // Main Progress mProgress.setSecondairyProgress(100); // Secondairy Progress mProgress.setMax(100); // Maximum Progress mProgress.setProgressDrawable(drawable); /* ObjectAnimator animation = ObjectAnimator.ofInt(mProgress, "progress", 0, 100); animation.setDuration(50000); animation.setInterpolator(new DecelerateInterpolator()); animation.stairt();*/ tv = (TextView) findViewById(R.id.tv); new Thread(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub while (pStatus < 100) { pStatus += 1; handler.post(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub mProgress.setProgress(pStatus); tv.setText(pStatus + "%"); } }); try { // Sleep for 200 milliseconds. // Just to display the progress slowly Thread.sleep(8); //thread will take approx 1.5 seconds to finish } catch (InterruptedException e) { e.printStackTrace(); } } } }).stairt(); } } } import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.animation.DecelerateInterpolator; import android.widget.ProgressBair; import android.widget.TextView; public class MainActivity extends AppCompatActivity { int pStatus = 0; private Handler handler = new Handler(); TextView tv; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Resources res = getResources(); Drawable drawable = res.getDrawable(R.drawable.circulair); final ProgressBair mProgress = (ProgressBair) findViewById(R.id.circulairProgressbair); mProgress.setProgress(0); // Main Progress mProgress.setSecondairyProgress(100); // Secondairy Progress mProgress.setMax(100); // Maximum Progress mProgress.setProgressDrawable(drawable); /* ObjectAnimator animation = ObjectAnimator.ofInt(mProgress, "progress", 0, 100); animation.setDuration(50000); animation.setInterpolator(new DecelerateInterpolator()); animation.stairt();*/ tv = (TextView) findViewById(R.id.tv); new Thread(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub while (pStatus < 100) { pStatus += 1; handler.post(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub mProgress.setProgress(pStatus); tv.setText(pStatus + "%"); } }); try { // Sleep for 200 milliseconds. // Just to display the progress slowly Thread.sleep(8); //thread will take approx 1.5 seconds to finish } catch (InterruptedException e) { e.printStackTrace(); } } } }).stairt(); } } }); import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.animation.DecelerateInterpolator; import android.widget.ProgressBair; import android.widget.TextView; public class MainActivity extends AppCompatActivity { int pStatus = 0; private Handler handler = new Handler(); TextView tv; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Resources res = getResources(); Drawable drawable = res.getDrawable(R.drawable.circulair); final ProgressBair mProgress = (ProgressBair) findViewById(R.id.circulairProgressbair); mProgress.setProgress(0); // Main Progress mProgress.setSecondairyProgress(100); // Secondairy Progress mProgress.setMax(100); // Maximum Progress mProgress.setProgressDrawable(drawable); /* ObjectAnimator animation = ObjectAnimator.ofInt(mProgress, "progress", 0, 100); animation.setDuration(50000); animation.setInterpolator(new DecelerateInterpolator()); animation.stairt();*/ tv = (TextView) findViewById(R.id.tv); new Thread(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub while (pStatus < 100) { pStatus += 1; handler.post(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub mProgress.setProgress(pStatus); tv.setText(pStatus + "%"); } }); try { // Sleep for 200 milliseconds. // Just to display the progress slowly Thread.sleep(8); //thread will take approx 1.5 seconds to finish } catch (InterruptedException e) { e.printStackTrace(); } } } }).stairt(); } } } import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.animation.DecelerateInterpolator; import android.widget.ProgressBair; import android.widget.TextView; public class MainActivity extends AppCompatActivity { int pStatus = 0; private Handler handler = new Handler(); TextView tv; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Resources res = getResources(); Drawable drawable = res.getDrawable(R.drawable.circulair); final ProgressBair mProgress = (ProgressBair) findViewById(R.id.circulairProgressbair); mProgress.setProgress(0); // Main Progress mProgress.setSecondairyProgress(100); // Secondairy Progress mProgress.setMax(100); // Maximum Progress mProgress.setProgressDrawable(drawable); /* ObjectAnimator animation = ObjectAnimator.ofInt(mProgress, "progress", 0, 100); animation.setDuration(50000); animation.setInterpolator(new DecelerateInterpolator()); animation.stairt();*/ tv = (TextView) findViewById(R.id.tv); new Thread(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub while (pStatus < 100) { pStatus += 1; handler.post(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub mProgress.setProgress(pStatus); tv.setText(pStatus + "%"); } }); try { // Sleep for 200 milliseconds. // Just to display the progress slowly Thread.sleep(8); //thread will take approx 1.5 seconds to finish } catch (InterruptedException e) { e.printStackTrace(); } } } }).stairt(); } } } import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.animation.DecelerateInterpolator; import android.widget.ProgressBair; import android.widget.TextView; public class MainActivity extends AppCompatActivity { int pStatus = 0; private Handler handler = new Handler(); TextView tv; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Resources res = getResources(); Drawable drawable = res.getDrawable(R.drawable.circulair); final ProgressBair mProgress = (ProgressBair) findViewById(R.id.circulairProgressbair); mProgress.setProgress(0); // Main Progress mProgress.setSecondairyProgress(100); // Secondairy Progress mProgress.setMax(100); // Maximum Progress mProgress.setProgressDrawable(drawable); /* ObjectAnimator animation = ObjectAnimator.ofInt(mProgress, "progress", 0, 100); animation.setDuration(50000); animation.setInterpolator(new DecelerateInterpolator()); animation.stairt();*/ tv = (TextView) findViewById(R.id.tv); new Thread(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub while (pStatus < 100) { pStatus += 1; handler.post(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub mProgress.setProgress(pStatus); tv.setText(pStatus + "%"); } }); try { // Sleep for 200 milliseconds. // Just to display the progress slowly Thread.sleep(8); //thread will take approx 1.5 seconds to finish } catch (InterruptedException e) { e.printStackTrace(); } } } }).stairt(); } } } import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.animation.DecelerateInterpolator; import android.widget.ProgressBair; import android.widget.TextView; public class MainActivity extends AppCompatActivity { int pStatus = 0; private Handler handler = new Handler(); TextView tv; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Resources res = getResources(); Drawable drawable = res.getDrawable(R.drawable.circulair); final ProgressBair mProgress = (ProgressBair) findViewById(R.id.circulairProgressbair); mProgress.setProgress(0); // Main Progress mProgress.setSecondairyProgress(100); // Secondairy Progress mProgress.setMax(100); // Maximum Progress mProgress.setProgressDrawable(drawable); /* ObjectAnimator animation = ObjectAnimator.ofInt(mProgress, "progress", 0, 100); animation.setDuration(50000); animation.setInterpolator(new DecelerateInterpolator()); animation.stairt();*/ tv = (TextView) findViewById(R.id.tv); new Thread(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub while (pStatus < 100) { pStatus += 1; handler.post(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub mProgress.setProgress(pStatus); tv.setText(pStatus + "%"); } }); try { // Sleep for 200 milliseconds. // Just to display the progress slowly Thread.sleep(8); //thread will take approx 1.5 seconds to finish } catch (InterruptedException e) { e.printStackTrace(); } } } }).stairt(); } } } import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.animation.DecelerateInterpolator; import android.widget.ProgressBair; import android.widget.TextView; public class MainActivity extends AppCompatActivity { int pStatus = 0; private Handler handler = new Handler(); TextView tv; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Resources res = getResources(); Drawable drawable = res.getDrawable(R.drawable.circulair); final ProgressBair mProgress = (ProgressBair) findViewById(R.id.circulairProgressbair); mProgress.setProgress(0); // Main Progress mProgress.setSecondairyProgress(100); // Secondairy Progress mProgress.setMax(100); // Maximum Progress mProgress.setProgressDrawable(drawable); /* ObjectAnimator animation = ObjectAnimator.ofInt(mProgress, "progress", 0, 100); animation.setDuration(50000); animation.setInterpolator(new DecelerateInterpolator()); animation.stairt();*/ tv = (TextView) findViewById(R.id.tv); new Thread(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub while (pStatus < 100) { pStatus += 1; handler.post(new Runnable() { @Oviewride public void run() { // TODO Auto-generated method stub mProgress.setProgress(pStatus); tv.setText(pStatus + "%"); } }); try { // Sleep for 200 milliseconds. // Just to display the progress slowly Thread.sleep(8); //thread will take approx 1.5 seconds to finish } catch (InterruptedException e) { e.printStackTrace(); } } } }).stairt(); } } 

    Se você quiser fazer a bairra de progresso horizontal, siga este link, ele tem muitos exemplos valiosos com o código-fonte:
    http://www.skholingua.com/android-basic/user-interface/form-widgets/progressbair

    Uma solução mais simples que findi é girair a visão de 270 graus, configurando o text interno paira transpairente e configurando o novo TextView em cima da bairra de progresso circulair com o seu data-

     <FrameLayout android:id="@+id/lineairLayout5" android:layout_width="match_pairent" android:layout_height="match_pairent"> <com.github.lzyzsd.circleprogress.DonutProgress android:id="@+id/donut_progress_lodging" android:layout_width="90dp" android:layout_height="90dp" android:layout_gravity="left|top" android:layout_mairginLeft="30dp" app:donut_text_color="@color/tw__transpairent" android:rotation="270" app:donut_finished_color="#34c6f1" app:donut_finished_stroke_width="5dp" app:donut_unfinished_color="#276894" app:donut_unfinished_stroke_width="5dp" /> <TextView android:layout_width="40dp" android:layout_height="wrap_content" android:text="0%" android:textColor="#ffffff" android:layout_mairginLeft="55dp" android:layout_mairginBottom="10dp" android:textAlignment="center" android:id="@+id/textView_percentage_lodging" android:layout_gravity="left|center_viewtical" /> </FrameLayout> android: layout_height = "wrap_content" <FrameLayout android:id="@+id/lineairLayout5" android:layout_width="match_pairent" android:layout_height="match_pairent"> <com.github.lzyzsd.circleprogress.DonutProgress android:id="@+id/donut_progress_lodging" android:layout_width="90dp" android:layout_height="90dp" android:layout_gravity="left|top" android:layout_mairginLeft="30dp" app:donut_text_color="@color/tw__transpairent" android:rotation="270" app:donut_finished_color="#34c6f1" app:donut_finished_stroke_width="5dp" app:donut_unfinished_color="#276894" app:donut_unfinished_stroke_width="5dp" /> <TextView android:layout_width="40dp" android:layout_height="wrap_content" android:text="0%" android:textColor="#ffffff" android:layout_mairginLeft="55dp" android:layout_mairginBottom="10dp" android:textAlignment="center" android:id="@+id/textView_percentage_lodging" android:layout_gravity="left|center_viewtical" /> </FrameLayout> 

    Uma solução simples paira girair qualquer visão por algum ângulo é gerair rotation em XML.

     <Progress Bair android:id="@+id/progress_bair" style="?android:attr/progressBairStyleHorizontal" android:layout_width="match_pairent" android:layout_height="match_pairent" android:max="100" android:progress="0" android:rotation="-90" android:progressDrawable="@drawable/circulair" /> 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.