Create a Custom Loading Progress Bar In Android Studio

by | Android for Beginners, Android UI/UX Tutorials, Basics, City Guide App, UI UX

In this tutorial, we will create a custom progress bar in android studio. We will use a regular progress bar but will add a custom background. If you want to watch any of the videos that are created before then click here.

Create a background

To create a custom progress bar android we have to create a background which will be white and in circular shape So, to create that GOTO -> res -> drawable -> right click and create a new resource file and name it white_circle and paste the code below.

white_circle.xml


<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <solid android:color="@color/white"></solid>
    <corners android:radius="100dp"></corners>

</shape>

Create a Custom Progress Bar Android

Now to create a custom progress bar android we have to add a <RelativeLayout> in that we will add a background color and change it’s visibilty to show, Gone or hidden. Inside this relativelayout we will use the progress bar.

Progress Bar XML

<RelativeLayout
    android:id="@+id/login_progress_bar"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:background="@drawable/white_circle"
    android:elevation="8dp"
    android:padding="20dp"
    android:visibility="gone">

    <ProgressBar
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:layout_centerInParent="true"/>

</RelativeLayout>

Join Us

Videos are always a better source for in-depth knowledge so, join us at YouTube and get notified on each new upload.

Android Studio Complete Project Bulls rent- Splash Screen- Login Screen with validation- Signup Screen- User profile- Phone number verification OTP- Google verification

Join Our Mailing List

Join our mailing list to receive the latest, Free Courses, Video Tutorials, free codes and updates regarding Tutorials and services. You will also start getting coupons on the related services.

You have Successfully Subscribed!

FLUTTER APP

Learn Flutter App development from scratch. Create LOGIN APP that can be used with any application which requires Login Sign Up functionality.

You can watch it on YouTube or read and get source code from Blog Post.

You have Successfully Subscribed!