Skip to content

Commit 3333f97

Browse files
Updated with latest version of SDK
1 parent d2d811f commit 3333f97

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

java_sample/app/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ android {
3030

3131
dependencies {
3232

33-
implementation 'androidx.appcompat:appcompat:1.7.0-alpha03'
34-
implementation 'com.google.android.material:material:1.11.0-beta01'
35-
implementation 'androidx.constraintlayout:constraintlayout:2.2.0-alpha13'
33+
implementation 'androidx.appcompat:appcompat:1.7.1'
34+
implementation 'com.google.android.material:material:1.12.0'
35+
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
36+
3637
/*DEV_HELP : link the preferred SDK version from maven repo by extrieve.*/
37-
implementation 'com.extrieve.quickcapture:QCv3:3.1.14'
38+
implementation 'com.extrieve.quickcapture:QCv4_PLUS:4.2.7'
3839
}

java_sample/app/src/main/java/com/extrieve/quickcapture/docappjava/MainActivity.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.io.File;
2929
import java.io.IOException;
3030
import java.util.ArrayList;
31+
import java.util.Objects;
3132

3233
public class MainActivity extends AppCompatActivity {
3334

@@ -61,7 +62,7 @@ protected void onCreate(Bundle savedInstanceState) {
6162
/*DEV_HELP : assign registerForActivityResult for getting result from CameraHelper*/
6263
captureActivityResultLauncher = registerForActivityResult(
6364
new ActivityResultContracts.StartActivityForResult(),
64-
result -> handleCaptureActivityResult(result));
65+
this::handleCaptureActivityResult);
6566

6667
/*DEV_HELP : Capture Document with SDK Button click handler*/
6768
findViewById(R.id.getPictureButton).setOnClickListener(v -> {
@@ -102,11 +103,16 @@ private void SetConfig() {
102103

103104
ImageHelper.SetDPI(200);//int dpi_val = 100, 150, 200, 300, 500, 600;
104105

106+
Config.CaptureSupport.DocumentCropping = Config.CaptureSupport.CroppingType.AssistedCapture;
107+
108+
Config.CaptureSupport.CaptureMode = Config.CaptureSupport.CaptureModes.CAMERA_CAPTURE_REVIEW;
109+
110+
111+
Config.CaptureSupport.ColorMode = Config.CaptureSupport.ColorModes.RBG;
112+
105113
//can set output file path
106114
Config.CaptureSupport.OutputPath = BuildStoragePath();
107115

108-
Config.CaptureSupport.DocumentCropping = Config.CaptureSupport.CroppingType.AutoCrop;
109-
110116
Config.CaptureSupport.EnableFlash = true;
111117

112118
Config.CaptureSupport.CropFilter = Config.CaptureSupport.CropImageFilterType.ENHANCE;
@@ -116,8 +122,7 @@ private void SetConfig() {
116122
/*DEV_HELP : BuildStoragePath*/
117123
private String BuildStoragePath() {
118124
ContextWrapper c = new ContextWrapper(this);
119-
String path = c.getExternalFilesDir(".GoNoGoImages").getAbsolutePath();
120-
return path;
125+
return Objects.requireNonNull(c.getExternalFilesDir(".GoNoGoImages")).getAbsolutePath();
121126
}
122127

123128
/*DEV_HELP : handleCaptureActivityResult definition*/
@@ -130,10 +135,11 @@ private void handleCaptureActivityResult(ActivityResult result){
130135
Intent data = result.getData();
131136
Boolean Status = null;
132137
if (data != null) {
133-
Status = (Boolean) data.getExtras().get("STATUS");
138+
Status = (Boolean) Objects.requireNonNull(data.getExtras()).get("STATUS");
134139
}
140+
assert data != null;
135141
String Description = (String) data.getExtras().get("DESCRIPTION");
136-
if (!Status) {
142+
if (Boolean.FALSE.equals(Status)) {
137143
String imageCaptureLog = "Description : " + Description +
138144
".Exception: " + Config.CaptureSupport.LastLogInfo;
139145
Log.d("INFO", imageCaptureLog);

0 commit comments

Comments
 (0)