From 78dd15a3ae461082c1ed38a09f1a9a7071d56fa0 Mon Sep 17 00:00:00 2001 From: ibrahimsn98 Date: Sun, 16 Dec 2018 15:53:29 +0000 Subject: [PATCH] add particle color attr --- particle/src/main/java/me/ibrahimsn/particle/ParticleView.kt | 4 +++- particle/src/main/res/values/attrs.xml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/particle/src/main/java/me/ibrahimsn/particle/ParticleView.kt b/particle/src/main/java/me/ibrahimsn/particle/ParticleView.kt index 928cfd2..ca1fc46 100644 --- a/particle/src/main/java/me/ibrahimsn/particle/ParticleView.kt +++ b/particle/src/main/java/me/ibrahimsn/particle/ParticleView.kt @@ -16,13 +16,14 @@ class ParticleView : View { private var count = 20 private var background = Color.RED + private var color = Color.WHITE private var minRadius = 5 private var maxRadius = 10 private val paint: Paint = Paint().apply { isAntiAlias = true style = Paint.Style.FILL_AND_STROKE - color = Color.WHITE + color = this.color strokeWidth = 2F } @@ -34,6 +35,7 @@ class ParticleView : View { minRadius = a.getInt(R.styleable.ParticleView_minParticleRadius, minRadius) maxRadius = a.getInt(R.styleable.ParticleView_maxParticleRadius, maxRadius) background = a.getColor(R.styleable.ParticleView_backgroundColor, background) + color = a.getColor(R.styleable.ParticleView_particleColor, color) if (count > 50) count = 50 diff --git a/particle/src/main/res/values/attrs.xml b/particle/src/main/res/values/attrs.xml index c53a45a..7f34389 100644 --- a/particle/src/main/res/values/attrs.xml +++ b/particle/src/main/res/values/attrs.xml @@ -2,6 +2,7 @@ +