サンプルを生成するメソッド作成

This commit is contained in:
r-ca 2024-01-07 18:03:33 +09:00
parent 1653da9c94
commit b159db97bb
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -39,6 +39,8 @@ import one.nem.lacerta.model.document.DocumentMeta;
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;
/** /**
* 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
@ -56,6 +58,9 @@ public class ScannerDataManagerStubFragment extends Fragment {
@Inject @Inject
DocumentProcessorFactory documentProcessorFactory; DocumentProcessorFactory documentProcessorFactory;
@Inject
LacertaLogger logger;
private final ActivityResultLauncher<Intent> cameraLauncher = registerForActivityResult( private final ActivityResultLauncher<Intent> cameraLauncher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(), new ActivityResultContracts.StartActivityForResult(),
result -> { result -> {
@ -154,10 +159,15 @@ public class ScannerDataManagerStubFragment extends Fragment {
String id = UUID.randomUUID().toString(); String id = UUID.randomUUID().toString();
Toast.makeText(getActivity(), "Generated id: " + id, Toast.LENGTH_LONG).show(); Toast.makeText(getActivity(), "Generated id: " + id, Toast.LENGTH_LONG).show();
logger.debug("CreateSample", "Generated id: " + id);
DocumentMeta meta = new DocumentMeta( DocumentMeta meta = new DocumentMeta(
id, id,
"Sample" + DateTimeFormatter.ofPattern("yyyyMMddHHmmss").format(LocalDateTime.now()), "Sample" + DateTimeFormatter.ofPattern("yyyyMMddHHmmss").format(LocalDateTime.now()),
new Date(),
new Date());
return new DocumentDetail(meta, null, "SampleAuthor", "SampleDefaultBranch");
} }
@Override @Override