RedApparat / Fotoapparat

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

Make Fotoapparat lifecycleaware #399

Open robyka400 opened 4 years ago

robyka400 commented 4 years ago

I think it would make sense to make Fotoapparat lifecycle-aware. The following dependencies could be added: lifecycle-common-java8 lifecycle-extensions to gradle.

Then the Fotoapparat could receive an additional lifecycleOwner: Lifecycleowner constructor parameter and implement LifecycleEventObserver. This way the Fotoapparat could handle itself lifecycle changes, without the need to override onStart/onPause