Closed kennylevinsen closed 7 years ago
There's some minor restructuring in there (camera setup grouped together, Camera.PreviewCallback
implementation moved to the PairScanner
), I killed a preview.requestLayout();
that seemed unnecessary, and I removed a line of code taken from an Android example that was there for pre-3.0 compatibility, which I'm pretty sure isn't supported anyway.
If that was in fact necessary, I'll re-add it. Likewise, if you dislike the refactoring, please don't hesitate to say so. There's nothing wrong with disagreeing on coding style, and it is your project. :)
As a side-note: Consider changing language level to Java 8. With the amount of Runnables in there, you're going to love lambda expressions.
Thanks Kenny! I'll test this out this weekend.
Move all setup/teardown work to a separate thread, using a threadpool with a single thread to synchronize start/stop operations. This frees up the UI thread, making the UI more fluid.
The result is that there is no UI glitching when the camera is enabled/disabled, and it is therefore managed instantly on visibility hints.