SimpleMobileTools / Simple-Camera

Quick photo and video camera with a flash, customizable aspect ratio.
https://www.simplemobiletools.com
GNU General Public License v3.0
764 stars 284 forks source link

enable high resolution photos for android sdk 23 and higher #271

Closed jberggg closed 4 years ago

jberggg commented 4 years ago

To get all available photo resolution the camera supports, one needs to call getHighResolutionOutputSizes on Android SDK 23+ Operating Systems.

This fix relates to issue #190

tibbi commented 4 years ago

oh gosh, stick to the code style that is used in the whole app suite, this code looks really strange and hard to read

jberggg commented 4 years ago

I guess with

code looks really strange and hard to read

you refer to the Kotlin language features like let and Collection methods used.

IMHO those features help to make the code less variable-heavy and elegant to avoid null-pointer exceptions as one does not have to override null-check with !!. I used appropriate names for variables in collection methods and let statements instead of it. I placed the logic completely in the helper method to avoid spreading it all over the place. But I understand that this has also a lot to do with personal preference and it was not my goal to change the code style.

I will close the PR. Feel free to transfer some of the logic to your logic to make higher resolution work.