From 49e8a6e6bb7787519b65247c500ea7042fc8751d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= <66072112+r-ca@users.noreply.github.com> Date: Thu, 21 Dec 2023 12:34:46 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"=E5=8F=96=E5=BE=97=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E7=94=BB=E5=83=8F=E3=81=AE=E8=A7=A3=E5=83=8F=E5=BA=A6?= =?UTF-8?q?=E3=81=8C=E4=BD=8E=E3=81=99=E3=81=8E=E3=82=8B=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20WIP"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 55ae0b541a6b04f5001246153041f45af996809e. --- .../ScannerDataManagerStubFragment.java | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) 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 222ecb82..dd165939 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 @@ -10,7 +10,6 @@ import androidx.activity.result.contract.ActivityResultContracts; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.RecyclerView; -import android.os.Environment; import android.provider.MediaStore; import android.util.Log; import android.view.LayoutInflater; @@ -19,12 +18,7 @@ import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; import java.util.ArrayList; -import java.util.Date; -import java.util.Locale; /** * A simple {@link Fragment} subclass. @@ -79,22 +73,8 @@ public class ScannerDataManagerStubFragment extends Fragment { Log.d("ScannerDataManagerStubFragment", "button_call_camera clicked"); Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takePictureIntent.resolveActivity(getActivity().getPackageManager()) != null) { - File photoFile = null; - try { - String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(new Date()); - String imageFileName = "JPEG_" + timeStamp + "_"; - File storageDir = getActivity().getExternalFilesDir(Environment.DIRECTORY_PICTURES); - photoFile = File.createTempFile(imageFileName, ".jpg", storageDir); - } catch (IOException ex) { - Log.e("ScannerDataManagerStubFragment", "Error occurred while creating the file", ex); - } - if (photoFile != null) { - takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoFile); - cameraLauncher.launch(takePictureIntent); - } - else { - Log.d("ScannerDataManagerStubFragment", "photoFile is null"); - } + Log.d("ScannerDataManagerStubFragment", "camera available"); + cameraLauncher.launch(takePictureIntent); } else { Log.d("ScannerDataManagerStubFragment", "camera not available");