Skip to content

A custom loading view in which dots turn into bars and back again.

Notifications You must be signed in to change notification settings

itsaligadimi/LoadingDotBar

Repository files navigation

Loading.Bar

A custom loading view in which dots turn into bars and back again :D

one two three

Installation

Step 2. Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
        implementation 'com.github.itsaligadimi:LoadingDotBar:v1.1'
}

Usage

<com.agadimi.loadingdotbar.LoadingDotBarView
    android:id="@+id/loading"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:duration="1000"
    app:animation_cycle_delay="1000"
    app:dot_color="#c7cfac"
    app:bar_height="22dp"
    app:dot_radius="4dp"
    app:gap_size="5dp"/>
    
    
LoadingDotBarView loadingDotBarView = findViewById(R.id.loading);
loadingDotBarView.start();
loadingDotBarView.end();

width and height of the view are calculated based on the size of dots. So you can keep them 'wrap_content'.

Attributes

duration: (milliseconds) the time it takes to complete a cycle

animation_cycle_delay: (milliseconds) the delay between each cycle

dot_color: (color) color of the dots

bar_height: (dimension) height of the bar at its maxmimum

dot_radius: (dimension) dot radius

gap_size: (dimension) the gap between each dot

Functions

start(): start the animation

end(): end the animation

Contributing

If you wanna change anything, feel free to do it

Reference

Image and Demo UI are from dribbble UI, Pizza

About

A custom loading view in which dots turn into bars and back again.

Resources

Stars

Watchers

Forks

Packages

No packages published