Skip to content

Latest commit

 

History

History
109 lines (96 loc) · 2.66 KB

README.md

File metadata and controls

109 lines (96 loc) · 2.66 KB

ClubhouseProgressBar

⭕️Indeterminate ProgressBar that exactly looks like in Clubhouse iOS

What is Clubhouse ProgressBar?



Demo



Dependency

Add this in your root build.gradle file (not your module build.gradle file)

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

Then, Add the library to your module build.gradle

dependencies {
    implementation 'com.github.Jun-Hub:ClubhouseProgressBar:1.0.2'
}


Usage

<com.github.joon.chprogressbar.ChProgressBar
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />


Detail Usage

<com.github.joon.chprogressbar.ChProgressBar
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:dotCount="5"
    app:dotRadius="20dp"
    app:dotInterval="10dp"
    app:inactiveColor="@color/purple_200"
    app:activeColor="@color/purple_700"
    app:animationDuration="500" />

You can set option programmatically also.

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    binding = ActivityMainBinding.inflate(layoutInflater)
    setContentView(binding.root)

    binding.chProgressBar.apply { 
        setDotCount(5)
        setDotRadius(25f)
        setDotInterval(10f)
        setActiveColor(getColor(R.color.teal_700))
        setInactiveColor(getColor(R.color.teal_200))
        setAnimationDuration(500)
    }
}

If you want fadeout effect as View.GONE when your job done,

binding.chProgressBar.fadeOut()

or

//you can set fadeout duration
binding.chProgressBar.fadeOut(2000)


License

Copyright 2021 Joon Lee

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.