Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Camera capture timer #52

Open
hendraanggrian opened this issue Nov 25, 2016 · 1 comment
Open

Camera capture timer #52

hendraanggrian opened this issue Nov 25, 2016 · 1 comment

Comments

@hendraanggrian
Copy link

hendraanggrian commented Nov 25, 2016

Please add timer functionality. Currently, I'm going with:

private int timer;

public void capture(int seconds, final OnCapturingListener listener) {
    this.timer = seconds;

    final Handler handler = new Handler();
    handler.post(new Runnable() {
        @Override
        public void run() {
            if (timer > 0) {
                timer--;
                listener.onTicking(timer);
                handler.postDelayed(this, 1000);
            } else {
                listener.onCapturing();
                takePicture();
            }
        }
    });
}

public interface OnCapturingListener {

    void onTicking(int remainingSeconds);

    void onCapturing();
}
@yaraki
Copy link
Contributor

yaraki commented Dec 7, 2016

I'm not sure if this should be a feature of this library. The requirement will vary from app to app, and the implementation is not too tough.

I'll keep this open for a while for input from more people.

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

No branches or pull requests

2 participants