commit 54ef05c7d37c237c5072536660ff77fbd181e5ec
Author: lucashu <6125220@qq.com>
Date: Thu May 16 09:09:11 2024 +0800
code
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..aa724b7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,15 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
+local.properties
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..b3405b3
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+My Application
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..b589d56
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
new file mode 100644
index 0000000..9f9c66e
--- /dev/null
+++ b/.idea/deploymentTargetDropDown.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..349aa07
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/migrations.xml b/.idea/migrations.xml
new file mode 100644
index 0000000..f8051a6
--- /dev/null
+++ b/.idea/migrations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..8978d23
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..d8e62be
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/activity/.gitignore b/activity/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/activity/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/activity/build.gradle.kts b/activity/build.gradle.kts
new file mode 100644
index 0000000..32d8345
--- /dev/null
+++ b/activity/build.gradle.kts
@@ -0,0 +1,39 @@
+plugins {
+ id("com.android.application")
+}
+
+android {
+ namespace = "com.hnucm.activity"
+ compileSdk = 34
+
+ defaultConfig {
+ applicationId = "com.hnucm.activity"
+ minSdk = 24
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation("androidx.appcompat:appcompat:1.6.1")
+ implementation("com.google.android.material:material:1.9.0")
+ implementation("androidx.constraintlayout:constraintlayout:2.1.4")
+ testImplementation("junit:junit:4.13.2")
+ androidTestImplementation("androidx.test.ext:junit:1.1.5")
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
+}
\ No newline at end of file
diff --git a/activity/proguard-rules.pro b/activity/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/activity/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/activity/src/androidTest/java/com/hnucm/activity/ExampleInstrumentedTest.java b/activity/src/androidTest/java/com/hnucm/activity/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..b07de85
--- /dev/null
+++ b/activity/src/androidTest/java/com/hnucm/activity/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.hnucm.activity;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.hnucm.activity", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/activity/src/main/AndroidManifest.xml b/activity/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..c19414e
--- /dev/null
+++ b/activity/src/main/AndroidManifest.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/activity/src/main/java/com/hnucm/activity/LoginActivity.java b/activity/src/main/java/com/hnucm/activity/LoginActivity.java
new file mode 100644
index 0000000..c25e8cc
--- /dev/null
+++ b/activity/src/main/java/com/hnucm/activity/LoginActivity.java
@@ -0,0 +1,31 @@
+package com.hnucm.activity;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.TextView;
+
+public class LoginActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_login);
+ String name = getIntent().getStringExtra("name");
+ TextView textView = findViewById(R.id.textView);
+ textView.setText(name);
+ Button button = findViewById(R.id.button2);
+ button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ //TODO 跳转到下一个Activity
+ finish();
+ Intent intent = new Intent(LoginActivity.this, MainActivity.class);
+ startActivity(intent);
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/activity/src/main/java/com/hnucm/activity/MainActivity.java b/activity/src/main/java/com/hnucm/activity/MainActivity.java
new file mode 100644
index 0000000..68e0994
--- /dev/null
+++ b/activity/src/main/java/com/hnucm/activity/MainActivity.java
@@ -0,0 +1,27 @@
+package com.hnucm.activity;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+
+public class MainActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ Button button = findViewById(R.id.button);
+ button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ //TODO 跳转到下一个Activity + 带值
+ Intent intent = new Intent(MainActivity.this, LoginActivity.class);
+ intent.putExtra("name","张三");
+ startActivity(intent);
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/activity/src/main/res/drawable/ic_launcher_background.xml b/activity/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/activity/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/activity/src/main/res/drawable/ic_launcher_foreground.xml b/activity/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/activity/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/activity/src/main/res/layout/activity_login.xml b/activity/src/main/res/layout/activity_login.xml
new file mode 100644
index 0000000..048798c
--- /dev/null
+++ b/activity/src/main/res/layout/activity_login.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/activity/src/main/res/layout/activity_main.xml b/activity/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..e5dddf0
--- /dev/null
+++ b/activity/src/main/res/layout/activity_main.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/activity/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/activity/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/activity/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/activity/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/activity/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/activity/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/activity/src/main/res/mipmap-hdpi/ic_launcher.webp b/activity/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/activity/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/activity/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/activity/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/activity/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/activity/src/main/res/mipmap-mdpi/ic_launcher.webp b/activity/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/activity/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/activity/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/activity/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/activity/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/activity/src/main/res/mipmap-xhdpi/ic_launcher.webp b/activity/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/activity/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/activity/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/activity/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/activity/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/activity/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/activity/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/activity/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/activity/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/activity/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/activity/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/activity/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/activity/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/activity/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/activity/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/activity/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/activity/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/activity/src/main/res/values-night/themes.xml b/activity/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..d25b0f2
--- /dev/null
+++ b/activity/src/main/res/values-night/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/activity/src/main/res/values/colors.xml b/activity/src/main/res/values/colors.xml
new file mode 100644
index 0000000..c8524cd
--- /dev/null
+++ b/activity/src/main/res/values/colors.xml
@@ -0,0 +1,5 @@
+
+
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/activity/src/main/res/values/strings.xml b/activity/src/main/res/values/strings.xml
new file mode 100644
index 0000000..4db9e7a
--- /dev/null
+++ b/activity/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ activity
+
\ No newline at end of file
diff --git a/activity/src/main/res/values/themes.xml b/activity/src/main/res/values/themes.xml
new file mode 100644
index 0000000..d66ac09
--- /dev/null
+++ b/activity/src/main/res/values/themes.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/activity/src/test/java/com/hnucm/activity/ExampleUnitTest.java b/activity/src/test/java/com/hnucm/activity/ExampleUnitTest.java
new file mode 100644
index 0000000..9f0bd4c
--- /dev/null
+++ b/activity/src/test/java/com/hnucm/activity/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.hnucm.activity;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
new file mode 100644
index 0000000..1684d51
--- /dev/null
+++ b/app/build.gradle.kts
@@ -0,0 +1,39 @@
+plugins {
+ id("com.android.application")
+}
+
+android {
+ namespace = "com.example.myapplication"
+ compileSdk = 34
+
+ defaultConfig {
+ applicationId = "com.example.myapplication"
+ minSdk = 24
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation("androidx.appcompat:appcompat:1.6.1")
+ implementation("com.google.android.material:material:1.9.0")
+ implementation("androidx.constraintlayout:constraintlayout:2.1.4")
+ testImplementation("junit:junit:4.13.2")
+ androidTestImplementation("androidx.test.ext:junit:1.1.5")
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
+}
\ No newline at end of file
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..982ba51
--- /dev/null
+++ b/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.myapplication;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.example.myapplication", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..eb47d4a
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/example/myapplication/MainActivity.java b/app/src/main/java/com/example/myapplication/MainActivity.java
new file mode 100644
index 0000000..7b973c0
--- /dev/null
+++ b/app/src/main/java/com/example/myapplication/MainActivity.java
@@ -0,0 +1,48 @@
+package com.example.myapplication;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+public class MainActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ TextView textView = findViewById(R.id.text);
+ textView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ System.out.println("文本点击");
+ }
+ });
+ Button button =findViewById(R.id.button);
+ button.setText("注册");
+
+ EditText editText = findViewById(R.id.username);
+// 点击按钮事件
+ button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ String username = editText.getText().toString();
+// System.out.println("点击:" + username);
+// 打印日志
+ Log.i("msg","点击:" + username);
+ Toast.makeText(MainActivity.this,"点击:" + username, Toast.LENGTH_LONG).show();
+ textView.setText("注册成功");
+ }
+ });
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/myapplication/Test.java b/app/src/main/java/com/example/myapplication/Test.java
new file mode 100644
index 0000000..94eee9a
--- /dev/null
+++ b/app/src/main/java/com/example/myapplication/Test.java
@@ -0,0 +1,4 @@
+package com.example.myapplication;
+
+public class Test {
+}
diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/app/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/test123.png b/app/src/main/res/drawable/test123.png
new file mode 100644
index 0000000..839a461
Binary files /dev/null and b/app/src/main/res/drawable/test123.png differ
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..3dbc44d
--- /dev/null
+++ b/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..d25b0f2
--- /dev/null
+++ b/app/src/main/res/values-night/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..c8524cd
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,5 @@
+
+
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..3de1a39
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ My Application
+
\ No newline at end of file
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
new file mode 100644
index 0000000..d66ac09
--- /dev/null
+++ b/app/src/main/res/values/themes.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/backup_rules.xml b/app/src/main/res/xml/backup_rules.xml
new file mode 100644
index 0000000..fa0f996
--- /dev/null
+++ b/app/src/main/res/xml/backup_rules.xml
@@ -0,0 +1,13 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/data_extraction_rules.xml b/app/src/main/res/xml/data_extraction_rules.xml
new file mode 100644
index 0000000..9ee9997
--- /dev/null
+++ b/app/src/main/res/xml/data_extraction_rules.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/test/java/com/example/myapplication/ExampleUnitTest.java b/app/src/test/java/com/example/myapplication/ExampleUnitTest.java
new file mode 100644
index 0000000..bf43ee5
--- /dev/null
+++ b/app/src/test/java/com/example/myapplication/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.myapplication;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/banner/.gitignore b/banner/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/banner/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/banner/build.gradle.kts b/banner/build.gradle.kts
new file mode 100644
index 0000000..b2edd67
--- /dev/null
+++ b/banner/build.gradle.kts
@@ -0,0 +1,42 @@
+plugins {
+ id("com.android.application")
+}
+
+android {
+ namespace = "com.hnucm.banner"
+ compileSdk = 34
+
+ defaultConfig {
+ applicationId = "com.hnucm.banner"
+ minSdk = 24
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation("androidx.appcompat:appcompat:1.6.1")
+ implementation("com.google.android.material:material:1.9.0")
+ implementation("androidx.constraintlayout:constraintlayout:2.1.4")
+ testImplementation("junit:junit:4.13.2")
+ androidTestImplementation("androidx.test.ext:junit:1.1.5")
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
+
+ implementation ("io.github.youth5201314:banner:2.2.3")
+ implementation ("com.github.bumptech.glide:glide:4.15.1")
+}
\ No newline at end of file
diff --git a/banner/proguard-rules.pro b/banner/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/banner/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/banner/src/androidTest/java/com/hnucm/banner/ExampleInstrumentedTest.java b/banner/src/androidTest/java/com/hnucm/banner/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..457550a
--- /dev/null
+++ b/banner/src/androidTest/java/com/hnucm/banner/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.hnucm.banner;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.hnucm.banner", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/banner/src/main/AndroidManifest.xml b/banner/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..43f3ce2
--- /dev/null
+++ b/banner/src/main/AndroidManifest.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/banner/src/main/java/com/hnucm/banner/MainActivity.java b/banner/src/main/java/com/hnucm/banner/MainActivity.java
new file mode 100644
index 0000000..8f3eaf0
--- /dev/null
+++ b/banner/src/main/java/com/hnucm/banner/MainActivity.java
@@ -0,0 +1,42 @@
+package com.hnucm.banner;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+
+import com.bumptech.glide.Glide;
+import com.youth.banner.Banner;
+import com.youth.banner.adapter.BannerImageAdapter;
+import com.youth.banner.holder.BannerImageHolder;
+import com.youth.banner.indicator.CircleIndicator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class MainActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ //alt+enter快捷键
+ List list = new ArrayList<>();
+ list.add("https://alifei05.cfp.cn/creative/vcg/800/new/VCG41175510742.jpg");
+ list.add("https://tenfei04.cfp.cn/creative/vcg/800/new/VCG211477155436.jpg");
+ list.add("https://alifei03.cfp.cn/creative/vcg/800/new/VCG211477049382.jpg");
+ Banner banner = findViewById(R.id.banner);
+// 泛型
+ banner.setAdapter(new BannerImageAdapter(list) {
+ @Override
+ public void onBindView(BannerImageHolder holder, String data, int position, int size) {
+ //打开网络权限
+ Glide.with(holder.itemView)
+ .load(data)
+ .into(holder.imageView);
+ }
+ });
+ banner.setIndicator(new CircleIndicator(this));
+ banner.setIndicatorRadius(100);
+ }
+}
\ No newline at end of file
diff --git a/banner/src/main/res/drawable/ic_launcher_background.xml b/banner/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/banner/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/banner/src/main/res/drawable/ic_launcher_foreground.xml b/banner/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/banner/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/banner/src/main/res/layout/activity_main.xml b/banner/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..011a716
--- /dev/null
+++ b/banner/src/main/res/layout/activity_main.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/banner/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/banner/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/banner/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/banner/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/banner/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/banner/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/banner/src/main/res/mipmap-hdpi/ic_launcher.webp b/banner/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/banner/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/banner/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/banner/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/banner/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/banner/src/main/res/mipmap-mdpi/ic_launcher.webp b/banner/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/banner/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/banner/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/banner/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/banner/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/banner/src/main/res/mipmap-xhdpi/ic_launcher.webp b/banner/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/banner/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/banner/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/banner/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/banner/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/banner/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/banner/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/banner/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/banner/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/banner/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/banner/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/banner/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/banner/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/banner/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/banner/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/banner/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/banner/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/banner/src/main/res/values-night/themes.xml b/banner/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..d25b0f2
--- /dev/null
+++ b/banner/src/main/res/values-night/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/banner/src/main/res/values/colors.xml b/banner/src/main/res/values/colors.xml
new file mode 100644
index 0000000..c8524cd
--- /dev/null
+++ b/banner/src/main/res/values/colors.xml
@@ -0,0 +1,5 @@
+
+
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/banner/src/main/res/values/strings.xml b/banner/src/main/res/values/strings.xml
new file mode 100644
index 0000000..98e4892
--- /dev/null
+++ b/banner/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ banner
+
\ No newline at end of file
diff --git a/banner/src/main/res/values/themes.xml b/banner/src/main/res/values/themes.xml
new file mode 100644
index 0000000..d66ac09
--- /dev/null
+++ b/banner/src/main/res/values/themes.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/banner/src/test/java/com/hnucm/banner/ExampleUnitTest.java b/banner/src/test/java/com/hnucm/banner/ExampleUnitTest.java
new file mode 100644
index 0000000..6310ee6
--- /dev/null
+++ b/banner/src/test/java/com/hnucm/banner/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.hnucm.banner;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000..196e647
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,4 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+plugins {
+ id("com.android.application") version "8.2.2" apply false
+}
\ No newline at end of file
diff --git a/fragment/.gitignore b/fragment/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/fragment/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/fragment/build.gradle.kts b/fragment/build.gradle.kts
new file mode 100644
index 0000000..df7ce9d
--- /dev/null
+++ b/fragment/build.gradle.kts
@@ -0,0 +1,42 @@
+plugins {
+ id("com.android.application")
+}
+
+android {
+ namespace = "com.hnucm.fragment"
+ compileSdk = 34
+
+ defaultConfig {
+ applicationId = "com.hnucm.fragment"
+ minSdk = 24
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation("androidx.appcompat:appcompat:1.6.1")
+ implementation("com.google.android.material:material:1.9.0")
+ implementation("androidx.constraintlayout:constraintlayout:2.1.4")
+ testImplementation("junit:junit:4.13.2")
+ androidTestImplementation("androidx.test.ext:junit:1.1.5")
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
+
+ implementation ("com.github.bumptech.glide:glide:4.15.1")
+
+}
\ No newline at end of file
diff --git a/fragment/proguard-rules.pro b/fragment/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/fragment/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/fragment/src/androidTest/java/com/hnucm/fragment/ExampleInstrumentedTest.java b/fragment/src/androidTest/java/com/hnucm/fragment/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..9e44978
--- /dev/null
+++ b/fragment/src/androidTest/java/com/hnucm/fragment/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.hnucm.fragment;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.hnucm.fragment", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/fragment/src/main/AndroidManifest.xml b/fragment/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..18bd90e
--- /dev/null
+++ b/fragment/src/main/AndroidManifest.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/java/com/hnucm/fragment/BlankFragment.java b/fragment/src/main/java/com/hnucm/fragment/BlankFragment.java
new file mode 100644
index 0000000..daff651
--- /dev/null
+++ b/fragment/src/main/java/com/hnucm/fragment/BlankFragment.java
@@ -0,0 +1,33 @@
+package com.hnucm.fragment;
+
+import android.os.Bundle;
+
+import androidx.fragment.app.Fragment;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.TextView;
+
+
+public class BlankFragment extends Fragment {
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_blank, container, false);
+ TextView textView = view.findViewById(R.id.textview);
+ textView.setText("湖南中医药大学");
+// todo 加个按钮点击
+ Button button =view.findViewById(R.id.button);
+ button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ textView.setText("信息科学与工程学院");
+ }
+ });
+
+ return view;
+ }
+}
\ No newline at end of file
diff --git a/fragment/src/main/java/com/hnucm/fragment/Chat.java b/fragment/src/main/java/com/hnucm/fragment/Chat.java
new file mode 100644
index 0000000..785b370
--- /dev/null
+++ b/fragment/src/main/java/com/hnucm/fragment/Chat.java
@@ -0,0 +1,9 @@
+package com.hnucm.fragment;
+
+public class Chat {
+ public String name;
+ public String content;
+
+ public String time;
+ public String imgurl;
+}
diff --git a/fragment/src/main/java/com/hnucm/fragment/ContactFragment.java b/fragment/src/main/java/com/hnucm/fragment/ContactFragment.java
new file mode 100644
index 0000000..f348432
--- /dev/null
+++ b/fragment/src/main/java/com/hnucm/fragment/ContactFragment.java
@@ -0,0 +1,43 @@
+package com.hnucm.fragment;
+
+import android.os.Bundle;
+
+import androidx.fragment.app.Fragment;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+
+
+public class ContactFragment extends Fragment {
+
+ LeftFragment leftFragment = new LeftFragment();
+ RightFragment rightFragment = new RightFragment();
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_contact, container, false);
+
+ getActivity().getSupportFragmentManager().beginTransaction().add(R.id.layout1,leftFragment).commit();
+ getActivity().getSupportFragmentManager().beginTransaction().add(R.id.layout1,rightFragment).commit();
+ getActivity().getSupportFragmentManager().beginTransaction().hide(rightFragment).show(leftFragment).commit();
+ Button button = view.findViewById(R.id.button2);
+ button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ getActivity().getSupportFragmentManager().beginTransaction().hide(rightFragment).show(leftFragment).commit();
+ }
+ });
+
+ Button button2 = view.findViewById(R.id.button3);
+ button2.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ getActivity().getSupportFragmentManager().beginTransaction().hide(leftFragment).show(rightFragment).commit();
+ }
+ });
+ return view;
+ }
+}
\ No newline at end of file
diff --git a/fragment/src/main/java/com/hnucm/fragment/DynamicsFragment.java b/fragment/src/main/java/com/hnucm/fragment/DynamicsFragment.java
new file mode 100644
index 0000000..5d63075
--- /dev/null
+++ b/fragment/src/main/java/com/hnucm/fragment/DynamicsFragment.java
@@ -0,0 +1,91 @@
+package com.hnucm.fragment;
+
+import android.os.Bundle;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.resource.bitmap.CircleCrop;
+import com.bumptech.glide.request.RequestOptions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class DynamicsFragment extends Fragment {
+ RecyclerView recyclerView;
+ MyAdapter myAdapter;
+ List shopCartList = new ArrayList<>();
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_dynamics, container, false);
+
+ //构造20条数据 -> todo 网络请求得到数据
+ for (int i = 0 ; i < 20 ; i ++){
+ ShopCart shopCart = new ShopCart();
+ shopCart.publisher = "出版社" + i;
+ shopCart.bookTitle = "书籍标题" + i;
+ shopCart.price = "2" + i;
+ shopCartList.add(shopCart);
+ }
+ recyclerView = view.findViewById(R.id.shop_recycleview);
+ myAdapter = new MyAdapter();
+ recyclerView.setAdapter(myAdapter);
+ //fragment 方法参数传Context -> getActivity()
+ recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
+
+ return view;
+ }
+
+ // alt +enter MyViewHolder ->item布局文件中控件初始化 + item回收
+ public class MyViewHolder extends RecyclerView.ViewHolder{
+ TextView nameTextView;
+ TextView textView;
+ TextView textView3;
+ public MyViewHolder(@NonNull View itemView) {
+ super(itemView);
+ nameTextView = itemView.findViewById(R.id.textView4);
+ textView = itemView.findViewById(R.id.textView5);
+ textView3 = itemView.findViewById(R.id.textView6);
+ }
+ }
+
+ // alt +enter
+ public class MyAdapter extends RecyclerView.Adapter{
+
+ //加载item布局文件
+ @NonNull
+ @Override
+ public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(getActivity())
+ .inflate(R.layout.shopcart_item_layout,parent,false);
+ return new MyViewHolder(view);
+ }
+
+ //TODO item中的控件设置值 点击事件
+ @Override
+ public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
+ holder.nameTextView.setText(shopCartList.get(position).publisher);
+ holder.textView.setText(shopCartList.get(position).bookTitle);
+ holder.textView3.setText(shopCartList.get(position).price);
+ }
+
+ //item显示条数
+ @Override
+ public int getItemCount() {
+ return shopCartList.size();
+ }
+ }
+}
\ No newline at end of file
diff --git a/fragment/src/main/java/com/hnucm/fragment/LeftFragment.java b/fragment/src/main/java/com/hnucm/fragment/LeftFragment.java
new file mode 100644
index 0000000..efc24b1
--- /dev/null
+++ b/fragment/src/main/java/com/hnucm/fragment/LeftFragment.java
@@ -0,0 +1,21 @@
+package com.hnucm.fragment;
+
+import android.os.Bundle;
+
+import androidx.fragment.app.Fragment;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+
+public class LeftFragment extends Fragment {
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+
+ return inflater.inflate(R.layout.fragment_left, container, false);
+ }
+}
\ No newline at end of file
diff --git a/fragment/src/main/java/com/hnucm/fragment/MainActivity.java b/fragment/src/main/java/com/hnucm/fragment/MainActivity.java
new file mode 100644
index 0000000..b5a8886
--- /dev/null
+++ b/fragment/src/main/java/com/hnucm/fragment/MainActivity.java
@@ -0,0 +1,60 @@
+package com.hnucm.fragment;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.constraintlayout.widget.ConstraintLayout;
+
+import android.os.Bundle;
+import android.view.View;
+
+public class MainActivity extends AppCompatActivity {
+ MessageFragment messageFragment = new MessageFragment();
+ ContactFragment contactFragment = new ContactFragment();
+ DynamicsFragment dynamicsFragment = new DynamicsFragment();
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+// 布局 替换成fragment
+ getSupportFragmentManager().beginTransaction().add(R.id.layout,messageFragment).commit();
+ getSupportFragmentManager().beginTransaction().add(R.id.layout,contactFragment).commit();
+ getSupportFragmentManager().beginTransaction().add(R.id.layout,dynamicsFragment).commit();
+ getSupportFragmentManager().beginTransaction()
+ .hide(contactFragment).hide(dynamicsFragment).show(messageFragment).commit();
+
+ ConstraintLayout constraintLayout1 = findViewById(R.id.constraintLayout2);
+ ConstraintLayout constraintLayout2 = findViewById(R.id.constraintLayout);
+ ConstraintLayout constraintLayout3 = findViewById(R.id.constraintLayout3);
+ constraintLayout1.setSelected(true);
+ constraintLayout1.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ getSupportFragmentManager().beginTransaction()
+ .hide(contactFragment).hide(dynamicsFragment).show(messageFragment).commit();
+ constraintLayout1.setSelected(true);
+ constraintLayout2.setSelected(false);
+ constraintLayout3.setSelected(false);
+ }
+ });
+ constraintLayout2.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ getSupportFragmentManager().beginTransaction()
+ .hide(messageFragment).hide(dynamicsFragment).show(contactFragment).commit();
+ constraintLayout1.setSelected(false);
+ constraintLayout2.setSelected(true);
+ constraintLayout3.setSelected(false);
+ }
+ });
+
+ constraintLayout3.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ getSupportFragmentManager().beginTransaction()
+ .hide(messageFragment).hide(contactFragment).show(dynamicsFragment).commit();
+ constraintLayout1.setSelected(false);
+ constraintLayout2.setSelected(false);
+ constraintLayout3.setSelected(true);
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/fragment/src/main/java/com/hnucm/fragment/MessageFragment.java b/fragment/src/main/java/com/hnucm/fragment/MessageFragment.java
new file mode 100644
index 0000000..d50c738
--- /dev/null
+++ b/fragment/src/main/java/com/hnucm/fragment/MessageFragment.java
@@ -0,0 +1,122 @@
+package com.hnucm.fragment;
+
+import android.content.Intent;
+import android.os.Bundle;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.resource.bitmap.CircleCrop;
+import com.bumptech.glide.request.RequestOptions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class MessageFragment extends Fragment {
+ RecyclerView recyclerView;
+ MyAdapter myAdapter;
+ List chatList = new ArrayList<>();
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ //todo 将聊天列表整合到当前fragment中
+ View view = inflater.inflate(R.layout.fragment_message, container, false);
+ //构造20条数据 -> todo 网络请求得到数据
+ for (int i = 0 ; i < 20 ; i ++){
+ Chat chat = new Chat();
+ chat.name = "姓名" + i;
+ chat.content = "聊天内容" + i;
+ chat.time = "聊天时间" + i;
+ if (i %2 ==0){
+ chat.imgurl = "https://tenfei03.cfp.cn/creative/vcg/800/new/VCG41N1210205351.jpg";
+ }else {
+ chat.imgurl = "https://tenfei01.cfp.cn/creative/vcg/800/new/VCG211333326659-VGE.jpg";
+ }
+ chatList.add(chat);
+ }
+
+ recyclerView = view.findViewById(R.id.recycleview);
+ myAdapter = new MyAdapter();
+ recyclerView.setAdapter(myAdapter);
+ //fragment 方法参数传Context -> getActivity()
+ recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
+
+ return view;
+ }
+
+
+ // alt +enter MyViewHolder ->item布局文件中控件初始化 + item回收
+ public class MyViewHolder extends RecyclerView.ViewHolder{
+ TextView nameTextView;
+ TextView textView;
+ TextView textView3;
+ ImageView imageView;
+ public MyViewHolder(@NonNull View itemView) {
+ super(itemView);
+ nameTextView = itemView.findViewById(R.id.textView);
+ textView = itemView.findViewById(R.id.textView2);
+ textView3 = itemView.findViewById(R.id.textView3);
+ imageView = itemView.findViewById(R.id.imageView);
+ }
+ }
+
+ // alt +enter
+ public class MyAdapter extends RecyclerView.Adapter{
+
+ //加载item布局文件
+ @NonNull
+ @Override
+ public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(getActivity())
+ .inflate(R.layout.chat_item_layout,parent,false);
+ return new MyViewHolder(view);
+ }
+
+ //TODO item中的控件设置值 点击事件
+ @Override
+ public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
+ Chat chat = chatList.get(position);
+ holder.nameTextView.setText(chat.name);
+ //todo -> 湖南中医药大学
+ holder.textView.setText(chat.content);
+ holder.textView3.setText(chat.time);
+// FragmentActvity
+ Glide.with(getActivity())
+ .load(chat.imgurl)
+ .apply(RequestOptions.bitmapTransform(new CircleCrop()))
+ .into(holder.imageView);
+
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Log.i("test","onClick");
+ //todo ->跳转到新的activity
+// Intent intent= new Intent(MainActivity.this, ChatActivity.class);
+// intent.putExtra("name",chat.name);
+// startActivity(intent);
+ }
+ });
+// RecyclerView
+ }
+
+ //item显示条数
+ @Override
+ public int getItemCount() {
+ return chatList.size();
+ }
+ }
+
+
+}
\ No newline at end of file
diff --git a/fragment/src/main/java/com/hnucm/fragment/RightFragment.java b/fragment/src/main/java/com/hnucm/fragment/RightFragment.java
new file mode 100644
index 0000000..5cd7662
--- /dev/null
+++ b/fragment/src/main/java/com/hnucm/fragment/RightFragment.java
@@ -0,0 +1,21 @@
+package com.hnucm.fragment;
+
+import android.os.Bundle;
+
+import androidx.fragment.app.Fragment;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+
+public class RightFragment extends Fragment {
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_right, container, false);
+ }
+}
\ No newline at end of file
diff --git a/fragment/src/main/java/com/hnucm/fragment/ShopCart.java b/fragment/src/main/java/com/hnucm/fragment/ShopCart.java
new file mode 100644
index 0000000..d1be40e
--- /dev/null
+++ b/fragment/src/main/java/com/hnucm/fragment/ShopCart.java
@@ -0,0 +1,7 @@
+package com.hnucm.fragment;
+
+public class ShopCart {
+ public String publisher;
+ public String bookTitle;
+ public String price;
+}
diff --git a/fragment/src/main/res/color/mycolor.xml b/fragment/src/main/res/color/mycolor.xml
new file mode 100644
index 0000000..cfa4722
--- /dev/null
+++ b/fragment/src/main/res/color/mycolor.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/drawable/contact.xml b/fragment/src/main/res/drawable/contact.xml
new file mode 100644
index 0000000..5c503bb
--- /dev/null
+++ b/fragment/src/main/res/drawable/contact.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/drawable/contact_select.png b/fragment/src/main/res/drawable/contact_select.png
new file mode 100644
index 0000000..168d82a
Binary files /dev/null and b/fragment/src/main/res/drawable/contact_select.png differ
diff --git a/fragment/src/main/res/drawable/contact_unselect.png b/fragment/src/main/res/drawable/contact_unselect.png
new file mode 100644
index 0000000..6da3f63
Binary files /dev/null and b/fragment/src/main/res/drawable/contact_unselect.png differ
diff --git a/fragment/src/main/res/drawable/dongtai.xml b/fragment/src/main/res/drawable/dongtai.xml
new file mode 100644
index 0000000..48fed90
--- /dev/null
+++ b/fragment/src/main/res/drawable/dongtai.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/drawable/dongtai_select.png b/fragment/src/main/res/drawable/dongtai_select.png
new file mode 100644
index 0000000..fa38c3e
Binary files /dev/null and b/fragment/src/main/res/drawable/dongtai_select.png differ
diff --git a/fragment/src/main/res/drawable/dongtai_unselect.png b/fragment/src/main/res/drawable/dongtai_unselect.png
new file mode 100644
index 0000000..7e7b664
Binary files /dev/null and b/fragment/src/main/res/drawable/dongtai_unselect.png differ
diff --git a/fragment/src/main/res/drawable/ic_launcher_background.xml b/fragment/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/fragment/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/fragment/src/main/res/drawable/ic_launcher_foreground.xml b/fragment/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/fragment/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/drawable/message.xml b/fragment/src/main/res/drawable/message.xml
new file mode 100644
index 0000000..5d9381a
--- /dev/null
+++ b/fragment/src/main/res/drawable/message.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/drawable/message_select.png b/fragment/src/main/res/drawable/message_select.png
new file mode 100644
index 0000000..9e7464b
Binary files /dev/null and b/fragment/src/main/res/drawable/message_select.png differ
diff --git a/fragment/src/main/res/drawable/message_unselect.png b/fragment/src/main/res/drawable/message_unselect.png
new file mode 100644
index 0000000..b6ca2c8
Binary files /dev/null and b/fragment/src/main/res/drawable/message_unselect.png differ
diff --git a/fragment/src/main/res/layout/activity_main.xml b/fragment/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..a53c7e2
--- /dev/null
+++ b/fragment/src/main/res/layout/activity_main.xml
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/layout/chat_item_layout.xml b/fragment/src/main/res/layout/chat_item_layout.xml
new file mode 100644
index 0000000..6a9345e
--- /dev/null
+++ b/fragment/src/main/res/layout/chat_item_layout.xml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/layout/fragment_blank.xml b/fragment/src/main/res/layout/fragment_blank.xml
new file mode 100644
index 0000000..40b4bc2
--- /dev/null
+++ b/fragment/src/main/res/layout/fragment_blank.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/layout/fragment_contact.xml b/fragment/src/main/res/layout/fragment_contact.xml
new file mode 100644
index 0000000..e3b2908
--- /dev/null
+++ b/fragment/src/main/res/layout/fragment_contact.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/layout/fragment_dynamics.xml b/fragment/src/main/res/layout/fragment_dynamics.xml
new file mode 100644
index 0000000..2ba9872
--- /dev/null
+++ b/fragment/src/main/res/layout/fragment_dynamics.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/layout/fragment_left.xml b/fragment/src/main/res/layout/fragment_left.xml
new file mode 100644
index 0000000..25c82bd
--- /dev/null
+++ b/fragment/src/main/res/layout/fragment_left.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/layout/fragment_message.xml b/fragment/src/main/res/layout/fragment_message.xml
new file mode 100644
index 0000000..84c7884
--- /dev/null
+++ b/fragment/src/main/res/layout/fragment_message.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/layout/fragment_right.xml b/fragment/src/main/res/layout/fragment_right.xml
new file mode 100644
index 0000000..473cbff
--- /dev/null
+++ b/fragment/src/main/res/layout/fragment_right.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/layout/shopcart_item_layout.xml b/fragment/src/main/res/layout/shopcart_item_layout.xml
new file mode 100644
index 0000000..4dd445c
--- /dev/null
+++ b/fragment/src/main/res/layout/shopcart_item_layout.xml
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/fragment/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/fragment/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/fragment/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/fragment/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/mipmap-hdpi/ic_launcher.webp b/fragment/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/fragment/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/fragment/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/fragment/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/fragment/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/fragment/src/main/res/mipmap-mdpi/ic_launcher.webp b/fragment/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/fragment/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/fragment/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/fragment/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/fragment/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/fragment/src/main/res/mipmap-xhdpi/ic_launcher.webp b/fragment/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/fragment/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/fragment/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/fragment/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/fragment/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/fragment/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/fragment/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/fragment/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/fragment/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/fragment/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/fragment/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/fragment/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/fragment/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/fragment/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/fragment/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/fragment/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/fragment/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/fragment/src/main/res/values-night/themes.xml b/fragment/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..d25b0f2
--- /dev/null
+++ b/fragment/src/main/res/values-night/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/main/res/values/colors.xml b/fragment/src/main/res/values/colors.xml
new file mode 100644
index 0000000..c8524cd
--- /dev/null
+++ b/fragment/src/main/res/values/colors.xml
@@ -0,0 +1,5 @@
+
+
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/fragment/src/main/res/values/strings.xml b/fragment/src/main/res/values/strings.xml
new file mode 100644
index 0000000..e90bfa3
--- /dev/null
+++ b/fragment/src/main/res/values/strings.xml
@@ -0,0 +1,5 @@
+
+ fragment
+
+ Hello blank fragment
+
\ No newline at end of file
diff --git a/fragment/src/main/res/values/themes.xml b/fragment/src/main/res/values/themes.xml
new file mode 100644
index 0000000..d66ac09
--- /dev/null
+++ b/fragment/src/main/res/values/themes.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fragment/src/test/java/com/hnucm/fragment/ExampleUnitTest.java b/fragment/src/test/java/com/hnucm/fragment/ExampleUnitTest.java
new file mode 100644
index 0000000..a3f47e5
--- /dev/null
+++ b/fragment/src/test/java/com/hnucm/fragment/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.hnucm.fragment;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..ba32d98
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,22 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app's APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+android.enableJetifier=true
+# Enables namespacing of each library's R class so that its R class includes only the
+# resources declared in the library itself and none from the library's dependencies,
+# thereby reducing the size of the R class for that library
+android.nonTransitiveRClass=true
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..e708b1c
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..a4d4241
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Feb 26 14:58:37 CST 2024
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
new file mode 100644
index 0000000..4f906e0
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,185 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..107acd3
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,89 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/network/.gitignore b/network/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/network/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/network/build.gradle.kts b/network/build.gradle.kts
new file mode 100644
index 0000000..d30c569
--- /dev/null
+++ b/network/build.gradle.kts
@@ -0,0 +1,42 @@
+plugins {
+ id("com.android.application")
+}
+
+android {
+ namespace = "com.hnucm.network"
+ compileSdk = 34
+
+ defaultConfig {
+ applicationId = "com.hnucm.network"
+ minSdk = 24
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation("androidx.appcompat:appcompat:1.6.1")
+ implementation("com.google.android.material:material:1.9.0")
+ implementation("androidx.constraintlayout:constraintlayout:2.1.4")
+ testImplementation("junit:junit:4.13.2")
+ androidTestImplementation("androidx.test.ext:junit:1.1.5")
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
+ implementation("com.squareup.okhttp3:okhttp:4.11.0")
+ implementation ("com.github.bumptech.glide:glide:4.15.1")
+ implementation ("com.google.code.gson:gson:2.10.1")
+}
\ No newline at end of file
diff --git a/network/proguard-rules.pro b/network/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/network/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/network/src/androidTest/java/com/hnucm/network/ExampleInstrumentedTest.java b/network/src/androidTest/java/com/hnucm/network/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..f338108
--- /dev/null
+++ b/network/src/androidTest/java/com/hnucm/network/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.hnucm.network;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.hnucm.network", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/network/src/main/AndroidManifest.xml b/network/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..21edbf9
--- /dev/null
+++ b/network/src/main/AndroidManifest.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/network/src/main/java/com/hnucm/network/Chat.java b/network/src/main/java/com/hnucm/network/Chat.java
new file mode 100644
index 0000000..eed19e8
--- /dev/null
+++ b/network/src/main/java/com/hnucm/network/Chat.java
@@ -0,0 +1,16 @@
+package com.hnucm.network;
+
+import java.util.List;
+
+public class Chat {
+
+ public String headimg;
+ public List chatlist;
+
+ public static class ChatlistDTO {
+ public String head;
+ public String name;
+ public String content;
+ public String time;
+ }
+}
diff --git a/network/src/main/java/com/hnucm/network/MainActivity.java b/network/src/main/java/com/hnucm/network/MainActivity.java
new file mode 100644
index 0000000..14a6968
--- /dev/null
+++ b/network/src/main/java/com/hnucm/network/MainActivity.java
@@ -0,0 +1,146 @@
+package com.hnucm.network;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.resource.bitmap.CircleCrop;
+import com.bumptech.glide.request.RequestOptions;
+import com.google.gson.Gson;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.FormBody;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.Response;
+
+public class MainActivity extends AppCompatActivity {
+ RecyclerView recyclerView;
+ MyAdapter myAdapter;
+ List chatList = new ArrayList<>();
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ recyclerView = findViewById(R.id.recycleview);
+ myAdapter = new MyAdapter();
+ recyclerView.setAdapter(myAdapter);
+ recyclerView.setLayoutManager(new LinearLayoutManager(this));
+
+// get请求地址: http://106.53.194.250/object
+ Request request = new Request.Builder()
+ .url("http://106.53.194.250/usercenterlist")
+ .get()
+ .build();
+ OkHttpClient okHttpClient = new OkHttpClient();
+ Call call = okHttpClient.newCall(request);
+// 创建了一个新的线程
+ call.enqueue(new Callback() {
+ @Override
+ public void onFailure(@NonNull Call call, @NonNull IOException e) {
+ }
+ @Override
+ public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
+ String result = response.body().string();
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ Gson gson = new Gson();
+ Chat chat= gson.fromJson(result,Chat.class);
+ chatList.addAll(chat.chatlist);
+ myAdapter.notifyDataSetChanged();
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+
+ }
+ });
+
+
+
+
+
+ }
+
+ public class MyViewHolder extends RecyclerView.ViewHolder{
+ TextView nameTextView;
+ TextView textView;
+ TextView textView3;
+ ImageView imageView;
+ public MyViewHolder(@NonNull View itemView) {
+ super(itemView);
+ nameTextView = itemView.findViewById(R.id.textView);
+ textView = itemView.findViewById(R.id.textView2);
+ textView3 = itemView.findViewById(R.id.textView3);
+ imageView = itemView.findViewById(R.id.imageView);
+ }
+ }
+
+ // alt +enter
+ public class MyAdapter extends RecyclerView.Adapter{
+
+ //加载item布局文件
+ @NonNull
+ @Override
+ public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(MainActivity.this)
+ .inflate(R.layout.chat_item_layout,parent,false);
+ return new MyViewHolder(view);
+ }
+
+ //TODO item中的控件设置值 点击事件
+ @Override
+ public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
+ Chat.ChatlistDTO chat = chatList.get(position);
+ holder.nameTextView.setText(chat.name);
+ //todo -> 湖南中医药大学
+ holder.textView.setText(chat.content);
+ holder.textView3.setText(chat.time);
+ Glide.with(MainActivity.this)
+ .load(chat.head)
+ .apply(RequestOptions.bitmapTransform(new CircleCrop()))
+ .into(holder.imageView);
+
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Log.i("test","onClick");
+
+ }
+ });
+// RecyclerView
+ }
+
+ //item显示条数
+ @Override
+ public int getItemCount() {
+ return chatList.size();
+ }
+ }
+}
\ No newline at end of file
diff --git a/network/src/main/java/com/hnucm/network/Student.java b/network/src/main/java/com/hnucm/network/Student.java
new file mode 100644
index 0000000..49cffef
--- /dev/null
+++ b/network/src/main/java/com/hnucm/network/Student.java
@@ -0,0 +1,17 @@
+package com.hnucm.network;
+
+import java.util.List;
+
+public class Student {
+
+ public String grade;
+ public String classname;
+ public List students;
+
+ public static class StudentsDTO {
+ public String id;
+ public Integer age;
+ public String name;
+ public Boolean isstudent;
+ }
+}
diff --git a/network/src/main/res/drawable/ic_launcher_background.xml b/network/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/network/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/network/src/main/res/drawable/ic_launcher_foreground.xml b/network/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/network/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/network/src/main/res/layout/activity_main.xml b/network/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..741045b
--- /dev/null
+++ b/network/src/main/res/layout/activity_main.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/network/src/main/res/layout/chat_item_layout.xml b/network/src/main/res/layout/chat_item_layout.xml
new file mode 100644
index 0000000..6a9345e
--- /dev/null
+++ b/network/src/main/res/layout/chat_item_layout.xml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/network/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/network/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/network/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/network/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/network/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/network/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/network/src/main/res/mipmap-hdpi/ic_launcher.webp b/network/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/network/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/network/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/network/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/network/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/network/src/main/res/mipmap-mdpi/ic_launcher.webp b/network/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/network/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/network/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/network/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/network/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/network/src/main/res/mipmap-xhdpi/ic_launcher.webp b/network/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/network/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/network/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/network/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/network/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/network/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/network/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/network/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/network/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/network/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/network/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/network/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/network/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/network/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/network/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/network/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/network/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/network/src/main/res/values-night/themes.xml b/network/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..d25b0f2
--- /dev/null
+++ b/network/src/main/res/values-night/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/network/src/main/res/values/colors.xml b/network/src/main/res/values/colors.xml
new file mode 100644
index 0000000..c8524cd
--- /dev/null
+++ b/network/src/main/res/values/colors.xml
@@ -0,0 +1,5 @@
+
+
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/network/src/main/res/values/strings.xml b/network/src/main/res/values/strings.xml
new file mode 100644
index 0000000..f74abf3
--- /dev/null
+++ b/network/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ network
+
\ No newline at end of file
diff --git a/network/src/main/res/values/themes.xml b/network/src/main/res/values/themes.xml
new file mode 100644
index 0000000..d66ac09
--- /dev/null
+++ b/network/src/main/res/values/themes.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/network/src/test/java/com/hnucm/network/ExampleUnitTest.java b/network/src/test/java/com/hnucm/network/ExampleUnitTest.java
new file mode 100644
index 0000000..5e74af3
--- /dev/null
+++ b/network/src/test/java/com/hnucm/network/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.hnucm.network;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/recycleview/.gitignore b/recycleview/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/recycleview/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/recycleview/build.gradle.kts b/recycleview/build.gradle.kts
new file mode 100644
index 0000000..85b4995
--- /dev/null
+++ b/recycleview/build.gradle.kts
@@ -0,0 +1,49 @@
+plugins {
+ id("com.android.application")
+}
+
+android {
+ namespace = "com.hnucm.recycleview"
+ compileSdk = 34
+
+ defaultConfig {
+ applicationId = "com.hnucm.recycleview"
+ minSdk = 24
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation("androidx.appcompat:appcompat:1.6.1")
+ implementation("com.google.android.material:material:1.9.0")
+ implementation("androidx.constraintlayout:constraintlayout:2.1.4")
+ testImplementation("junit:junit:4.13.2")
+ androidTestImplementation("androidx.test.ext:junit:1.1.5")
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
+ implementation ("com.github.bumptech.glide:glide:4.15.1")
+
+ implementation ("io.github.scwang90:refresh-layout-kernel:2.1.0") //核心必须依赖
+ implementation ("io.github.scwang90:refresh-header-classics:2.1.0") //经典刷新头
+ implementation ("io.github.scwang90:refresh-header-radar:2.1.0") //雷达刷新头
+ implementation ("io.github.scwang90:refresh-header-falsify:2.1.0") //虚拟刷新头
+ implementation ("io.github.scwang90:refresh-header-material:2.1.0") //谷歌刷新头
+ implementation ("io.github.scwang90:refresh-header-two-level:2.1.0") //二级刷新头
+ implementation ("io.github.scwang90:refresh-footer-ball:2.1.0") //球脉冲加载
+ implementation ("io.github.scwang90:refresh-footer-classics:2.1.0")
+}
\ No newline at end of file
diff --git a/recycleview/proguard-rules.pro b/recycleview/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/recycleview/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/recycleview/src/androidTest/java/com/hnucm/recycleview/ExampleInstrumentedTest.java b/recycleview/src/androidTest/java/com/hnucm/recycleview/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..77a5a66
--- /dev/null
+++ b/recycleview/src/androidTest/java/com/hnucm/recycleview/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.hnucm.recycleview;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.hnucm.recycleview", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/recycleview/src/main/AndroidManifest.xml b/recycleview/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..1df5875
--- /dev/null
+++ b/recycleview/src/main/AndroidManifest.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/recycleview/src/main/java/com/hnucm/recycleview/Chat.java b/recycleview/src/main/java/com/hnucm/recycleview/Chat.java
new file mode 100644
index 0000000..f6c41df
--- /dev/null
+++ b/recycleview/src/main/java/com/hnucm/recycleview/Chat.java
@@ -0,0 +1,9 @@
+package com.hnucm.recycleview;
+
+public class Chat {
+ public String name;
+ public String content;
+
+ public String time;
+ public String imgurl;
+}
diff --git a/recycleview/src/main/java/com/hnucm/recycleview/ChatActivity.java b/recycleview/src/main/java/com/hnucm/recycleview/ChatActivity.java
new file mode 100644
index 0000000..2b00f0f
--- /dev/null
+++ b/recycleview/src/main/java/com/hnucm/recycleview/ChatActivity.java
@@ -0,0 +1,20 @@
+package com.hnucm.recycleview;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+import android.widget.TextView;
+
+public class ChatActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_chat);
+ String name = getIntent().getStringExtra("name");
+ TextView textView=findViewById(R.id.textView4);
+ textView.setText(name);
+
+
+ }
+}
\ No newline at end of file
diff --git a/recycleview/src/main/java/com/hnucm/recycleview/MainActivity.java b/recycleview/src/main/java/com/hnucm/recycleview/MainActivity.java
new file mode 100644
index 0000000..b7368c6
--- /dev/null
+++ b/recycleview/src/main/java/com/hnucm/recycleview/MainActivity.java
@@ -0,0 +1,175 @@
+package com.hnucm.recycleview;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.resource.bitmap.CircleCrop;
+import com.bumptech.glide.request.RequestOptions;
+import com.scwang.smart.refresh.footer.BallPulseFooter;
+import com.scwang.smart.refresh.footer.ClassicsFooter;
+import com.scwang.smart.refresh.header.BezierRadarHeader;
+import com.scwang.smart.refresh.header.ClassicsHeader;
+import com.scwang.smart.refresh.header.FalsifyHeader;
+import com.scwang.smart.refresh.header.TwoLevelHeader;
+import com.scwang.smart.refresh.layout.SmartRefreshLayout;
+import com.scwang.smart.refresh.layout.api.RefreshLayout;
+import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener;
+import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MainActivity extends AppCompatActivity {
+ RecyclerView recyclerView;
+ MyAdapter myAdapter;
+ List chatList = new ArrayList<>();
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ //构造20条数据 -> todo 网络请求得到数据
+ for (int i = 0 ; i < 20 ; i ++){
+ Chat chat = new Chat();
+ chat.name = "姓名" + i;
+ chat.content = "聊天内容" + i;
+ chat.time = "聊天时间" + i;
+ if (i %2 ==0){
+ chat.imgurl = "https://tenfei03.cfp.cn/creative/vcg/800/new/VCG41N1210205351.jpg";
+ }else {
+ chat.imgurl = "https://tenfei01.cfp.cn/creative/vcg/800/new/VCG211333326659-VGE.jpg";
+ }
+ chatList.add(chat);
+ }
+ SmartRefreshLayout smartRefreshLayout = findViewById(R.id.smartlayout);
+// smartRefreshLayout.setRefreshHeader(new ClassicsHeader(this));
+// smartRefreshLayout.setRefreshHeader(new BezierRadarHeader(this));
+ smartRefreshLayout.setRefreshHeader(new ClassicsHeader(this));
+// smartRefreshLayout.setRefreshFooter(new ClassicsFooter(this));
+ smartRefreshLayout.setRefreshFooter(new BallPulseFooter(this));
+ smartRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
+ @Override
+ public void onRefresh(@NonNull RefreshLayout refreshLayout) {
+ // 把列表中的数据清除掉
+ chatList.clear();
+ // 拉取新的数据 重新构造 -> todo 网络请求得到数据
+ for (int i = 0 ; i < 20 ; i ++){
+ Chat chat = new Chat();
+ chat.name = "new 姓名" + i;
+ chat.content = "new 聊天内容" + i;
+ chat.time = "new 聊天时间" + i;
+ if (i %2 ==0){
+ chat.imgurl = "https://tenfei03.cfp.cn/creative/vcg/800/new/VCG41N1210205351.jpg";
+ }else {
+ chat.imgurl = "https://tenfei01.cfp.cn/creative/vcg/800/new/VCG211333326659-VGE.jpg";
+ }
+ chatList.add(chat);
+ }
+ smartRefreshLayout.finishRefresh(2000);
+ myAdapter.notifyDataSetChanged();
+ }
+ });
+
+ smartRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
+ @Override
+ public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
+ //请求更多数据
+ // 拉取新的数据 重新构造 -> todo 网络请求得到数据
+ for (int i = 0 ; i < 20 ; i ++){
+ Chat chat = new Chat();
+ chat.name = "new 上拉刷新 姓名" + i;
+ chat.content = "new 上拉刷新 聊天内容" + i;
+ chat.time = "new 上拉刷新 聊天时间" + i;
+ if (i %2 ==0){
+ chat.imgurl = "https://tenfei03.cfp.cn/creative/vcg/800/new/VCG41N1210205351.jpg";
+ }else {
+ chat.imgurl = "https://tenfei01.cfp.cn/creative/vcg/800/new/VCG211333326659-VGE.jpg";
+ }
+ chatList.add(chat);
+ }
+ smartRefreshLayout.finishLoadMore(2000);
+ myAdapter.notifyDataSetChanged();
+ }
+ });
+ recyclerView = findViewById(R.id.recycleview);
+ myAdapter = new MyAdapter();
+ recyclerView.setAdapter(myAdapter);
+ recyclerView.setLayoutManager(new LinearLayoutManager(this));
+// recyclerView.setLayoutManager(new GridLayoutManager(MainActivity.this,2));
+ }
+
+ // alt +enter MyViewHolder ->item布局文件中控件初始化 + item回收
+ public class MyViewHolder extends RecyclerView.ViewHolder{
+ TextView nameTextView;
+ TextView textView;
+ TextView textView3;
+ ImageView imageView;
+ public MyViewHolder(@NonNull View itemView) {
+ super(itemView);
+ nameTextView = itemView.findViewById(R.id.textView);
+ textView = itemView.findViewById(R.id.textView2);
+ textView3 = itemView.findViewById(R.id.textView3);
+ imageView = itemView.findViewById(R.id.imageView);
+ }
+ }
+
+ // alt +enter
+ public class MyAdapter extends RecyclerView.Adapter{
+
+ //加载item布局文件
+ @NonNull
+ @Override
+ public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(MainActivity.this)
+ .inflate(R.layout.chat_item_layout,parent,false);
+ return new MyViewHolder(view);
+ }
+
+ //TODO item中的控件设置值 点击事件
+ @Override
+ public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
+ Chat chat = chatList.get(position);
+ holder.nameTextView.setText(chat.name);
+ //todo -> 湖南中医药大学
+ holder.textView.setText(chat.content);
+ holder.textView3.setText(chat.time);
+ Glide.with(MainActivity.this)
+ .load(chat.imgurl)
+ .apply(RequestOptions.bitmapTransform(new CircleCrop()))
+ .into(holder.imageView);
+
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Log.i("test","onClick");
+ //todo ->跳转到新的activity
+ Intent intent= new Intent(MainActivity.this, ChatActivity.class);
+ intent.putExtra("name",chat.name);
+ startActivity(intent);
+ }
+ });
+// RecyclerView
+ }
+
+ //item显示条数
+ @Override
+ public int getItemCount() {
+ return chatList.size();
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/recycleview/src/main/java/com/hnucm/recycleview/MainActivity2.java b/recycleview/src/main/java/com/hnucm/recycleview/MainActivity2.java
new file mode 100644
index 0000000..93ca074
--- /dev/null
+++ b/recycleview/src/main/java/com/hnucm/recycleview/MainActivity2.java
@@ -0,0 +1,14 @@
+package com.hnucm.recycleview;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+
+public class MainActivity2 extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main2);
+ }
+}
\ No newline at end of file
diff --git a/recycleview/src/main/res/drawable/ic_launcher_background.xml b/recycleview/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/recycleview/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/recycleview/src/main/res/drawable/ic_launcher_foreground.xml b/recycleview/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/recycleview/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/recycleview/src/main/res/layout/activity_chat.xml b/recycleview/src/main/res/layout/activity_chat.xml
new file mode 100644
index 0000000..36c1737
--- /dev/null
+++ b/recycleview/src/main/res/layout/activity_chat.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/recycleview/src/main/res/layout/activity_main.xml b/recycleview/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..414af17
--- /dev/null
+++ b/recycleview/src/main/res/layout/activity_main.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/recycleview/src/main/res/layout/activity_main2.xml b/recycleview/src/main/res/layout/activity_main2.xml
new file mode 100644
index 0000000..ed1b250
--- /dev/null
+++ b/recycleview/src/main/res/layout/activity_main2.xml
@@ -0,0 +1,9 @@
+
+
+
+
\ No newline at end of file
diff --git a/recycleview/src/main/res/layout/chat_item_layout.xml b/recycleview/src/main/res/layout/chat_item_layout.xml
new file mode 100644
index 0000000..6a9345e
--- /dev/null
+++ b/recycleview/src/main/res/layout/chat_item_layout.xml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/recycleview/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/recycleview/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/recycleview/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/recycleview/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/recycleview/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/recycleview/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/recycleview/src/main/res/mipmap-hdpi/ic_launcher.webp b/recycleview/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/recycleview/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/recycleview/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/recycleview/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/recycleview/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/recycleview/src/main/res/mipmap-mdpi/ic_launcher.webp b/recycleview/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/recycleview/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/recycleview/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/recycleview/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/recycleview/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/recycleview/src/main/res/mipmap-xhdpi/ic_launcher.webp b/recycleview/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/recycleview/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/recycleview/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/recycleview/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/recycleview/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/recycleview/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/recycleview/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/recycleview/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/recycleview/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/recycleview/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/recycleview/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/recycleview/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/recycleview/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/recycleview/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/recycleview/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/recycleview/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/recycleview/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/recycleview/src/main/res/values-night/themes.xml b/recycleview/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..d25b0f2
--- /dev/null
+++ b/recycleview/src/main/res/values-night/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/recycleview/src/main/res/values/colors.xml b/recycleview/src/main/res/values/colors.xml
new file mode 100644
index 0000000..c8524cd
--- /dev/null
+++ b/recycleview/src/main/res/values/colors.xml
@@ -0,0 +1,5 @@
+
+
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/recycleview/src/main/res/values/strings.xml b/recycleview/src/main/res/values/strings.xml
new file mode 100644
index 0000000..0012a93
--- /dev/null
+++ b/recycleview/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ recycleview
+
\ No newline at end of file
diff --git a/recycleview/src/main/res/values/themes.xml b/recycleview/src/main/res/values/themes.xml
new file mode 100644
index 0000000..d66ac09
--- /dev/null
+++ b/recycleview/src/main/res/values/themes.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/recycleview/src/test/java/com/hnucm/recycleview/ExampleUnitTest.java b/recycleview/src/test/java/com/hnucm/recycleview/ExampleUnitTest.java
new file mode 100644
index 0000000..23649d7
--- /dev/null
+++ b/recycleview/src/test/java/com/hnucm/recycleview/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.hnucm.recycleview;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/retrofit/.gitignore b/retrofit/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/retrofit/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/retrofit/build.gradle.kts b/retrofit/build.gradle.kts
new file mode 100644
index 0000000..70efd75
--- /dev/null
+++ b/retrofit/build.gradle.kts
@@ -0,0 +1,47 @@
+plugins {
+ id("com.android.application")
+}
+
+android {
+ namespace = "com.hnucm.retrofit"
+ compileSdk = 34
+
+ defaultConfig {
+ applicationId = "com.hnucm.retrofit"
+ minSdk = 24
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation("androidx.appcompat:appcompat:1.6.1")
+ implementation("com.google.android.material:material:1.9.0")
+ implementation("androidx.constraintlayout:constraintlayout:2.1.4")
+ testImplementation("junit:junit:4.13.2")
+ androidTestImplementation("androidx.test.ext:junit:1.1.5")
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
+
+
+
+ implementation("com.squareup.okhttp3:okhttp:4.11.0")
+ implementation ("com.google.code.gson:gson:2.10.1")
+ implementation ("com.squareup.okhttp3:logging-interceptor:4.9.3")
+ implementation ("com.squareup.retrofit2:retrofit:2.9.0")
+ implementation ("com.squareup.retrofit2:converter-gson:2.9.0")
+}
\ No newline at end of file
diff --git a/retrofit/proguard-rules.pro b/retrofit/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/retrofit/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/retrofit/src/androidTest/java/com/hnucm/retrofit/ExampleInstrumentedTest.java b/retrofit/src/androidTest/java/com/hnucm/retrofit/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..2bb4a7c
--- /dev/null
+++ b/retrofit/src/androidTest/java/com/hnucm/retrofit/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.hnucm.retrofit;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.hnucm.retrofit", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/retrofit/src/main/AndroidManifest.xml b/retrofit/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..43f3ce2
--- /dev/null
+++ b/retrofit/src/main/AndroidManifest.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/retrofit/src/main/java/com/hnucm/retrofit/Api.java b/retrofit/src/main/java/com/hnucm/retrofit/Api.java
new file mode 100644
index 0000000..f7bbabb
--- /dev/null
+++ b/retrofit/src/main/java/com/hnucm/retrofit/Api.java
@@ -0,0 +1,12 @@
+package com.hnucm.retrofit;
+
+import retrofit2.Call;
+import retrofit2.http.GET;
+import retrofit2.http.Header;
+import retrofit2.http.Query;
+
+public interface Api {
+//
+ @GET("area-to-weather-date")
+ Call getStudentList(@Header("Authorization") String token, @Query("area") String area);
+}
diff --git a/retrofit/src/main/java/com/hnucm/retrofit/MainActivity.java b/retrofit/src/main/java/com/hnucm/retrofit/MainActivity.java
new file mode 100644
index 0000000..ae2b241
--- /dev/null
+++ b/retrofit/src/main/java/com/hnucm/retrofit/MainActivity.java
@@ -0,0 +1,46 @@
+package com.hnucm.retrofit;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+import android.widget.TextView;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+import retrofit2.Retrofit;
+import retrofit2.converter.gson.GsonConverterFactory;
+
+public class MainActivity extends AppCompatActivity {
+// f9d2c1f2bfff454590e6a678ef2907bd
+// https://ali-weather.showapi.com/ area-to-weather-date
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ TextView textView = findViewById(R.id.text);
+// 请求发送okhttp 解析Gson 切换主线程更新
+// retrofit
+// Retrofit retrofit = new Retrofit.Builder().baseUrl("http://106.53.194.250/")
+// .addConverterFactory(GsonConverterFactory.create()).build();
+ Api api = RetrofitUtils.getRetrofit("https://ali-weather.showapi.com/").create(Api.class);;
+ Call studentCall =api.getStudentList("APPCODE f9d2c1f2bfff454590e6a678ef2907bd","长沙市");
+
+ //简化版本天气应用 查询当天天气 未来15天
+
+ studentCall.enqueue(new Callback() {
+ @Override
+ public void onResponse(Call call, Response response) {
+ //主线程
+ Student student = response.body();
+ textView.setText(student.showapi_res_body.f1.day_weather);
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t) {
+
+ }
+ });
+
+ }
+}
\ No newline at end of file
diff --git a/retrofit/src/main/java/com/hnucm/retrofit/RetrofitUtils.java b/retrofit/src/main/java/com/hnucm/retrofit/RetrofitUtils.java
new file mode 100644
index 0000000..c395494
--- /dev/null
+++ b/retrofit/src/main/java/com/hnucm/retrofit/RetrofitUtils.java
@@ -0,0 +1,39 @@
+package com.hnucm.retrofit;
+
+
+import android.util.Log;
+
+import okhttp3.OkHttpClient;
+import okhttp3.logging.HttpLoggingInterceptor;
+import retrofit2.Retrofit;
+import retrofit2.converter.gson.GsonConverterFactory;
+
+public class RetrofitUtils {
+
+ public static Retrofit getRetrofit(String url) {
+ //日志显示级别
+ HttpLoggingInterceptor.Level level= HttpLoggingInterceptor.Level.BODY;
+ //新建log拦截器
+ HttpLoggingInterceptor loggingInterceptor=new HttpLoggingInterceptor(new HttpLoggingInterceptor.Logger() {
+ @Override
+ public void log(String message) {
+ Log.d("RetrofitMessage","OkHttp====Message:"+message);
+ }
+ });
+ loggingInterceptor.setLevel(level);
+ //定制OkHttp
+ OkHttpClient.Builder httpClientBuilder = new OkHttpClient
+ .Builder();
+ //OkHttp进行添加拦截器loggingInterceptor
+ httpClientBuilder.addInterceptor(loggingInterceptor);
+
+ Retrofit retrofit = new Retrofit.Builder()
+ .baseUrl(url)
+ .addConverterFactory(GsonConverterFactory.create())
+ .client( httpClientBuilder.build())
+ .build();
+
+ return retrofit;
+ }
+
+}
\ No newline at end of file
diff --git a/retrofit/src/main/java/com/hnucm/retrofit/Student.java b/retrofit/src/main/java/com/hnucm/retrofit/Student.java
new file mode 100644
index 0000000..cd4a32f
--- /dev/null
+++ b/retrofit/src/main/java/com/hnucm/retrofit/Student.java
@@ -0,0 +1,208 @@
+package com.hnucm.retrofit;
+
+public class Student {
+
+ public String showapi_res_error;
+ public String showapi_res_id;
+ public Integer showapi_res_code;
+ public Integer showapi_fee_num;
+ public ShowapiResBodyDTO showapi_res_body;
+
+ public static class ShowapiResBodyDTO {
+ public CityInfoDTO cityInfo;
+ public String date;
+ public String remark;
+ public F1DTO f1;
+ public Integer ret_code;
+
+ public static class CityInfoDTO {
+ public String c4;
+ public String c17;
+ public String c5;
+ public String c0;
+ public Double latitude;
+ public String c7;
+ public String c1;
+ public String c15;
+ public String c8;
+ public String c2;
+ public String c12;
+ public String c11;
+ public String c9;
+ public String c6;
+ public String c3;
+ public Double longitude;
+ public String c16;
+ public String c10;
+ }
+
+ public static class F1DTO {
+ public String day_wind_power;
+ public String night_wind_power;
+ public String night_weather_code;
+ public String day_weather;
+ public String sun_begin_end;
+ public String night_weather_pic;
+ public IndexDTO index;
+ public String day_weather_code;
+ public String day;
+ public String night_weather;
+ public String ziwaixian;
+ public String jiangshui;
+ public String day_wind_direction;
+ public String night_wind_direction;
+ public String night_air_temperature;
+ public String air_press;
+ public Integer weekday;
+ public String day_weather_pic;
+ public String day_air_temperature;
+
+ public static class IndexDTO {
+ public YhDTO yh;
+ public ZsDTO zs;
+ public ClDTO cl;
+ public TravelDTO travel;
+ public ComfortDTO comfort;
+ public BeautyDTO beauty;
+ public PjDTO pj;
+ public DyDTO dy;
+ public NlDTO nl;
+ public PkDTO pk;
+ public UvDTO uv;
+ public AgDTO ag;
+ public AqiDTO aqi;
+ public GjDTO gj;
+ public MfDTO mf;
+ public LsDTO ls;
+ public GlassDTO glass;
+ public XqDTO xq;
+ public AcDTO ac;
+ public SportsDTO sports;
+ public ClothesDTO clothes;
+ public HcDTO hc;
+ public WashCarDTO wash_car;
+ public ColdDTO cold;
+
+ public static class YhDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class ZsDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class ClDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class TravelDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class ComfortDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class BeautyDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class PjDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class DyDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class NlDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class PkDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class UvDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class AgDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class AqiDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class GjDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class MfDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class LsDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class GlassDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class XqDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class AcDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class SportsDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class ClothesDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class HcDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class WashCarDTO {
+ public String desc;
+ public String title;
+ }
+
+ public static class ColdDTO {
+ public String desc;
+ public String title;
+ }
+ }
+ }
+ }
+}
diff --git a/retrofit/src/main/res/drawable/ic_launcher_background.xml b/retrofit/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/retrofit/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/retrofit/src/main/res/drawable/ic_launcher_foreground.xml b/retrofit/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/retrofit/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/retrofit/src/main/res/layout/activity_main.xml b/retrofit/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..2144127
--- /dev/null
+++ b/retrofit/src/main/res/layout/activity_main.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/retrofit/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/retrofit/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/retrofit/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/retrofit/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/retrofit/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/retrofit/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/retrofit/src/main/res/mipmap-hdpi/ic_launcher.webp b/retrofit/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/retrofit/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/retrofit/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/retrofit/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/retrofit/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/retrofit/src/main/res/mipmap-mdpi/ic_launcher.webp b/retrofit/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/retrofit/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/retrofit/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/retrofit/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/retrofit/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/retrofit/src/main/res/mipmap-xhdpi/ic_launcher.webp b/retrofit/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/retrofit/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/retrofit/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/retrofit/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/retrofit/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/retrofit/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/retrofit/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/retrofit/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/retrofit/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/retrofit/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/retrofit/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/retrofit/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/retrofit/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/retrofit/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/retrofit/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/retrofit/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/retrofit/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/retrofit/src/main/res/values-night/themes.xml b/retrofit/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..d25b0f2
--- /dev/null
+++ b/retrofit/src/main/res/values-night/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/retrofit/src/main/res/values/colors.xml b/retrofit/src/main/res/values/colors.xml
new file mode 100644
index 0000000..c8524cd
--- /dev/null
+++ b/retrofit/src/main/res/values/colors.xml
@@ -0,0 +1,5 @@
+
+
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/retrofit/src/main/res/values/strings.xml b/retrofit/src/main/res/values/strings.xml
new file mode 100644
index 0000000..3b14699
--- /dev/null
+++ b/retrofit/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ retrofit
+
\ No newline at end of file
diff --git a/retrofit/src/main/res/values/themes.xml b/retrofit/src/main/res/values/themes.xml
new file mode 100644
index 0000000..d66ac09
--- /dev/null
+++ b/retrofit/src/main/res/values/themes.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/retrofit/src/test/java/com/hnucm/retrofit/ExampleUnitTest.java b/retrofit/src/test/java/com/hnucm/retrofit/ExampleUnitTest.java
new file mode 100644
index 0000000..a815fa2
--- /dev/null
+++ b/retrofit/src/test/java/com/hnucm/retrofit/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.hnucm.retrofit;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/settings.gradle.kts b/settings.gradle.kts
new file mode 100644
index 0000000..fcc9c16
--- /dev/null
+++ b/settings.gradle.kts
@@ -0,0 +1,26 @@
+pluginManagement {
+ repositories {
+ google()
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
+dependencyResolutionManagement {
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+rootProject.name = "My Application"
+include(":app")
+include(":ui")
+include(":ui2")
+include(":activity")
+include(":fragment")
+include(":banner")
+include(":recycleview")
+include(":network")
+include(":retrofit")
+include(":webview")
diff --git a/ui/.gitignore b/ui/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/ui/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/ui/build.gradle.kts b/ui/build.gradle.kts
new file mode 100644
index 0000000..6b9261f
--- /dev/null
+++ b/ui/build.gradle.kts
@@ -0,0 +1,39 @@
+plugins {
+ id("com.android.application")
+}
+
+android {
+ namespace = "com.hnucm.ui"
+ compileSdk = 34
+
+ defaultConfig {
+ applicationId = "com.hnucm.ui"
+ minSdk = 24
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation("androidx.appcompat:appcompat:1.6.1")
+ implementation("com.google.android.material:material:1.9.0")
+ implementation("androidx.constraintlayout:constraintlayout:2.1.4")
+ testImplementation("junit:junit:4.13.2")
+ androidTestImplementation("androidx.test.ext:junit:1.1.5")
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
+}
\ No newline at end of file
diff --git a/ui/proguard-rules.pro b/ui/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/ui/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/ui/src/androidTest/java/com/hnucm/ui/ExampleInstrumentedTest.java b/ui/src/androidTest/java/com/hnucm/ui/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..b0cd2c1
--- /dev/null
+++ b/ui/src/androidTest/java/com/hnucm/ui/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.hnucm.ui;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.hnucm.ui", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/ui/src/main/AndroidManifest.xml b/ui/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b28ec83
--- /dev/null
+++ b/ui/src/main/AndroidManifest.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/src/main/java/com/hnucm/ui/MainActivity.java b/ui/src/main/java/com/hnucm/ui/MainActivity.java
new file mode 100644
index 0000000..0213d85
--- /dev/null
+++ b/ui/src/main/java/com/hnucm/ui/MainActivity.java
@@ -0,0 +1,34 @@
+package com.hnucm.ui;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+public class MainActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ TextView textView = findViewById(R.id.textView10);
+ EditText editText = findViewById(R.id.editTextText);
+ EditText editText2 = findViewById(R.id.editTextText2);
+ textView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+// todo 获取用户名和密码
+ String username = editText.getText().toString();
+ String password = editText2.getText().toString();
+ if (username.equals("admin") && password.equals("123456")){
+ Toast.makeText(MainActivity.this,"登录成功" , Toast.LENGTH_LONG).show();
+ }else{
+ Toast.makeText(MainActivity.this,"登录失败" , Toast.LENGTH_LONG).show();
+ }
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/ui/src/main/res/drawable/ic_launcher_background.xml b/ui/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/ui/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ui/src/main/res/drawable/ic_launcher_foreground.xml b/ui/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/ui/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/src/main/res/drawable/icon1.png b/ui/src/main/res/drawable/icon1.png
new file mode 100644
index 0000000..2c52fea
Binary files /dev/null and b/ui/src/main/res/drawable/icon1.png differ
diff --git a/ui/src/main/res/drawable/icon2.png b/ui/src/main/res/drawable/icon2.png
new file mode 100644
index 0000000..da12e57
Binary files /dev/null and b/ui/src/main/res/drawable/icon2.png differ
diff --git a/ui/src/main/res/layout/activity_main.xml b/ui/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..cba58db
--- /dev/null
+++ b/ui/src/main/res/layout/activity_main.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/ui/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/ui/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/ui/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/ui/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/src/main/res/mipmap-hdpi/ic_launcher.webp b/ui/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/ui/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/ui/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/ui/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/ui/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/ui/src/main/res/mipmap-mdpi/ic_launcher.webp b/ui/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/ui/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/ui/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/ui/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/ui/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/ui/src/main/res/mipmap-xhdpi/ic_launcher.webp b/ui/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/ui/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/ui/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/ui/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/ui/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/ui/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/ui/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/ui/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/ui/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/ui/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/ui/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/ui/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/ui/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/ui/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/ui/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/ui/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/ui/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/ui/src/main/res/values-night/themes.xml b/ui/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..d25b0f2
--- /dev/null
+++ b/ui/src/main/res/values-night/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/ui/src/main/res/values/colors.xml b/ui/src/main/res/values/colors.xml
new file mode 100644
index 0000000..c8524cd
--- /dev/null
+++ b/ui/src/main/res/values/colors.xml
@@ -0,0 +1,5 @@
+
+
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/ui/src/main/res/values/strings.xml b/ui/src/main/res/values/strings.xml
new file mode 100644
index 0000000..197626a
--- /dev/null
+++ b/ui/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ UI
+
\ No newline at end of file
diff --git a/ui/src/main/res/values/themes.xml b/ui/src/main/res/values/themes.xml
new file mode 100644
index 0000000..d66ac09
--- /dev/null
+++ b/ui/src/main/res/values/themes.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/src/test/java/com/hnucm/ui/ExampleUnitTest.java b/ui/src/test/java/com/hnucm/ui/ExampleUnitTest.java
new file mode 100644
index 0000000..59abcde
--- /dev/null
+++ b/ui/src/test/java/com/hnucm/ui/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.hnucm.ui;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/ui2/.gitignore b/ui2/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/ui2/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/ui2/build.gradle.kts b/ui2/build.gradle.kts
new file mode 100644
index 0000000..58e818c
--- /dev/null
+++ b/ui2/build.gradle.kts
@@ -0,0 +1,39 @@
+plugins {
+ id("com.android.application")
+}
+
+android {
+ namespace = "com.hnucm.ui2"
+ compileSdk = 34
+
+ defaultConfig {
+ applicationId = "com.hnucm.ui2"
+ minSdk = 24
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation("androidx.appcompat:appcompat:1.6.1")
+ implementation("com.google.android.material:material:1.9.0")
+ implementation("androidx.constraintlayout:constraintlayout:2.1.4")
+ testImplementation("junit:junit:4.13.2")
+ androidTestImplementation("androidx.test.ext:junit:1.1.5")
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
+}
\ No newline at end of file
diff --git a/ui2/proguard-rules.pro b/ui2/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/ui2/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/ui2/src/androidTest/java/com/hnucm/ui2/ExampleInstrumentedTest.java b/ui2/src/androidTest/java/com/hnucm/ui2/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..8911e8c
--- /dev/null
+++ b/ui2/src/androidTest/java/com/hnucm/ui2/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.hnucm.ui2;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.hnucm.ui2", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/ui2/src/main/AndroidManifest.xml b/ui2/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..79ee6d0
--- /dev/null
+++ b/ui2/src/main/AndroidManifest.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui2/src/main/java/com/hnucm/ui2/MainActivity.java b/ui2/src/main/java/com/hnucm/ui2/MainActivity.java
new file mode 100644
index 0000000..134ca10
--- /dev/null
+++ b/ui2/src/main/java/com/hnucm/ui2/MainActivity.java
@@ -0,0 +1,14 @@
+package com.hnucm.ui2;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+
+public class MainActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ }
+}
\ No newline at end of file
diff --git a/ui2/src/main/java/com/hnucm/ui2/MainActivity2.java b/ui2/src/main/java/com/hnucm/ui2/MainActivity2.java
new file mode 100644
index 0000000..0b8bdb8
--- /dev/null
+++ b/ui2/src/main/java/com/hnucm/ui2/MainActivity2.java
@@ -0,0 +1,25 @@
+package com.hnucm.ui2;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.constraintlayout.widget.ConstraintLayout;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+
+public class MainActivity2 extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main2);
+ ConstraintLayout constraintLayout = findViewById(R.id.constraintLayout8);
+ constraintLayout.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent(MainActivity2.this, MyActivity.class);
+ startActivity(intent);
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/ui2/src/main/java/com/hnucm/ui2/MyActivity.java b/ui2/src/main/java/com/hnucm/ui2/MyActivity.java
new file mode 100644
index 0000000..334fa43
--- /dev/null
+++ b/ui2/src/main/java/com/hnucm/ui2/MyActivity.java
@@ -0,0 +1,14 @@
+package com.hnucm.ui2;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+
+public class MyActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_my);
+ }
+}
\ No newline at end of file
diff --git a/ui2/src/main/res/drawable/ic_launcher_background.xml b/ui2/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/ui2/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ui2/src/main/res/drawable/ic_launcher_foreground.xml b/ui2/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/ui2/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui2/src/main/res/drawable/icon.png b/ui2/src/main/res/drawable/icon.png
new file mode 100644
index 0000000..8288aa7
Binary files /dev/null and b/ui2/src/main/res/drawable/icon.png differ
diff --git a/ui2/src/main/res/layout/activity_main.xml b/ui2/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..95b6f92
--- /dev/null
+++ b/ui2/src/main/res/layout/activity_main.xml
@@ -0,0 +1,246 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui2/src/main/res/layout/activity_main2.xml b/ui2/src/main/res/layout/activity_main2.xml
new file mode 100644
index 0000000..17b7e06
--- /dev/null
+++ b/ui2/src/main/res/layout/activity_main2.xml
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui2/src/main/res/layout/activity_my.xml b/ui2/src/main/res/layout/activity_my.xml
new file mode 100644
index 0000000..1f5b911
--- /dev/null
+++ b/ui2/src/main/res/layout/activity_my.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/ui2/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/ui2/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/ui2/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui2/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/ui2/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/ui2/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui2/src/main/res/mipmap-hdpi/ic_launcher.webp b/ui2/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/ui2/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/ui2/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/ui2/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/ui2/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/ui2/src/main/res/mipmap-mdpi/ic_launcher.webp b/ui2/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/ui2/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/ui2/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/ui2/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/ui2/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/ui2/src/main/res/mipmap-xhdpi/ic_launcher.webp b/ui2/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/ui2/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/ui2/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/ui2/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/ui2/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/ui2/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/ui2/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/ui2/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/ui2/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/ui2/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/ui2/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/ui2/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/ui2/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/ui2/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/ui2/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/ui2/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/ui2/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/ui2/src/main/res/values-night/themes.xml b/ui2/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..d25b0f2
--- /dev/null
+++ b/ui2/src/main/res/values-night/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/ui2/src/main/res/values/colors.xml b/ui2/src/main/res/values/colors.xml
new file mode 100644
index 0000000..c8524cd
--- /dev/null
+++ b/ui2/src/main/res/values/colors.xml
@@ -0,0 +1,5 @@
+
+
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/ui2/src/main/res/values/strings.xml b/ui2/src/main/res/values/strings.xml
new file mode 100644
index 0000000..3c2b6d2
--- /dev/null
+++ b/ui2/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ UI2
+
\ No newline at end of file
diff --git a/ui2/src/main/res/values/themes.xml b/ui2/src/main/res/values/themes.xml
new file mode 100644
index 0000000..d66ac09
--- /dev/null
+++ b/ui2/src/main/res/values/themes.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui2/src/test/java/com/hnucm/ui2/ExampleUnitTest.java b/ui2/src/test/java/com/hnucm/ui2/ExampleUnitTest.java
new file mode 100644
index 0000000..5576ba3
--- /dev/null
+++ b/ui2/src/test/java/com/hnucm/ui2/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.hnucm.ui2;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/webview/.gitignore b/webview/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/webview/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/webview/build.gradle.kts b/webview/build.gradle.kts
new file mode 100644
index 0000000..cfd541f
--- /dev/null
+++ b/webview/build.gradle.kts
@@ -0,0 +1,41 @@
+plugins {
+ id("com.android.application")
+}
+
+android {
+ namespace = "com.hnucm.webview"
+ compileSdk = 34
+
+ defaultConfig {
+ applicationId = "com.hnucm.webview"
+ minSdk = 24
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation("androidx.appcompat:appcompat:1.6.1")
+ implementation("com.google.android.material:material:1.9.0")
+ implementation("androidx.constraintlayout:constraintlayout:2.1.4")
+ testImplementation("junit:junit:4.13.2")
+ androidTestImplementation("androidx.test.ext:junit:1.1.5")
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
+ implementation ("com.geyifeng.immersionbar:immersionbar:3.2.2")
+ implementation ("com.geyifeng.immersionbar:immersionbar-components:3.2.2")
+}
\ No newline at end of file
diff --git a/webview/proguard-rules.pro b/webview/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/webview/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/webview/src/androidTest/java/com/hnucm/webview/ExampleInstrumentedTest.java b/webview/src/androidTest/java/com/hnucm/webview/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..3b64852
--- /dev/null
+++ b/webview/src/androidTest/java/com/hnucm/webview/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.hnucm.webview;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.hnucm.webview", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/webview/src/main/AndroidManifest.xml b/webview/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b9f0fb6
--- /dev/null
+++ b/webview/src/main/AndroidManifest.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/webview/src/main/assets/test.html b/webview/src/main/assets/test.html
new file mode 100644
index 0000000..23056f0
--- /dev/null
+++ b/webview/src/main/assets/test.html
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+ Document
+
+
+
+ 湖南中医药大学
+ 计算机科学与技术2班
+
+
+ 跳转
+
+
+
\ No newline at end of file
diff --git a/webview/src/main/assets/test1.html b/webview/src/main/assets/test1.html
new file mode 100644
index 0000000..ad95597
--- /dev/null
+++ b/webview/src/main/assets/test1.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ Document
+
+
+
+跳转页面
+
+
\ No newline at end of file
diff --git a/webview/src/main/java/com/hnucm/webview/LoginActivity.java b/webview/src/main/java/com/hnucm/webview/LoginActivity.java
new file mode 100644
index 0000000..5197d6f
--- /dev/null
+++ b/webview/src/main/java/com/hnucm/webview/LoginActivity.java
@@ -0,0 +1,31 @@
+package com.hnucm.webview;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.view.View;
+
+public class LoginActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_login);
+ findViewById(R.id.button4).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ // TODO 判断用户名和密码正确 保持登录状态
+ SharedPreferences sharedPreferences = getSharedPreferences("user",MODE_PRIVATE);
+ SharedPreferences.Editor editor = sharedPreferences.edit();
+ editor.putBoolean("isLogin",true);
+ editor.commit();
+
+ Intent intent = new Intent(LoginActivity.this, MainActivity.class);
+ startActivity(intent);
+ finish();
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/webview/src/main/java/com/hnucm/webview/MainActivity.java b/webview/src/main/java/com/hnucm/webview/MainActivity.java
new file mode 100644
index 0000000..351bb13
--- /dev/null
+++ b/webview/src/main/java/com/hnucm/webview/MainActivity.java
@@ -0,0 +1,84 @@
+package com.hnucm.webview;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.view.View;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+
+import com.gyf.immersionbar.ImmersionBar;
+
+public class MainActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ ImmersionBar.with(this).init();
+ findViewById(R.id.textView).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ //退出登录 跳转登录页面 + sp值清空
+// 数据库
+ //清除数据
+ SharedPreferences sharedPreferences = getSharedPreferences("user",MODE_PRIVATE);
+ SharedPreferences.Editor editor = sharedPreferences.edit();
+ editor.clear();
+ editor.commit();
+
+ Intent intent = new Intent(MainActivity.this, LoginActivity.class);
+ startActivity(intent);
+ finish();
+ }
+ });
+
+
+ //添加网络请求权限
+ WebView webView = findViewById(R.id.webview);
+ webView.loadUrl("file:///android_asset/test.html");
+ // uniapp Fluter -> 网页端 iOS ->Compose
+
+
+// html
+ webView.setWebViewClient(new WebViewClient(){
+ @Override
+ public boolean shouldOverrideUrlLoading(WebView view, String url) {
+ view.loadUrl(url);
+ return true;
+ }
+ });
+
+ WebSettings webSettings = webView.getSettings();
+//如果访问的页面中要与Javascript交互,则webview必须设置支持Javascript
+ webSettings.setJavaScriptEnabled(true);
+
+//设置自适应屏幕,两者合用
+ webSettings.setUseWideViewPort(true); //将图片调整到适合webview的大小
+ webSettings.setLoadWithOverviewMode(true); // 缩放至屏幕的大小
+//自适应屏幕
+ webView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
+ webSettings.setLoadWithOverviewMode(true); // 缩放至屏幕的大小
+
+//缩放操作
+ webSettings.setSupportZoom(true); //支持缩放,默认为true。是下面那个的前提。
+ webSettings.setBuiltInZoomControls(true); //设置内置的缩放控件。若为false,则该WebView不可缩放
+ webSettings.setDisplayZoomControls(false); //隐藏原生的缩放控件
+
+//其他细节操作
+ webSettings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK); //关闭webview中缓存
+ webSettings.setAllowFileAccess(true); //设置可以访问文件
+ webSettings.setJavaScriptCanOpenWindowsAutomatically(true); //支持通过JS打开新窗口
+ webSettings.setLoadsImagesAutomatically(true); //支持自动加载图片
+ webSettings.setDefaultTextEncodingName("utf-8");//设置编码格式
+
+//优先使用缓存
+ webSettings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
+//缓存模式
+ webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
+
+ }
+}
\ No newline at end of file
diff --git a/webview/src/main/java/com/hnucm/webview/SpActivity.java b/webview/src/main/java/com/hnucm/webview/SpActivity.java
new file mode 100644
index 0000000..060f1f8
--- /dev/null
+++ b/webview/src/main/java/com/hnucm/webview/SpActivity.java
@@ -0,0 +1,47 @@
+package com.hnucm.webview;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+
+public class SpActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_sp);
+ findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ //增加数据 data/data/com.hnucm.webview
+ SharedPreferences sharedPreferences = getSharedPreferences("user",MODE_PRIVATE);
+ SharedPreferences.Editor editor = sharedPreferences.edit();
+ editor.putString("name","湖南中医药大学");
+ editor.putInt("age",20);
+ editor.commit();
+ }
+ });
+ findViewById(R.id.button2).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ //读取数据
+ SharedPreferences sharedPreferences = getSharedPreferences("user",MODE_PRIVATE);
+ String name = sharedPreferences.getString("name","");
+ Log.i("test",name);
+ }
+ });
+ findViewById(R.id.button3).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ //清除数据
+ SharedPreferences sharedPreferences = getSharedPreferences("user",MODE_PRIVATE);
+ SharedPreferences.Editor editor = sharedPreferences.edit();
+ editor.clear();
+ editor.commit();
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/webview/src/main/java/com/hnucm/webview/WelcomeActivity.java b/webview/src/main/java/com/hnucm/webview/WelcomeActivity.java
new file mode 100644
index 0000000..ac4001b
--- /dev/null
+++ b/webview/src/main/java/com/hnucm/webview/WelcomeActivity.java
@@ -0,0 +1,49 @@
+package com.hnucm.webview;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.util.Log;
+
+public class WelcomeActivity extends AppCompatActivity {
+
+// onCreate方法执行完才能够看到界面
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_welcome);
+ Log.i("test","test1");
+ // 开启子线程
+ Thread thread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ //子线程
+ Log.i("test","test2");
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ SharedPreferences sharedPreferences = getSharedPreferences("user",MODE_PRIVATE);
+ boolean islogin = sharedPreferences.getBoolean("isLogin",false);
+ if (islogin){
+ Intent intent = new Intent(WelcomeActivity.this, MainActivity.class);
+ startActivity(intent);
+ finish();
+ }else {
+ Intent intent = new Intent(WelcomeActivity.this, LoginActivity.class);
+ startActivity(intent);
+ finish();
+ }
+ }
+ });
+ thread.start();
+ Log.i("test","test3");
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/webview/src/main/res/drawable/ic_launcher_background.xml b/webview/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/webview/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/webview/src/main/res/drawable/ic_launcher_foreground.xml b/webview/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/webview/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/webview/src/main/res/drawable/test.png b/webview/src/main/res/drawable/test.png
new file mode 100644
index 0000000..358aa44
Binary files /dev/null and b/webview/src/main/res/drawable/test.png differ
diff --git a/webview/src/main/res/drawable/welcome.png b/webview/src/main/res/drawable/welcome.png
new file mode 100644
index 0000000..d629d45
Binary files /dev/null and b/webview/src/main/res/drawable/welcome.png differ
diff --git a/webview/src/main/res/layout/activity_login.xml b/webview/src/main/res/layout/activity_login.xml
new file mode 100644
index 0000000..fca59f8
--- /dev/null
+++ b/webview/src/main/res/layout/activity_login.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/webview/src/main/res/layout/activity_main.xml b/webview/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..3dfc8e4
--- /dev/null
+++ b/webview/src/main/res/layout/activity_main.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/webview/src/main/res/layout/activity_sp.xml b/webview/src/main/res/layout/activity_sp.xml
new file mode 100644
index 0000000..90461dc
--- /dev/null
+++ b/webview/src/main/res/layout/activity_sp.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/webview/src/main/res/layout/activity_welcome.xml b/webview/src/main/res/layout/activity_welcome.xml
new file mode 100644
index 0000000..2b298c7
--- /dev/null
+++ b/webview/src/main/res/layout/activity_welcome.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/webview/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/webview/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/webview/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/webview/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/webview/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/webview/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/webview/src/main/res/mipmap-hdpi/ic_launcher.webp b/webview/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/webview/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/webview/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/webview/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/webview/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/webview/src/main/res/mipmap-mdpi/ic_launcher.webp b/webview/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/webview/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/webview/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/webview/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/webview/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/webview/src/main/res/mipmap-xhdpi/ic_launcher.webp b/webview/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/webview/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/webview/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/webview/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/webview/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/webview/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/webview/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/webview/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/webview/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/webview/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/webview/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/webview/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/webview/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/webview/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/webview/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/webview/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/webview/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/webview/src/main/res/values-night/themes.xml b/webview/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..d25b0f2
--- /dev/null
+++ b/webview/src/main/res/values-night/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/webview/src/main/res/values/colors.xml b/webview/src/main/res/values/colors.xml
new file mode 100644
index 0000000..c8524cd
--- /dev/null
+++ b/webview/src/main/res/values/colors.xml
@@ -0,0 +1,5 @@
+
+
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/webview/src/main/res/values/strings.xml b/webview/src/main/res/values/strings.xml
new file mode 100644
index 0000000..7667838
--- /dev/null
+++ b/webview/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ webview
+
\ No newline at end of file
diff --git a/webview/src/main/res/values/themes.xml b/webview/src/main/res/values/themes.xml
new file mode 100644
index 0000000..d66ac09
--- /dev/null
+++ b/webview/src/main/res/values/themes.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/webview/src/test/java/com/hnucm/webview/ExampleUnitTest.java b/webview/src/test/java/com/hnucm/webview/ExampleUnitTest.java
new file mode 100644
index 0000000..f7ac420
--- /dev/null
+++ b/webview/src/test/java/com/hnucm/webview/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.hnucm.webview;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file