diff --git a/component/scanner/build.gradle b/component/scanner/build.gradle
index 735535ff..defa4b6e 100644
--- a/component/scanner/build.gradle
+++ b/component/scanner/build.gradle
@@ -30,6 +30,8 @@ dependencies {
implementation libs.androidx.appcompat
implementation libs.com.google.android.material
+ implementation libs.androidx.activity
+ implementation libs.androidx.constraintlayout
testImplementation libs.junit
androidTestImplementation libs.androidx.test.ext.junit
androidTestImplementation libs.androidx.test.espresso.core
diff --git a/component/scanner/src/main/AndroidManifest.xml b/component/scanner/src/main/AndroidManifest.xml
index a5918e68..74cc7c29 100644
--- a/component/scanner/src/main/AndroidManifest.xml
+++ b/component/scanner/src/main/AndroidManifest.xml
@@ -1,4 +1,10 @@
+
+
+
+
\ No newline at end of file
diff --git a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java
new file mode 100644
index 00000000..f5109892
--- /dev/null
+++ b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java
@@ -0,0 +1,24 @@
+package one.nem.lacerta.component.scanner;
+
+import android.os.Bundle;
+
+import androidx.activity.EdgeToEdge;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.graphics.Insets;
+import androidx.core.view.ViewCompat;
+import androidx.core.view.WindowInsetsCompat;
+
+public class ScannerManagerActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ EdgeToEdge.enable(this);
+ setContentView(R.layout.activity_scanner_manager);
+ ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
+ Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
+ v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
+ return insets;
+ });
+ }
+}
\ No newline at end of file
diff --git a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerFragment.java b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerFragment.java
index f50332ca..7203e691 100644
--- a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerFragment.java
+++ b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerFragment.java
@@ -31,24 +31,7 @@ public class ScannerManagerFragment extends Fragment {
@Inject
LacertaVcsFactory vcsFactory;
- DocumentScanner documentScanner = new DocumentScanner(
- requireActivity(),
- (croppedImage) -> {
- // TODO-rca: 画像を保存する
- return null;
- },
- (error) -> {
- // TODO-rca: エラー処理
- return null;
- },
- () -> {
- // TODO-rca: キャンセル処理
- return null;
- },
- null,
- null,
- null
- );
+ DocumentScanner documentScanner;
private static final boolean DEFAULT_SINGLE_PAGE = false;
private boolean singlePage;
@@ -79,6 +62,25 @@ public class ScannerManagerFragment extends Fragment {
if (getArguments() != null) {
singlePage = getArguments().getBoolean("singlePage", DEFAULT_SINGLE_PAGE);
}
+
+ documentScanner = new DocumentScanner(
+ requireActivity(),
+ (croppedImage) -> {
+ // TODO-rca: 画像を保存する
+ return null;
+ },
+ (error) -> {
+ // TODO-rca: エラー処理
+ return null;
+ },
+ () -> {
+ // TODO-rca: キャンセル処理
+ return null;
+ },
+ null,
+ null,
+ null
+ );
}
@Override
@@ -87,11 +89,11 @@ public class ScannerManagerFragment extends Fragment {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_scanner_manager, container, false);
- ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT
- );
- view.setLayoutParams(layoutParams);
+// ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(
+// ViewGroup.LayoutParams.MATCH_PARENT,
+// ViewGroup.LayoutParams.MATCH_PARENT
+// );
+// view.setLayoutParams(layoutParams);
return view;
}
@@ -104,7 +106,9 @@ public class ScannerManagerFragment extends Fragment {
logger.debug(TAG, "called");
view.findViewById(R.id.button_start_scan).setOnClickListener(v -> {
- documentScanner.startScan();
+ if (documentScanner != null) {
+ documentScanner.startScan();
+ }
});
}
}
\ No newline at end of file
diff --git a/component/scanner/src/main/res/layout/activity_scanner_manager.xml b/component/scanner/src/main/res/layout/activity_scanner_manager.xml
new file mode 100644
index 00000000..1b0b261a
--- /dev/null
+++ b/component/scanner/src/main/res/layout/activity_scanner_manager.xml
@@ -0,0 +1,10 @@
+
+
+
+
\ No newline at end of file