question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Particles alignment problem

See original GitHub issue

When 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:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
durgesh2020commented, Nov 18, 2018

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:

I also experienced the same problem, can you write down your code?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DanielMartinus/Konfetti/issues/70#issuecomment-438410163, or mute the thread https://github.com/notifications/unsubscribe-auth/AIh_lbFm8ZBvqinSMEwe9UTbf5BEnakwks5uuyFQgaJpZM4YXWzi .

0reactions
DanielMartinuscommented, Nov 18, 2018

Great that it’s been solved, I’m closing this issue

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found