RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.82k stars 406 forks source link

Add isStarted() to Fotoapparat #106

Closed ezaquarii closed 6 years ago

ezaquarii commented 6 years ago

Sometimes we want to check if camera is started.

The main use case is to support LiveData updates with new camera properties. Those updates can fire before camera is started and this case must be detected.

Diolor commented 6 years ago

Thanks for the PR @ezaquarii ! However by the time you call onStart we assure that the camera started. Therefore this should be handled in the client as it's the app's responsibility to know whether or not you called onStart.

ezaquarii commented 6 years ago

If you assure that the camera is started, the API won't change ever, so it would be no API maintenance cost.

You force users to duplicate the flag for no reason.

Diolor commented 6 years ago

Not all users need this flag, therefore we would like to keep the api minimal and clean. The API for v1 (and probably for a v2) will stay the same in terms of onStart assuring that the camera has started.

donlingliang commented 6 years ago

@ezaquarii i prefer to have this as well.

ezaquarii commented 6 years ago

I guess I need to create a new PR for it.