jinatonic / confetti

An Android particle system library for displaying confetti!
https://medium.com/@jinatonic/its-parfetti-time-f40634472608
Apache License 2.0
1.31k stars 151 forks source link

unable to show confetti on click of button #55

Open sonawanevip opened 4 years ago

sonawanevip commented 4 years ago

`int[] confettiColors = new int[]{R.color.red, R.color.blue, R.color.green, R.color.black, R.color.orange, R.color.darkergray};

ConfettiSource confettiSource = new ConfettiSource(linearLayout.getWidth(), linearLayout.getHeight());

CommonConfetti.rainingConfetti(linearLayout, confettiSource, confettiColors ).infinite();`

i have done this code ....is that sufficient for showing confetti?

jinatonic commented 4 years ago

it depends on when you do this, debug and check what's your linearLayout.getWidth(). my theory is that you are calling this before the linearlayout gets measured.