From f57fc925164be248b94e9ef7cd90447a05bbef2f Mon Sep 17 00:00:00 2001 From: Greg Herlihy Date: Mon, 30 Jan 2017 13:11:15 -0800 Subject: [PATCH] Adds two constructors to ParticleSystem that accept an array of bitmaps --- .../plattysoft/leonids/ParticleSystem.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/LeonidsLib/src/main/java/com/plattysoft/leonids/ParticleSystem.java b/LeonidsLib/src/main/java/com/plattysoft/leonids/ParticleSystem.java index 0e15b8d..c5b8f80 100644 --- a/LeonidsLib/src/main/java/com/plattysoft/leonids/ParticleSystem.java +++ b/LeonidsLib/src/main/java/com/plattysoft/leonids/ParticleSystem.java @@ -219,6 +219,37 @@ public ParticleSystem(Activity a, int maxParticles, Bitmap bitmap, long timeToLi } } + /** + * Utility constructor that receives an array of Bitmaps + * + * @param a The parent activity + * @param maxParticles The maximum number of particles + * @param bitmaps An array of bitmaps which will be randomly assigned to particles + * @param timeToLive The time to live for the particles + * @param parentViewId The view Id for the parent of the particle system + */ + public ParticleSystem(Activity a, int maxParticles, Bitmap[] bitmaps, long timeToLive, int parentViewId) { + this((ViewGroup) a.findViewById(parentViewId), maxParticles, timeToLive); + for (int i=0; i