ProgressBar in Android using Jetpack Compose Last Updated : 12 Aug, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report ProgressBar is a material UI component in Android which is used to indicate the progress of any process such as for showing any downloading procedure, as a placeholder screen, and many more. In this article, we will take a look at the implementation of ProressBar in Android using Jetpack Compose.AttributesUsesmodifierto add padding to our progress indicator Bar. colorto add color to our progress indicator Bar. strokeWidththis attribute is used to give the width of the circular line of the progress indicator Bar.progressto indicate the progress of your circular progress Bar.trackColorto add the color of the track behind the progress indicator Bar..strokeCapto add the stroke cap of the progress indicator Bar.Step-by-Step ImplementationStep 1: Create a New ProjectTo create a new project in the Android Studio Canary Version please refer to How to Create a new Project in Android Studio Canary Version with Jetpack Compose.Step 2: Working with the MainActivity.kt fileNavigate to the app > java > your app’s package name and open the MainActivity.kt file. Inside that file add the below code to it. Comments are added inside the code to understand the code in more detail. Kotlin import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.material3.CircularProgressIndicator import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.StrokeCap import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { Column { // in below line we are calling // a progress bar method. SimpleCircularProgressComponent() } } } } // @Preview function is use to see preview // for our composable function in preview section. @Preview(showBackground = true) @Composable fun DefaultPreview() { GFGAppTheme { // we are passing our composable // function to display its preview. SimpleCircularProgressComponent(); } } @Composable fun SimpleCircularProgressComponent() { // CircularProgressIndicator is generally used // at the loading screen and it indicates that // some progress is going on so please wait. Column( // we are using column to align our // imageview to center of the screen. modifier = Modifier .fillMaxWidth() .fillMaxHeight(), // below line is used for specifying // vertical arrangement. verticalArrangement = Arrangement.Center, // below line is used for specifying // horizontal arrangement. horizontalAlignment = Alignment.CenterHorizontally ) { // below line is used to display // a circular progress bar. CircularProgressIndicator( // below line is used to add padding // to our progress bar. modifier = Modifier .size(100.dp) .padding(16.dp), // below line is used to add color // to our progress bar. color = Color.Blue, // below line is used to add stroke // width to our progress bar. strokeWidth = 8.dp, // below line is used to add track // color to our progress bar. trackColor = Color.LightGray, // below line is used to add strokeCap // to our progress bar. strokeCap = StrokeCap.Round ) } } Now run your app and see the output of the app. Output: Comment More infoAdvertise with us Next Article Text in Android using Jetpack Compose C chaitanyamunje Follow Improve Article Tags : Android Technical Scripter 2020 Android-Jetpack Similar Reads TopAppBar in Android using Jetpack Compose TopAppBar is similar to that of the Action Bar widget in Android. This is one of the most UI components in Android. The action bar is used to represent the app name and action items in Android. In this article, we will take a look at the implementation of the TopAppBar in Android using Jetpack compo 3 min read SmsManager in Android using Jetpack Compose Many times while building an android application we have to add a feature through which users will be able to directly send SMS from our android application. So in this article, we will take a look at How to send a text message over a phone using SMS Manager in Android using Jetpack Compose. A sampl 6 min read Services in Android using Jetpack Compose Services in Android applications are used to perform some background tasks within android applications. We can call the service to perform a specific task in the background of our application. That task will be performed continuously if our application is not visible to the user. Services are genera 6 min read Android Custom Progress Bar using Jetpack Compose Progress bar in android is used to display the progress of a specific task. There are different types of progress bars that are used within the android applications such as circular progress bar, horizontal progress bar, and many more. In this article, we will take a look at creating a custom horizo 5 min read Text in Android using Jetpack Compose Jetpack Compose is a new toolkit provided by Google. This is useful for designing beautiful UI designs. Android Text is a simple view in Android which is used to display text inside our App. In this article, we will take a look at the implementation of Text in Android using Jetpack Compose. Importan 5 min read Scaffold in Android using Jetpack Compose Scaffold in Android Jetpack is a composable function that provides a basic structure of the layout. It holds together different parts of the UI elements such as Application bars, floating action buttons, etc.There are a lot of apps that contain TopAppBar, Drawer, Floating Action Button, BottomAppBar 3 min read Like