boxme / SquareCamera

Android Camera Library For Square Photo Taking
MIT License
569 stars 189 forks source link

Fix tiled button and crash on resume/back button pressed #11

Closed abdyer closed 9 years ago

abdyer commented 9 years ago

My primary reason for these changes is to fix the tiled shutter button on larger screens like the Nexus 6 as shown in the screen shot below. I tried several things with the capture button ImageView before determining that programmatically hiding the status bar was causing the problem. For my purposes, showing the status bar isn't an issue and was the easiest fix.

I also noticed that if I turned the screen off, when I returned, the camera preview was stopped. When I pressed the back button, the app crashed with an error about the camera being used after release() was called. To fix this, I simply finish CameraActivity in onPause(). I initially tried removing and re-adding CameraFragment, but this caused problems with the size of the preview window after resuming.

I won't be offended if you don't want to merge these changes, but thought someone might find them useful.

screenshot_2015-07-08-13-47-46

boxme commented 9 years ago

Thanks for the commits Andy!