ParticleView in Android with Examples Last Updated : 13 Aug, 2024 Comments Improve Suggest changes Like Article Like Report ParticleView is an animation library and animations help to gain the attention of the user so it is best to learn it. It is the custom Android view that helps to display a large number of fairies. Why ParticleView?ParticleView provides a predefined layout type and animation.ParticleView can be used in Splash Screen.It is better to use ParticleView because of its UI because a good UI plays a very important role in an app.ApproachStep 1: Add the support library in the root build.gradle file (not in the module build.gradle file). allprojects { repositories { maven { url 'https://dl.bintray.com/wangyuwei/maven' } } } Step 2: Add the support library in build.gradle file and add dependency in the dependencies section. implementation 'me.wangyuwei:ParticleView:1.0.4' Step 3: Add the following code in activity_main.xml file. In this file add the ParticleView to the layout. activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:background="@color/grey" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:pv="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:gravity="center"> <me.wangyuwei.particleview.ParticleView android:id="@+id/particleView" android:layout_width="match_parent" android:layout_height="match_parent" pv:pv_host_text="GeeksForGeeks" pv:pv_host_text_size="32sp" pv:pv_particle_text=".com" pv:pv_particle_text_size="18sp" pv:pv_text_color="@color/colorPrimary" pv:pv_background_color="#FFF" pv:pv_text_anim_time="2000" pv:pv_spread_anim_time="300" pv:pv_host_text_anim_time="1000" /> </LinearLayout> Step 4: Add the following code in MainActivity.java file. In this file add ParticleAnimationListner() which will get invoked automatically when animation ends. MainActivity.java package org.geeksforgeeks.particleView; import android.os.Bundle; import android.widget.Toast; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import me.wangyuwei.particleview.ParticleView; public class MainActivity extends AppCompatActivity { ParticleView particleView; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); particleView = findViewById(R.id.particleView); particleView.startAnim(); // This listener will get invoked automatically when animation ends. particleView.setOnParticleAnimListener(new ParticleView.ParticleAnimListener() { @Override public void onAnimationEnd() { Toast.makeText(MainActivity.this, "Animation is End!!", Toast.LENGTH_SHORT).show(); } }); } } Output: Run on Emulator Comment More infoAdvertise with us Next Article ParticleView in Android with Examples madhavmaheshwarimm20 Follow Improve Article Tags : Java Android DSA Android-Animation Practice Tags : Java Similar Reads Android ListView in Java with Example A ListView in Android is a type of AdapterView that displays a vertically scrollable list of items, with each item positioned one below the other. Using an adapter, items are inserted into the list from an array or database efficiently. For displaying the items in the list method setAdaptor() is use 3 min read Spinner in Android with Example Android Spinner is a view similar to the dropdown list which is used to select one option from the list of options. It provides an easy way to select one item from the list of items and it shows a dropdown list of all values when we click on it. The default value of the android spinner will be the c 4 min read Jetpack LiveData in Android with Example Android Jetpack is a suite of libraries to help developers follow best practices, reduce boilerplate code, and write code that works consistently across Android versions and devices so that developers can focus on the code they care about. Here, we are going to implement Jetpack Live Data in Android 4 min read OpenIntents in Android with Example OI refers to the "OpenIntents" project in Android are a way for one app to request an action from another app. This can be done using either explicit or implicit intents, allowing them to share functionality. The OpenIntents project provides a set of commonly-used intents that can be used by develop 4 min read Kotlin Flow in Android with Example Kotlin Flow is a tool that helps developers work with data that changes over time like search results, live updates, or user input. Itâs part of Kotlinâs coroutines, which are used for writing code that doesnât block the app while waiting for something to finish, like a network call or a file to loa 8 min read Like