アクティビティ作成

This commit is contained in:
ろむねこ 2024-01-15 14:48:55 +09:00
parent e44313d418
commit b81f8d5c87
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168
5 changed files with 42 additions and 2 deletions

View File

@ -55,6 +55,7 @@ dependencies {
implementation libs.androidx.appcompat implementation libs.androidx.appcompat
implementation libs.com.google.android.material implementation libs.com.google.android.material
implementation libs.androidx.constraintlayout implementation libs.androidx.constraintlayout
implementation libs.androidx.activity
testImplementation libs.junit testImplementation libs.junit
androidTestImplementation libs.androidx.test.ext.junit androidTestImplementation libs.androidx.test.ext.junit
androidTestImplementation libs.androidx.test.espresso.core androidTestImplementation libs.androidx.test.espresso.core

View File

@ -5,6 +5,7 @@
<uses-feature <uses-feature
android:name="android.hardware.camera" android:name="android.hardware.camera"
android:required="false" /> android:required="false" />
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />
<queries> <queries>
@ -14,16 +15,19 @@
</queries> </queries>
<application <application
android:name=".LacertaApplication"
android:allowBackup="true" android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules" android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules" android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:name=".LacertaApplication"
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.Lacerta" android:theme="@style/Theme.Lacerta"
tools:targetApi="31"> tools:targetApi="31">
<activity
android:name=".ScannerOverrideActivity"
android:exported="false" />
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true"> android:exported="true">

View File

@ -0,0 +1,24 @@
package one.nem.lacerta;
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;
});
}
}

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ScannerOverrideActivity">
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -49,7 +49,8 @@ public class DebugMenuTopFragment extends Fragment {
List<DebugMenuListItem> debugMenuListItems = new ArrayList<>(); List<DebugMenuListItem> debugMenuListItems = new ArrayList<>();
debugMenuListItems.add(new DebugMenuListItem("Document Tester", "placeholder", R.id.action_debugMenuTopFragment_to_debugMenuDocumentTesterTopFragment, true)); debugMenuListItems.add(new DebugMenuListItem("Document Tester", "placeholder", R.id.action_debugMenuTopFragment_to_debugMenuDocumentTesterTopFragment, true));
debugMenuListItems.add(new DebugMenuListItem("Scanner", "placeholder", R.id.action_debugMenuTopFragment_to_scannerDataManagerStubFragment, true)); debugMenuListItems.add(new DebugMenuListItem("ScannerStub", "placeholder", R.id.action_debugMenuTopFragment_to_scannerDataManagerStubFragment, true));
debugMenuListItems.add(new DebugMenuListItem("Scanner", "placeholder", R.id.action_debugMenuTopFragment_to_scannerManagerFragment, true));
debugMenuListItems.add(new DebugMenuListItem("Document List", "placeholder", R.id.action_debugMenuTopFragment_to_debugMenuLibraryItemListPageFragment, true)); debugMenuListItems.add(new DebugMenuListItem("Document List", "placeholder", R.id.action_debugMenuTopFragment_to_debugMenuLibraryItemListPageFragment, true));
debugMenuListItems.add(new DebugMenuListItem("VCS", "placeholder", R.id.action_debugMenuTopFragment_to_debugMenuVcsGeneralFragment, true)); debugMenuListItems.add(new DebugMenuListItem("VCS", "placeholder", R.id.action_debugMenuTopFragment_to_debugMenuVcsGeneralFragment, true));