Skip to content

Commit 96e48cf

Browse files
Update README.md
1 parent 81a7a7a commit 96e48cf

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ var cameraHelper: CameraHelper? = CameraHelper()
8484
```
8585

8686
With an activity call, triggering SDK for capture activity can be done.Most operations in **CameraHelper** is **activity based**.
87+
SDK having multiple openration flow as follows :
88+
89+
* **CAMERA_CAPTURE_REVIEW** - *Default flow of the CameraHelper.Includes Capture with SDK Camera -> Review Image.*
90+
* **SYSTEM_CAMERA_CAPTURE_REVIEW** - *If user need to capture image with system default camera, this can be used.Includes Capture with system default camera -> Review*.
91+
* **IMAGE_ATTACH_REVIEW** - *If user need to review an image from device / gallery - this option can be used.After attach each image,review and all functionalities depends on review can be avail*.
92+
93+
**CAMERA_CAPTURE_REVIEW**
8794

8895
```java
8996
//JAVA
@@ -130,6 +137,63 @@ try {
130137
Toast.makeText(this, "Failed to open camera -" + ex.message, Toast.LENGTH_LONG).show()
131138
}
132139
```
140+
141+
**CAMERA_CAPTURE_REVIEW**
142+
143+
```java
144+
//JAVA
145+
//Set CaptureMode as CAMERA_CAPTURE_REVIEW
146+
Config.CaptureSupport.CaptureMode = Config.CaptureSupport.CaptureModes.CAMERA_CAPTURE_REVIEW;
147+
//set ppermission for output path that set in config.
148+
UriphotoURI = Uri.parse(Config.CaptureSupport.OutputPath);
149+
this.grantUriPermission(this.getPackageName(),photoURI,Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
150+
151+
//Create CameraIntent for CameraHelper activity call.
152+
Intent CameraIntent = new Intent(this,Class.forName("com.extrieve.quickcapture.sdk.CameraHelper"));
153+
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP) {
154+
CameraIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
155+
}
156+
//Call the Activity.
157+
startActivityForResult(CameraIntent,REQUEST_CODE_FILE_RETURN);
158+
159+
//On activity result, recieve the captured, reviewed, cropped, optimised & compressed image colletion as array.
160+
@Override
161+
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
162+
{
163+
super.onActivityResult(requestCode, resultCode, data);
164+
if (requestCode == REQUEST_CODE_FILE_RETURN && resultCode == Activity.RESULT_OK)
165+
{
166+
Boolean Status = (Boolean) data.getExtras().get("STATUS");
167+
String Description = (String) data.getExtras().get("DESCRIPTION");
168+
if(Status == false){ //Failed to capture
169+
finishActivity(REQUEST_CODE_FILE_RETURN); return;
170+
}
171+
FileCollection = (ArrayList<String>) data.getExtras().get("fileCollection");
172+
//FileCollection //: will contains all capture images path as string
173+
finishActivity(REQUEST_CODE_FILE_RETURN);
174+
}
175+
```
176+
```kotlin
177+
//Kotlin
178+
try {
179+
/*DEV_HELP :redirecting to camera*/
180+
val captureIntent = Intent(this, Class.forName("com.extrieve.quickcapture.sdk.CameraHelper"))
181+
val photoURI = Uri.parse(Config.CaptureSupport.OutputPath)
182+
grantUriPermission(
183+
this.packageName, photoURI,
184+
Intent.FLAG_GRANT_WRITE_URI_PERMISSION or Intent.FLAG_GRANT_READ_URI_PERMISSION
185+
)
186+
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP) {
187+
captureIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
188+
}
189+
captureActivityResultLauncher!!.launch(captureIntent)
190+
} catch (ex: Exception) {
191+
/*DEV_HELP : TODO : handle invalid Exception*/
192+
Toast.makeText(this, "Failed to open camera -" + ex.message, Toast.LENGTH_LONG).show()
193+
}
194+
```
195+
196+
133197
SDK included a supporting class with static configuration - which includes all configurations related to SDK.Confg contains a sub configuration collection **CaptureSupport** - contains all the Capture & review related configurations.
134198
Config.CaptureSupport : contains various configurations as follows:
135199

0 commit comments

Comments
 (0)