サンプルにパスを追加

This commit is contained in:
r-ca 2024-01-08 10:53:20 +09:00
parent 2b4a24de7c
commit 2f0460a9ea
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -37,11 +37,14 @@ import javax.inject.Inject;
import dagger.hilt.android.AndroidEntryPoint; import dagger.hilt.android.AndroidEntryPoint;
import one.nem.lacerta.model.document.DocumentDetail; import one.nem.lacerta.model.document.DocumentDetail;
import one.nem.lacerta.model.document.DocumentMeta; 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.DocumentProcessor;
import one.nem.lacerta.processor.factory.DocumentProcessorFactory; import one.nem.lacerta.processor.factory.DocumentProcessorFactory;
import one.nem.lacerta.utils.LacertaLogger; import one.nem.lacerta.utils.LacertaLogger;
import one.nem.lacerta.utils.repository.DeviceInfoUtils;
/** /**
* A simple {@link Fragment} subclass. * A simple {@link Fragment} subclass.
* Use the {@link ScannerDataManagerStubFragment#newInstance} factory method to * Use the {@link ScannerDataManagerStubFragment#newInstance} factory method to
@ -67,6 +70,9 @@ public class ScannerDataManagerStubFragment extends Fragment {
@Inject @Inject
LacertaLogger logger; LacertaLogger logger;
@Inject
DeviceInfoUtils deviceInfoUtils;
private final ActivityResultLauncher<Intent> cameraLauncher = registerForActivityResult( private final ActivityResultLauncher<Intent> cameraLauncher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(), new ActivityResultContracts.StartActivityForResult(),
result -> { result -> {
@ -178,7 +184,11 @@ public class ScannerDataManagerStubFragment extends Fragment {
new Date(), new Date(),
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 @Override