Particles alignment problem
See original GitHub issueWhen I call below code directly in onCreate method of my activity, I get particles coming down from left of the screen. But, If I put the same code in onClick event, I see that particles come down from the center.
oncreate() {
konfettiView.build()
.addColors(Color.rgb(255, 36, 0), Color.rgb(120, 116, 242), Color.rgb(255, 232, 103))
//.addColors(Color.rgb(168,100,253), Color.rgb(255,113,141), Color.rgb(120,255,68))
.setDirection(0.0, 359.0)
.setSpeed(1f, 5f)
.setFadeOutEnabled(true)
.setTimeToLive(2000L)
.addShapes(Shape.RECT, Shape.CIRCLE)
.addSizes(new Size(12, 5f))
.setPosition(-50f, konfettiView.getWidth() + 50f, -50f, -50f)
.streamFor(300, 5000L);
}
konfettiView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View view) {
konfettiView.build()
.addColors(Color.rgb(255, 36, 0), Color.rgb(120, 116, 242), Color.rgb(255, 232, 103))
//.addColors(Color.rgb(168,100,253), Color.rgb(255,113,141), Color.rgb(120,255,68))
.setDirection(0.0, 359.0)
.setSpeed(1f, 5f)
.setFadeOutEnabled(true)
.setTimeToLive(2000L)
.addShapes(Shape.RECT, Shape.CIRCLE)
.addSizes(new Size(12, 5f))
.setPosition(-50f, konfettiView.getWidth() + 50f, -50f, -50f)
.streamFor(300, 5000L);
}
});
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Particle alignment reliability in single particle electron ... - Nature
In this work, we present a conceptually simple alignment test, which does not require tilt-pair images, to evaluate the alignment consistency ...
Read more >Alignment error envelopes for single particle analysis - PubMed
The problem of incoherent image averaging is developed in detail through derivation of five envelope functions that account for small errors in 11...
Read more >Fragmented protein sequence alignment using two-layer ...
This paper presents a Fragmented protein sequence alignment using two-layer PSO (FTLPSO) method to overcome the drawbacks of particle swarm optimization ...
Read more >Anisotropic particles align perpendicular to the flow direction ...
It is commonly assumed that anisotropic particles align parallel to the flow direction. When flowing through narrowed channel sections, one expects the ...
Read more >Dynamic alignment in particle accelerators
The problem of dynamic alignment in particle accelerators is introduced. Align- ment levels achieved in existing machines are reviewed and compared with typical ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
final KonfettiView konfettiView = findViewById(R.id.viewKonfetti); DisplayMetrics display = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(display); konfettiView.build() .addColors(Color.rgb(255, 36, 0), Color.rgb(120, 116, 242), Color.rgb(255, 232, 103)) //.addColors(Color.rgb(168,100,253), Color.rgb(255,113,141), Color.rgb(120,255,68)) .setDirection(0.0, 359.0) .setSpeed(1f, 5f) .setFadeOutEnabled(true) .setTimeToLive(2000L) .addShapes(Shape.RECT, Shape.CIRCLE) .addSizes(new Size(12, 5f)) .setPosition(-50f, display.widthPixels + 50f, -50f, -50f) .streamFor(300, 5000L);
On Wed, Nov 14, 2018 at 1:15 AM dionassydqi notifications@github.com wrote:
Great that it’s been solved, I’m closing this issue