From 5b1461ff2614dc33db408b093c949ea546232341 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 14:50:09 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A2=E3=82=AF=E3=83=86=E3=82=A3=E3=83=93?= =?UTF-8?q?=E3=83=86=E3=82=A3=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/scanner/build.gradle | 2 ++ .../scanner/src/main/AndroidManifest.xml | 6 +++++ .../scanner/ScannerOverrideActivity.java | 24 +++++++++++++++++++ .../res/layout/activity_scanner_override.xml | 10 ++++++++ 4 files changed, 42 insertions(+) create mode 100644 component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerOverrideActivity.java create mode 100644 component/scanner/src/main/res/layout/activity_scanner_override.xml diff --git a/component/scanner/build.gradle b/component/scanner/build.gradle index 735535ff..defa4b6e 100644 --- a/component/scanner/build.gradle +++ b/component/scanner/build.gradle @@ -30,6 +30,8 @@ dependencies { implementation libs.androidx.appcompat implementation libs.com.google.android.material + implementation libs.androidx.activity + implementation libs.androidx.constraintlayout testImplementation libs.junit androidTestImplementation libs.androidx.test.ext.junit androidTestImplementation libs.androidx.test.espresso.core diff --git a/component/scanner/src/main/AndroidManifest.xml b/component/scanner/src/main/AndroidManifest.xml index a5918e68..2b9f05ea 100644 --- a/component/scanner/src/main/AndroidManifest.xml +++ b/component/scanner/src/main/AndroidManifest.xml @@ -1,4 +1,10 @@ + + + + \ No newline at end of file diff --git a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerOverrideActivity.java b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerOverrideActivity.java new file mode 100644 index 00000000..67b4959d --- /dev/null +++ b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerOverrideActivity.java @@ -0,0 +1,24 @@ +package one.nem.lacerta.component.scanner; + +import android.os.Bundle; + +import androidx.activity.EdgeToEdge; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; + +public class ScannerOverrideActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + EdgeToEdge.enable(this); + setContentView(R.layout.activity_scanner_override); + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + return insets; + }); + } +} \ No newline at end of file diff --git a/component/scanner/src/main/res/layout/activity_scanner_override.xml b/component/scanner/src/main/res/layout/activity_scanner_override.xml new file mode 100644 index 00000000..98d3e3db --- /dev/null +++ b/component/scanner/src/main/res/layout/activity_scanner_override.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file