From e4b0a5a09c281daff60d8342444c21e0032d4668 Mon Sep 17 00:00:00 2001 From: YGRXZYGR <1513065229@qq.com> Date: Tue, 11 Jun 2024 21:25:12 +0800 Subject: [PATCH] tool --- build.gradle.kts | 1 + src/main/AndroidManifest.xml | 3 + .../hnucm/c202201020328/Date_dayActivity.java | 24 ++++ .../com/hnucm/c202201020328/ToolActivity.java | 11 ++ src/main/res/drawable/n.png | Bin 0 -> 340 bytes src/main/res/layout/activity_date_day.xml | 10 ++ src/main/res/layout/activity_tool.xml | 136 ++++++++++++++++++ 7 files changed, 185 insertions(+) create mode 100644 src/main/java/com/hnucm/c202201020328/Date_dayActivity.java create mode 100644 src/main/res/drawable/n.png create mode 100644 src/main/res/layout/activity_date_day.xml diff --git a/build.gradle.kts b/build.gradle.kts index d033318..cc6408b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,6 +34,7 @@ dependencies { implementation(libs.material) implementation(libs.activity) implementation(libs.constraintlayout) + implementation(libs.gridlayout) testImplementation(libs.junit) androidTestImplementation(libs.ext.junit) androidTestImplementation(libs.espresso.core) diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 67039c4..02a908d 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -12,6 +12,9 @@ android:supportsRtl="true" android:theme="@style/Theme.MyProject" tools:targetApi="31"> + diff --git a/src/main/java/com/hnucm/c202201020328/Date_dayActivity.java b/src/main/java/com/hnucm/c202201020328/Date_dayActivity.java new file mode 100644 index 0000000..6d936e5 --- /dev/null +++ b/src/main/java/com/hnucm/c202201020328/Date_dayActivity.java @@ -0,0 +1,24 @@ +package com.hnucm.c202201020328; + +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 Date_dayActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + EdgeToEdge.enable(this); + setContentView(R.layout.activity_date_day); + 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/src/main/java/com/hnucm/c202201020328/ToolActivity.java b/src/main/java/com/hnucm/c202201020328/ToolActivity.java index ab7e1f6..e021fe5 100644 --- a/src/main/java/com/hnucm/c202201020328/ToolActivity.java +++ b/src/main/java/com/hnucm/c202201020328/ToolActivity.java @@ -1,9 +1,12 @@ package com.hnucm.c202201020328; +import android.content.Intent; import android.os.Bundle; +import android.view.View; import androidx.activity.EdgeToEdge; import androidx.appcompat.app.AppCompatActivity; +import androidx.constraintlayout.widget.ConstraintLayout; import androidx.core.graphics.Insets; import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; @@ -17,5 +20,13 @@ public class ToolActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tool); ImmersionBar.with(this).init(); + ConstraintLayout constraintLayout=findViewById(R.id.main); + constraintLayout.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent=new Intent(ToolActivity.this, Date_dayActivity.class); + startActivity(intent); + } + }); } } \ No newline at end of file diff --git a/src/main/res/drawable/n.png b/src/main/res/drawable/n.png new file mode 100644 index 0000000000000000000000000000000000000000..50869ea404a5dbc06ef5b54847214261f5d316c3 GIT binary patch literal 340 zcmV-a0jvIrP)Px$4oO5oR5(v#WIzK~uU?(^_3KyPZ{NNN|Ni}(k(HJ8KNlC*TW)Ud&Dz@9Nyy3> zVVs*cZ-&2r|9&nzJ3F_OloW%2fB*v<8ymx~U%wbWeE7id?AbGhpFe+o6%-UqR##VF z3DO7F4AS`g`Saz<%F2u~GBW6nf%Bg{dBSk_?%n^Al9G`i1HhV3oH+4CT3VVLpGKGo zAOoI0efrhH!h(kp + + + \ No newline at end of file diff --git a/src/main/res/layout/activity_tool.xml b/src/main/res/layout/activity_tool.xml index 1d67144..6862124 100644 --- a/src/main/res/layout/activity_tool.xml +++ b/src/main/res/layout/activity_tool.xml @@ -29,6 +29,7 @@ app:layout_constraintTop_toBottomOf="@+id/textView14" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file