From 334d1ccba24e62c5f8b1d3139eee8f636dcc1a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Mon, 15 Jan 2024 14:45:23 +0900 Subject: [PATCH] =?UTF-8?q?=E5=87=A6=E7=90=86=E5=AE=9F=E8=A3=85=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scanner/ScannerManagerFragment.java | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) 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 57b9f57d..e23e13b6 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 @@ -8,13 +8,46 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -/** - * A simple {@link Fragment} subclass. - * Use the {@link ScannerManagerFragment#newInstance} factory method to - * create an instance of this fragment. - */ +import com.websitebeaver.documentscanner.DocumentScanner; + +import javax.inject.Inject; + +import dagger.hilt.android.AndroidEntryPoint; +import one.nem.lacerta.utils.LacertaLogger; +import one.nem.lacerta.vcs.LacertaVcs; +import one.nem.lacerta.vcs.factory.LacertaVcsFactory; + + +@AndroidEntryPoint public class ScannerManagerFragment extends Fragment { + String TAG = getClass().getSimpleName(); + + @Inject + LacertaLogger logger; + + @Inject + LacertaVcsFactory vcsFactory; + + DocumentScanner documentScanner = new DocumentScanner( + getActivity(), + (croppedImage) -> { + // TODO-rca: 画像を保存する + return null; + }, + (error) -> { + // TODO-rca: エラー処理 + return null; + }, + () -> { + // TODO-rca: キャンセル処理 + return null; + }, + null, + null, + null + ); + private static final boolean DEFAULT_SINGLE_PAGE = false; private boolean singlePage; @@ -49,8 +82,11 @@ public class ScannerManagerFragment extends Fragment { public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - view.findViewById(R.id.button_start_scan).setOnClickListener(v -> { + // Init + logger.debug(TAG, "called"); + view.findViewById(R.id.button_start_scan).setOnClickListener(v -> { + documentScanner.startScan(); }); } } \ No newline at end of file