Skip to content

Library for drawing particles and draw particle progress bar in Android.

License

Notifications You must be signed in to change notification settings

kAvEh--/particle-view

Repository files navigation

particle animation

platform API

Android library for drawing particles and particle progress bar.

Usage

  1. Add it in your root build.gradle at the end of repositories:
allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}
  1. Add the dependency to app build.gradle
dependencies {
        implementation 'com.github.kAvEh--:particle-view:Tag'
}

Particle Fountain

  1. 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" />
  1. 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

Particle Progress Bar

  1. 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" />
  1. 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

Requirements

Android 4.4+ (API 19)

Developed By

License

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.