From 2f0460a9eaef0ceb4c34e7b787b95f6ecf90de72 Mon Sep 17 00:00:00 2001 From: r-ca Date: Mon, 8 Jan 2024 10:53:20 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=81=AB?= =?UTF-8?q?=E3=83=91=E3=82=B9=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scanner/ScannerDataManagerStubFragment.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java index 556d9d93..b8318d21 100644 --- a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java +++ b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java @@ -37,11 +37,14 @@ import javax.inject.Inject; import dagger.hilt.android.AndroidEntryPoint; import one.nem.lacerta.model.document.DocumentDetail; import one.nem.lacerta.model.document.DocumentMeta; +import one.nem.lacerta.model.document.path.DocumentPath; import one.nem.lacerta.processor.DocumentProcessor; import one.nem.lacerta.processor.factory.DocumentProcessorFactory; import one.nem.lacerta.utils.LacertaLogger; +import one.nem.lacerta.utils.repository.DeviceInfoUtils; + /** * A simple {@link Fragment} subclass. * Use the {@link ScannerDataManagerStubFragment#newInstance} factory method to @@ -67,6 +70,9 @@ public class ScannerDataManagerStubFragment extends Fragment { @Inject LacertaLogger logger; + @Inject + DeviceInfoUtils deviceInfoUtils; + private final ActivityResultLauncher cameraLauncher = registerForActivityResult( new ActivityResultContracts.StartActivityForResult(), result -> { @@ -178,7 +184,11 @@ public class ScannerDataManagerStubFragment extends Fragment { new Date(), new Date()); - return new DocumentDetail(meta, null, "SampleAuthor", "SampleDefaultBranch"); + DocumentPath path = new DocumentPath( + deviceInfoUtils.getExternalStorageDirectoryString(), + "Sample" + DateTimeFormatter.ofPattern("yyyyMMddHHmmss").format(LocalDateTime.now())); + + return new DocumentDetail(meta, path, "SampleAuthor", "SampleDefaultBranch"); } @Override