Android library for drawing particles and particle progress bar.
- Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add the dependency to app build.gradle
dependencies {
implementation 'com.github.kAvEh--:particle-view:Tag'
}
- Insert
ParticleView
widget in your layout.
<com.kaveh.particle.ParticleView
android:id="@+id/particleView"
android:layout_width="match_parent"
android:layout_height="300dp"
app:layout_constraintBottom_toBottomOf="parent" />
- For customization:
particleView.setParticleOrigin(particleView.width / 5, particleView.height) // change origin point of particles
particleView.setVelocity(minX, maxX, minY, maxY) // change direction of particle. Random between min and max
particleView.setParticlesNum(835) // change number of active particle
particleView.setLifeTime(300, 800) // change life time of particle
particleView.particleColor = Color.parseColor("#a11d33") // change color of particles
- Insert
ParticleProgressBar
widget in your layout.
<com.kaveh.particle.ParticleProgressBar
android:id="@+id/particlePB"
android:layout_width="match_parent"
android:layout_height="100dp"
app:layout_constraintTop_toTopOf="parent" />
- For customization:
particlePB.setParticlesNum(35) // change number of active particle
particlePB.setVelocity(minX, maxX, minY, maxY) // change direction of particle. Random between min and max
particlePB.setLifeTime(300, 800) // change life time of particle
Android 4.4+ (API 19)
- Kaveh Fazaeli - [email protected]
Copyright 2020 kAvEh--
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.