public class

FioriCamera

extends FrameLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.sap.cloud.mobile.fiori.camera.FioriCamera

Class Overview

FioriCamera is a View, which opens a Camera using Camera 2 apis and presents the preview of the Camera feed in the View Hierarchy. It allows the user to select the desired Camera, attach additional Surface for receiving the Camera feed for further processing, control the CaptureRequest and other facilities. You can add thee FioriCamera in View Group like any other typical Android view.

 <FioriCamera
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
 android:layout_height="match_parent">
 </FioriCamera>
 

Summary

Nested Classes
interface FioriCamera.Locker Locker that holds the image processing. 
interface FioriCamera.PreviewObserver  
XML Attributes
Attribute Name Related Method Description
FioriCamera_closeIcon  
FioriCamera_flashOffIcon  
FioriCamera_flashOnIcon  
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
FioriCamera(Context context)
FioriCamera(Context context, AttributeSet attrs)
FioriCamera(Context context, AttributeSet attrs, int defStyleAttr)
FioriCamera(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
void cropPreview(Rect crop, Rect original)
crop the ROI from preview to so that only the interested region would be feed to the detector
void hideCameraFrame()
Hide the CameraFrameView while using the FioriCamera.
void setCameraFrameCropController(CameraFrameCropController cropRectCreator)
void setOnTouchCancelCallback(View.OnClickListener listener)
Set View.OnClickListener on the cross button on FioriCamera.
synchronized void setPreviewListener(FioriCamera.PreviewObserver previewListener)
void showCameraFrame()
Make CameraFrameView visible while using the FioriCamera.
void start()
Open the Camera and start showing the preview of the live Camera feed.
void stop()
Close the camera and perform cleanup.
Protected Methods
void onAttachedToWindow()
void onDetachedFromWindow()
[Expand]
Inherited Methods
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

XML Attributes

FioriCamera_closeIcon

Related Methods

FioriCamera_flashOffIcon

Related Methods

FioriCamera_flashOnIcon

Related Methods

Public Constructors

public FioriCamera (Context context)

public FioriCamera (Context context, AttributeSet attrs)

public FioriCamera (Context context, AttributeSet attrs, int defStyleAttr)

public FioriCamera (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public Methods

public void cropPreview (Rect crop, Rect original)

crop the ROI from preview to so that only the interested region would be feed to the detector

Parameters
crop rect that describes the ROI
original rect that describes the full region

public void hideCameraFrame ()

Hide the CameraFrameView while using the FioriCamera. By default CameraFrameView is visible.

public void setCameraFrameCropController (CameraFrameCropController cropRectCreator)

Parameters
cropRectCreator CameraFrameCropController

public void setOnTouchCancelCallback (View.OnClickListener listener)

Set View.OnClickListener on the cross button on FioriCamera.

Parameters
listener View.OnClickListener

public synchronized void setPreviewListener (FioriCamera.PreviewObserver previewListener)

public void showCameraFrame ()

Make CameraFrameView visible while using the FioriCamera. By default CameraFrameView is visible.

public void start ()

Open the Camera and start showing the preview of the live Camera feed. This method will perform following activities in the order

It is important to close the camera and perform cleaning when activity is paused or stopped .

See Also

public void stop ()

Close the camera and perform cleanup. Stop the additional thread started while opening the Camera .

See Also

Protected Methods

protected void onAttachedToWindow ()

protected void onDetachedFromWindow ()