RedApparat / Fotoapparat

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

Java documentation could be easier #244

Closed JamesMcIntosh closed 6 years ago

JamesMcIntosh commented 6 years ago

The example on the Configuration-Java page would be a lot better if it included the class names which contain the constants / helper methods. i.e.

Fotoapparat fotoapperat = Fotoapparat
    .with(getContext())
    .into(cameraView)                             // view which will draw the camera preview
    .previewScaleType(ScaleType.CenterCrop)       // we want the preview to fill the view  
    .photoResolution(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();

Note: The original documentation had photoSize, I think it should be photoResolution

siralam commented 6 years ago

Extremely agree, I struggled for a long time on not being able to import the static functions like continuousFocus, autoFocus, fixed. continuousFocus and photoSize have been renamed but not updated in the documentation.

Diolor commented 6 years ago

Since several people had issues with that I updated the docs :)