リスナー作成 いろいろ

This commit is contained in:
r-ca 2024-01-07 17:52:56 +09:00
parent 78c36df105
commit 07042f4e91
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -29,7 +29,10 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.Locale; import java.util.Locale;
import javax.inject.Inject;
import one.nem.lacerta.processor.DocumentProcessor; import one.nem.lacerta.processor.DocumentProcessor;
import one.nem.lacerta.processor.factory.DocumentProcessorFactory;
/** /**
* A simple {@link Fragment} subclass. * A simple {@link Fragment} subclass.
@ -45,6 +48,9 @@ public class ScannerDataManagerStubFragment extends Fragment {
private Uri photoURI; private Uri photoURI;
@Inject
DocumentProcessorFactory documentProcessorFactory;
private final ActivityResultLauncher<Intent> cameraLauncher = registerForActivityResult( private final ActivityResultLauncher<Intent> cameraLauncher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(), new ActivityResultContracts.StartActivityForResult(),
result -> { result -> {
@ -123,10 +129,17 @@ public class ScannerDataManagerStubFragment extends Fragment {
updateResults(); updateResults();
}); });
view.findViewById(R.id.button_create_documnent).setOnClickListener(v -> {
Log.d("ScannerDataManagerStubFragment", "button_create_documnent clicked");
Toast.makeText(getActivity(), "button_create_documnent clicked", Toast.LENGTH_LONG).show();
// TODO-rca: ここでDocumentを作成する
});
view.findViewById(R.id.button_init_document_processor).setOnClickListener(v -> { view.findViewById(R.id.button_init_document_processor).setOnClickListener(v -> {
Log.d("ScannerDataManagerStubFragment", "button_init_document_processor clicked"); Log.d("ScannerDataManagerStubFragment", "button_init_document_processor clicked");
Toast.makeText(getActivity(), "button_init_document_processor clicked", Toast.LENGTH_LONG).show(); Toast.makeText(getActivity(), "button_init_document_processor clicked", Toast.LENGTH_LONG).show();
// TODO-rca: ここでDocumentProcessorを初期化する // TODO-rca: ここでDocumentProcessorを初期化する
DocumentProcessor documentProcessor = documentProcessorFactory.create();
}); });
} }