Description of Progress bar in Android using Kotlin:

In Android progress bar is user interface control that is used to indicate the progress of an operation for example uploading a file
Downloading a  file.
Steps to use progress bar
Add progress bar in layout.
pallete->widgets->progress bar(horizonatal)
Align it horizontally set constraints
Add circular progress bar
set constraints of this bar
Set visibility of progress bar gone
In activity main xml- 
Write code given below
Android :min=”0″
Android:max=”100″
Android:progress=”50″
Add two buttons on layout and set their constraints set their text for first one is show progress bar
For second show progress bar values 
In activity main xml- Android:indeterminate=”true
Android:indeterminatebehaviour=”repeat”
Indeterminate behaviour is used when we don’t know how long process will complete.
Add code given below in main activity
button.setonclicklistener{
If(progreddbar2.visibilty==view.GONE)
{
progressbar2.visibility==view.VISIBLE
button.text=”hide progress bar”
}
else
{
progressbar2.visibility.view.GONE
button.text=”show progress bar”
}
button2.setonclicklistener{
Val msg=(progress bar.max)/progress bar.progress/)
textview.text=msg

Leave a Reply

Your email address will not be published. Required fields are marked *