From b99efb333651c3dbcc603ae6da6fa0f83f52ba62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Mon, 15 Jan 2024 15:03:24 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=84=E3=82=8D=E3=81=84=E3=82=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scanner/ScannerManagerFragment.java | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerFragment.java b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerFragment.java index e23e13b6..f50332ca 100644 --- a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerFragment.java +++ b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerFragment.java @@ -10,6 +10,8 @@ import android.view.ViewGroup; import com.websitebeaver.documentscanner.DocumentScanner; +import java.util.Objects; + import javax.inject.Inject; import dagger.hilt.android.AndroidEntryPoint; @@ -30,7 +32,7 @@ public class ScannerManagerFragment extends Fragment { LacertaVcsFactory vcsFactory; DocumentScanner documentScanner = new DocumentScanner( - getActivity(), + requireActivity(), (croppedImage) -> { // TODO-rca: 画像を保存する return null; @@ -55,10 +57,18 @@ public class ScannerManagerFragment extends Fragment { // Required empty public constructor } - public static ScannerManagerFragment newInstance(boolean singlePage) { +// public static ScannerManagerFragment newInstance(boolean singlePage) { +// ScannerManagerFragment fragment = new ScannerManagerFragment(); +// Bundle args = new Bundle(); +// args.putBoolean("singlePage", singlePage); +// fragment.setArguments(args); +// return fragment; +// } + + public static ScannerManagerFragment newInstance() { ScannerManagerFragment fragment = new ScannerManagerFragment(); Bundle args = new Bundle(); - args.putBoolean("singlePage", singlePage); + args.putBoolean("singlePage", DEFAULT_SINGLE_PAGE); fragment.setArguments(args); return fragment; } @@ -75,7 +85,15 @@ public class ScannerManagerFragment extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_scanner_manager, container, false); + View view = inflater.inflate(R.layout.fragment_scanner_manager, container, false); + + ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT + ); + view.setLayoutParams(layoutParams); + + return view; } @Override