In this
post we are going to create Circle Progress bar
by customizing horizontal default android progress bar.
Step
01
You
should create an xml file on drawable file for configure the appearance of progress
bar . So Im creating my xml file as circular_progress_bar.xml.
<? xml version="1.0"
encoding="UTF-8"?>
<layer -list xmlns:android="http://schemas.android.com/apk/res/android"
<item
android: id="@android: id/background">
<shape
<solid android: color="#000000"/>
</shape >
</item >
<item
android: id="@android: id/progress">
<rotate
<shape
<solid android: color="#ffffff"/>
</shape >
</rotate >
</item >
</layer -list>
Step
02
Then
create progress bar on your xml file
Then
give the name of xml file on your drawable folder as the parth of
android: progressDrawable
<ProgressBar
style="? android: attr /progressBarStyleHorizontal "
Step
03
Visual
the progress bar using thread
@Override
progBar= (ProgressBar)findViewById(R.id.progressBar);
}
// Update the progress bar
}
});
Thread. sleep( 50);
} catch (InterruptedException e) {
}
}
}
}). start ( );
}
}
No comments:
Post a Comment