Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a single event for Flip detection #20

Closed
aritraroy opened this issue Feb 17, 2017 · 5 comments
Closed

Need a single event for Flip detection #20

aritraroy opened this issue Feb 17, 2017 · 5 comments

Comments

@aritraroy
Copy link

I just saw your library, actually liked it and thought to give it a try.

After attaching a flip detection listener in my activity, I see that the events are continuously getting fired. Like,

private FlipDetector.FlipListener mFlipListener = new FlipDetector.FlipListener() {
        @Override
        public void onFaceUp() {
            // Device Facing up
            Timber.d("DEVICE UP");
        }

        @Override
        public void onFaceDown() {
            // Device Facing down
            Timber.d("DEVICE DOWN");
        }
    };

in this code, I am getting continuous logs for "DEVICE UP" when the device is facing up and continuous logs for "FACE DOWN" when the device is facing down.

But my requirement is something different. If the device is facing up, it should just give one single onFaceUp() callback, and if the device is facing down it should just give one single onFaceDown() callback.

Is it possible with your library? If not, I will have to implement it myself. Just wanted to check if your library can do that or if you are willing to add it as an enhancement.

@nisrulz
Copy link
Owner

nisrulz commented Feb 17, 2017

it's not possible as per the current release, but I can push it out in the next release.

@aritraroy
Copy link
Author

Okay. Thanks. Any tentative date for the next release?

@nisrulz
Copy link
Owner

nisrulz commented Feb 17, 2017

I am planning to do it week by week basis i.e will try to push the next release this weekend.

If you think you can can fix it yourself and would like to submit a PR, go ahead with that.

@nisrulz
Copy link
Owner

nisrulz commented Feb 28, 2017

@aritraroy I have updated the code and the new release fixes this issue. Please confirm and close this issue if it works as expected.

@aritraroy
Copy link
Author

Thank you, I will give it a try as soon as possible and let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants