RedApparat / Fotoapparat

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

Java configuration has Kotlin parameters #275

Closed InDaPond closed 6 years ago

InDaPond commented 6 years ago

I tried using the FotoApparat Setup, and stumbled upon some problems.

In the java configuration Fotoapparat .with(context) .into(cameraView) // view which will draw the camera preview .previewScaleType(ScaleType.CENTER_CROP) // we want the preview to fill the view .photoSize(ResolutionSelectorsKt.highestResolution()) // we want to have the biggest photo possible .lensPosition(LensPositionSelectorsKt.back()) // we want back camera .focusMode(SelectorsKt.firstAvailable( // (optional) use the first focus mode which is supported by device FocusModeSelectorsKt. continuousFocusPicture(), FocusModeSelectorsKt.autoFocus(), // in case if continuous focus is not available on device, auto focus will be used FocusModeSelectorsKt.fixed() // if even auto focus is not available - fixed focus mode will be used )) .flash(SelectorsKt.firstAvailable( // (optional) similar to how it is done for focus mode, this time for flash FlashSelectorsKt.autoRedEye(), FlashSelectorsKt.autoFlash(), FlashSelectorsKt.torch() )) .frameProcessor(myFrameProcessor) // (optional) receives each frame from preview stream .logger(LoggersKt.loggers( // (optional) we want to log camera events in 2 places at once LoggersKt.logcat(), // ... in logcat LoggersKt.fileLogger(this) // ... and to file )) .build();

you are using Kotlin parameters.

.photoSize(ResolutionSelectorsKt.highestResolution())

should be .photoResolution(ResolutionSelectorsKt.highestResolution())

and so should .previewScaleType(ScaleType.CENTER_CROP)

be

.previewScaleType(ScaleType.CenterCrop)

Diolor commented 6 years ago

Fixed. Thank you