confetti
confetti copied to clipboard
unable to show confetti on click of button
`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?
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.