引数で最大撮影枚数を指定できるように

This commit is contained in:
r-ca 2024-01-29 04:13:04 +09:00
parent 0a0a4b56b9
commit 3c75a04a5f
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -2,6 +2,7 @@ package one.nem.lacerta.component.scanner;
import android.Manifest;
import android.app.ProgressDialog;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@ -56,6 +57,9 @@ public class ScannerManagerActivity extends AppCompatActivity {
// Variables
private ArrayList<Bitmap> croppedImages = new ArrayList<>();
private int maxPage = 0;
private boolean singlePage = false;
View view;
DocumentScanner documentScanner = new DocumentScanner(
@ -82,7 +86,7 @@ public class ScannerManagerActivity extends AppCompatActivity {
},
null,
null,
null
singlePage ? 1 : maxPage
);
@Override
@ -113,6 +117,12 @@ public class ScannerManagerActivity extends AppCompatActivity {
this.view = findViewById(R.id.main); // TODO-rca:なんとかする
Intent intent = getIntent();
Bundle bundle = intent.getExtras();
if (bundle != null) {
this.maxPage = bundle.getInt("maxPage", 0);
this.singlePage = bundle.getBoolean("singlePage", false);
}
}
@Override