miss 2 tháng trước cách đây
mục cha
commit
c87f133fbc
69 tập tin đã thay đổi với 2290 bổ sung0 xóa
  1. 15 0
      ai/.gitignore
  2. 3 0
      ai/.idea/.gitignore
  3. 6 0
      ai/.idea/AndroidProjectSystem.xml
  4. 6 0
      ai/.idea/appInsightsSettings.xml
  5. 6 0
      ai/.idea/compiler.xml
  6. 30 0
      ai/.idea/deploymentTargetSelector.xml
  7. 13 0
      ai/.idea/deviceManager.xml
  8. 19 0
      ai/.idea/gradle.xml
  9. 10 0
      ai/.idea/migrations.xml
  10. 9 0
      ai/.idea/misc.xml
  11. 17 0
      ai/.idea/runConfigurations.xml
  12. 1 0
      ai/app/.gitignore
  13. 41 0
      ai/app/build.gradle
  14. 21 0
      ai/app/proguard-rules.pro
  15. 26 0
      ai/app/src/androidTest/java/com/example/ai/ExampleInstrumentedTest.java
  16. 33 0
      ai/app/src/main/AndroidManifest.xml
  17. 65 0
      ai/app/src/main/java/com/example/ai/ChatAdapter.java
  18. 18 0
      ai/app/src/main/java/com/example/ai/ChatMessage.java
  19. 61 0
      ai/app/src/main/java/com/example/ai/DBHelper.java
  20. 17 0
      ai/app/src/main/java/com/example/ai/GoalActivity.java
  21. 17 0
      ai/app/src/main/java/com/example/ai/HistoryActivity.java
  22. 239 0
      ai/app/src/main/java/com/example/ai/HomeActivity.java
  23. 77 0
      ai/app/src/main/java/com/example/ai/MainActivity.java
  24. 66 0
      ai/app/src/main/java/com/example/ai/ProfileActivity.java
  25. 6 0
      ai/app/src/main/res/drawable/bg_avatar_circle.xml
  26. 5 0
      ai/app/src/main/res/drawable/bg_btn_apple.xml
  27. 5 0
      ai/app/src/main/res/drawable/bg_btn_circle.xml
  28. 6 0
      ai/app/src/main/res/drawable/bg_edit_apple.xml
  29. 10 0
      ai/app/src/main/res/drawable/ic_camera.xml
  30. 170 0
      ai/app/src/main/res/drawable/ic_launcher_background.xml
  31. 30 0
      ai/app/src/main/res/drawable/ic_launcher_foreground.xml
  32. 19 0
      ai/app/src/main/res/layout/activity_goal.xml
  33. 19 0
      ai/app/src/main/res/layout/activity_history.xml
  34. 122 0
      ai/app/src/main/res/layout/activity_home.xml
  35. 86 0
      ai/app/src/main/res/layout/activity_main.xml
  36. 381 0
      ai/app/src/main/res/layout/activity_profile.xml
  37. 24 0
      ai/app/src/main/res/layout/item_chat_ai.xml
  38. 23 0
      ai/app/src/main/res/layout/item_chat_user.xml
  39. 50 0
      ai/app/src/main/res/layout/item_profile_achievement_card.xml
  40. 33 0
      ai/app/src/main/res/layout/item_profile_setting_switch.xml
  41. 34 0
      ai/app/src/main/res/layout/item_profile_stat_card.xml
  42. 13 0
      ai/app/src/main/res/menu/profile_toolbar_menu.xml
  43. 6 0
      ai/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  44. 6 0
      ai/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  45. BIN
      ai/app/src/main/res/mipmap-hdpi/ic_launcher.webp
  46. BIN
      ai/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
  47. BIN
      ai/app/src/main/res/mipmap-mdpi/ic_launcher.webp
  48. BIN
      ai/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
  49. BIN
      ai/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
  50. BIN
      ai/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
  51. BIN
      ai/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
  52. BIN
      ai/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
  53. BIN
      ai/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
  54. BIN
      ai/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
  55. 7 0
      ai/app/src/main/res/values-night/themes.xml
  56. 8 0
      ai/app/src/main/res/values/colors.xml
  57. 3 0
      ai/app/src/main/res/values/strings.xml
  58. 9 0
      ai/app/src/main/res/values/themes.xml
  59. 13 0
      ai/app/src/main/res/xml/backup_rules.xml
  60. 19 0
      ai/app/src/main/res/xml/data_extraction_rules.xml
  61. 17 0
      ai/app/src/test/java/com/example/ai/ExampleUnitTest.java
  62. 4 0
      ai/build.gradle
  63. 21 0
      ai/gradle.properties
  64. 22 0
      ai/gradle/libs.versions.toml
  65. BIN
      ai/gradle/wrapper/gradle-wrapper.jar
  66. 6 0
      ai/gradle/wrapper/gradle-wrapper.properties
  67. 185 0
      ai/gradlew
  68. 89 0
      ai/gradlew.bat
  69. 23 0
      ai/settings.gradle

+ 15 - 0
ai/.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

+ 3 - 0
ai/.idea/.gitignore

@@ -0,0 +1,3 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml

+ 6 - 0
ai/.idea/AndroidProjectSystem.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="AndroidProjectSystem">
+    <option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
+  </component>
+</project>

+ 6 - 0
ai/.idea/appInsightsSettings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="AppInsightsSettings">
+    <option name="selectedTabId" value="Android Vitals" />
+  </component>
+</project>

+ 6 - 0
ai/.idea/compiler.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <bytecodeTargetLevel target="21" />
+  </component>
+</project>

+ 30 - 0
ai/.idea/deploymentTargetSelector.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="deploymentTargetSelector">
+    <selectionStates>
+      <SelectionState runConfigName="app">
+        <option name="selectionMode" value="DROPDOWN" />
+      </SelectionState>
+      <SelectionState runConfigName="MainActivity">
+        <option name="selectionMode" value="DROPDOWN" />
+      </SelectionState>
+      <SelectionState runConfigName="MainActivity (1)">
+        <option name="selectionMode" value="DROPDOWN" />
+      </SelectionState>
+      <SelectionState runConfigName="MainActivity (2)">
+        <option name="selectionMode" value="DROPDOWN" />
+        <DropdownSelection timestamp="2025-07-18T08:17:13.721617500Z">
+          <Target type="DEFAULT_BOOT">
+            <handle>
+              <DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\Y\.android\avd\Pixel_4.avd" />
+            </handle>
+          </Target>
+        </DropdownSelection>
+        <DialogSelection />
+      </SelectionState>
+      <SelectionState runConfigName="MainActivity (3)">
+        <option name="selectionMode" value="DROPDOWN" />
+      </SelectionState>
+    </selectionStates>
+  </component>
+</project>

+ 13 - 0
ai/.idea/deviceManager.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="DeviceTable">
+    <option name="columnSorters">
+      <list>
+        <ColumnSorterState>
+          <option name="column" value="Name" />
+          <option name="order" value="ASCENDING" />
+        </ColumnSorterState>
+      </list>
+    </option>
+  </component>
+</project>

+ 19 - 0
ai/.idea/gradle.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="GradleMigrationSettings" migrationVersion="1" />
+  <component name="GradleSettings">
+    <option name="linkedExternalProjectsSettings">
+      <GradleProjectSettings>
+        <option name="testRunner" value="CHOOSE_PER_TEST" />
+        <option name="externalProjectPath" value="$PROJECT_DIR$" />
+        <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
+        <option name="modules">
+          <set>
+            <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/app" />
+          </set>
+        </option>
+      </GradleProjectSettings>
+    </option>
+  </component>
+</project>

+ 10 - 0
ai/.idea/migrations.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectMigrations">
+    <option name="MigrateToGradleLocalJavaHome">
+      <set>
+        <option value="$PROJECT_DIR$" />
+      </set>
+    </option>
+  </component>
+</project>

+ 9 - 0
ai/.idea/misc.xml

@@ -0,0 +1,9 @@
+<project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/build/classes" />
+  </component>
+  <component name="ProjectType">
+    <option name="id" value="Android" />
+  </component>
+</project>

+ 17 - 0
ai/.idea/runConfigurations.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RunConfigurationProducerService">
+    <option name="ignoredProducers">
+      <set>
+        <option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
+        <option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
+        <option value="com.intellij.execution.junit.PatternConfigurationProducer" />
+        <option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
+        <option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
+        <option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
+        <option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
+        <option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
+      </set>
+    </option>
+  </component>
+</project>

+ 1 - 0
ai/app/.gitignore

@@ -0,0 +1 @@
+/build

+ 41 - 0
ai/app/build.gradle

@@ -0,0 +1,41 @@
+plugins {
+    alias(libs.plugins.android.application)
+}
+
+android {
+    namespace 'com.example.ai'
+    compileSdk 36
+
+    defaultConfig {
+        applicationId "com.example.ai"
+        minSdk 24
+        targetSdk 36
+        versionCode 1
+        versionName "1.0"
+
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+    }
+
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+    }
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_11
+        targetCompatibility JavaVersion.VERSION_11
+    }
+}
+
+dependencies {
+
+    implementation libs.appcompat
+    implementation libs.material
+    implementation libs.activity
+    implementation libs.constraintlayout
+    testImplementation libs.junit
+    androidTestImplementation libs.ext.junit
+    androidTestImplementation libs.espresso.core
+    implementation 'com.squareup.okhttp3:okhttp:4.9.3'
+}

+ 21 - 0
ai/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

+ 26 - 0
ai/app/src/androidTest/java/com/example/ai/ExampleInstrumentedTest.java

@@ -0,0 +1,26 @@
+package com.example.ai;
+
+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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+    @Test
+    public void useAppContext() {
+        // Context of the app under test.
+        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+        assertEquals("com.example.ai", appContext.getPackageName());
+    }
+}

+ 33 - 0
ai/app/src/main/AndroidManifest.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools">
+
+    <!-- 添加网络权限 -->
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+
+    <application
+        android:allowBackup="true"
+        android:dataExtractionRules="@xml/data_extraction_rules"
+        android:fullBackupContent="@xml/backup_rules"
+        android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name"
+        android:roundIcon="@mipmap/ic_launcher_round"
+        android:supportsRtl="true"
+        android:theme="@style/Theme.Ai">
+        <activity
+            android:name=".MainActivity"
+            android:exported="true">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        <activity android:name=".HomeActivity" />
+        <activity android:name=".GoalActivity" />
+        <activity android:name=".HistoryActivity" />
+        <activity android:name=".ProfileActivity" />
+    </application>
+
+</manifest>

+ 65 - 0
ai/app/src/main/java/com/example/ai/ChatAdapter.java

@@ -0,0 +1,65 @@
+package com.example.ai;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+import java.util.List;
+
+public class ChatAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
+    private List<ChatMessage> messages;
+    public ChatAdapter(List<ChatMessage> messages) { this.messages = messages; }
+    @Override
+    public int getItemViewType(int position) {
+        return messages.get(position).getType();
+    }
+    @NonNull
+    @Override
+    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        if (viewType == ChatMessage.TYPE_USER) {
+            View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_chat_user, parent, false);
+            return new UserViewHolder(view);
+        } else {
+            View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_chat_ai, parent, false);
+            return new AIViewHolder(view);
+        }
+    }
+    @Override
+    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+        ChatMessage msg = messages.get(position);
+        if (holder instanceof UserViewHolder) {
+            ((UserViewHolder) holder).tvContent.setText(msg.getContent());
+        } else if (holder instanceof AIViewHolder) {
+            ((AIViewHolder) holder).tvContent.setText(msg.getContent());
+        }
+    }
+    @Override
+    public int getItemCount() { return messages.size(); }
+    public void addMessage(ChatMessage msg) {
+        try {
+            if (msg == null) {
+                return;
+            }
+            messages.add(msg);
+            notifyItemInserted(messages.size() - 1);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    static class UserViewHolder extends RecyclerView.ViewHolder {
+        TextView tvContent;
+        UserViewHolder(View itemView) {
+            super(itemView);
+            tvContent = itemView.findViewById(R.id.tvUserContent);
+        }
+    }
+    static class AIViewHolder extends RecyclerView.ViewHolder {
+        TextView tvContent;
+        AIViewHolder(View itemView) {
+            super(itemView);
+            tvContent = itemView.findViewById(R.id.tvAIContent);
+        }
+    }
+} 

+ 18 - 0
ai/app/src/main/java/com/example/ai/ChatMessage.java

@@ -0,0 +1,18 @@
+package com.example.ai;
+
+public class ChatMessage {
+    public static final int TYPE_USER = 0;
+    public static final int TYPE_AI = 1;
+    private String content;
+    private int type;
+    private long timestamp;
+
+    public ChatMessage(String content, int type, long timestamp) {
+        this.content = content;
+        this.type = type;
+        this.timestamp = timestamp;
+    }
+    public String getContent() { return content; }
+    public int getType() { return type; }
+    public long getTimestamp() { return timestamp; }
+} 

+ 61 - 0
ai/app/src/main/java/com/example/ai/DBHelper.java

@@ -0,0 +1,61 @@
+package com.example.ai;
+
+import android.content.Context;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.content.ContentValues;
+
+public class DBHelper extends SQLiteOpenHelper {
+    public static final String DB_NAME = "ai_study.db";
+    public static final int DB_VERSION = 2;
+    public static final String TABLE_USER = "user";
+
+    public DBHelper(Context context) {
+        super(context, DB_NAME, null, DB_VERSION);
+    }
+
+    @Override
+    public void onCreate(SQLiteDatabase db) {
+        db.execSQL("CREATE TABLE IF NOT EXISTS " + TABLE_USER + " (id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT UNIQUE, password TEXT)");
+        // 聊天记录表
+        db.execSQL("CREATE TABLE IF NOT EXISTS chat_history (id INTEGER PRIMARY KEY AUTOINCREMENT, user_id INTEGER, content TEXT, type INTEGER, timestamp LONG, FOREIGN KEY(user_id) REFERENCES user(id))");
+        // 插入一个测试账号 test/123456
+        ContentValues values = new ContentValues();
+        values.put("username", "test");
+        values.put("password", "123456");
+        db.insert(TABLE_USER, null, values);
+    }
+
+    @Override
+    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+        db.execSQL("DROP TABLE IF EXISTS " + TABLE_USER);
+        db.execSQL("DROP TABLE IF EXISTS chat_history");
+        onCreate(db);
+    }
+
+    // 保存聊天消息
+    public void saveChatMessage(int userId, String content, int type, long timestamp) {
+        SQLiteDatabase db = getWritableDatabase();
+        ContentValues values = new ContentValues();
+        values.put("user_id", userId);
+        values.put("content", content);
+        values.put("type", type);
+        values.put("timestamp", timestamp);
+        db.insert("chat_history", null, values);
+    }
+
+    // 读取聊天历史
+    public java.util.List<ChatMessage> getChatHistory(int userId) {
+        java.util.List<ChatMessage> list = new java.util.ArrayList<>();
+        SQLiteDatabase db = getReadableDatabase();
+        android.database.Cursor cursor = db.query("chat_history", null, "user_id=?", new String[]{String.valueOf(userId)}, null, null, "timestamp ASC");
+        while (cursor.moveToNext()) {
+            String content = cursor.getString(cursor.getColumnIndex("content"));
+            int type = cursor.getInt(cursor.getColumnIndex("type"));
+            long timestamp = cursor.getLong(cursor.getColumnIndex("timestamp"));
+            list.add(new ChatMessage(content, type, timestamp));
+        }
+        cursor.close();
+        return list;
+    }
+} 

+ 17 - 0
ai/app/src/main/java/com/example/ai/GoalActivity.java

@@ -0,0 +1,17 @@
+package com.example.ai;
+
+import android.os.Bundle;
+import android.widget.TextView;
+import androidx.appcompat.app.AppCompatActivity;
+
+public class GoalActivity extends AppCompatActivity {
+    
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_goal);
+        
+        // 设置标题
+        setTitle("学习目标");
+    }
+} 

+ 17 - 0
ai/app/src/main/java/com/example/ai/HistoryActivity.java

@@ -0,0 +1,17 @@
+package com.example.ai;
+
+import android.os.Bundle;
+import android.widget.TextView;
+import androidx.appcompat.app.AppCompatActivity;
+
+public class HistoryActivity extends AppCompatActivity {
+    
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_history);
+        
+        // 设置标题
+        setTitle("学习历史");
+    }
+} 

+ 239 - 0
ai/app/src/main/java/com/example/ai/HomeActivity.java

@@ -0,0 +1,239 @@
+package com.example.ai;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import okhttp3.*;
+
+public class HomeActivity extends AppCompatActivity {
+    private static final String API_KEY = "sk-3b847c46a3f3467d86d5ce871f81ffc4";
+    private static final String API_URL = "https://api.deepseek.com/v1/chat/completions";
+    private RecyclerView rvChat;
+    private EditText etInput;
+    private Button btnSend;
+    private TextView tvHome, tvGoal, tvHistory, tvProfile;
+    private ChatAdapter chatAdapter;
+    private List<ChatMessage> chatList = new ArrayList<>();
+    private OkHttpClient client = new OkHttpClient();
+    private Handler mainHandler = new Handler(Looper.getMainLooper());
+    private int userId = -1;
+    private DBHelper dbHelper;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_home);
+        
+        // 获取user_id
+        userId = getIntent().getIntExtra("user_id", -1);
+        if (userId == -1) {
+            userId = getSharedPreferences("login_prefs", MODE_PRIVATE).getInt("current_user_id", -1);
+        }
+        if (userId == -1) {
+            Toast.makeText(this, "用户信息异常,请重新登录", Toast.LENGTH_LONG).show();
+            finish();
+            return;
+        }
+        dbHelper = new DBHelper(this);
+        
+        // 加载聊天历史
+        if (userId != -1) {
+            chatList.addAll(dbHelper.getChatHistory(userId));
+        }
+        
+        // 初始化聊天相关控件
+        rvChat = findViewById(R.id.rvChat);
+        etInput = findViewById(R.id.etInput);
+        btnSend = findViewById(R.id.btnSend);
+        
+        // 初始化底部导航栏
+        tvHome = findViewById(R.id.tvHome);
+        tvGoal = findViewById(R.id.tvGoal);
+        tvHistory = findViewById(R.id.tvHistory);
+        tvProfile = findViewById(R.id.tvProfile);
+        
+        // 设置聊天功能
+        chatAdapter = new ChatAdapter(chatList);
+        rvChat.setLayoutManager(new LinearLayoutManager(this));
+        rvChat.setAdapter(chatAdapter);
+
+        btnSend.setOnClickListener(v -> {
+            String userMsg = etInput.getText().toString().trim();
+            if (TextUtils.isEmpty(userMsg)) {
+                Toast.makeText(this, "请输入消息", Toast.LENGTH_SHORT).show();
+                return;
+            }
+            
+            try {
+                addMessage(userMsg, ChatMessage.TYPE_USER);
+                etInput.setText("");
+                sendToDeepSeek(userMsg);
+            } catch (Exception e) {
+                Log.e("HomeActivity", "发送消息时发生错误", e);
+                Toast.makeText(this, "发送消息失败: " + e.getMessage(), Toast.LENGTH_SHORT).show();
+            }
+        });
+        
+        // 设置底部导航栏点击监听器
+        setupBottomNavigation();
+    }
+    
+    private void setupBottomNavigation() {
+        // 首页 - 当前页面,不需要跳转
+        tvHome.setOnClickListener(v -> {
+            // 已经在首页,可以刷新或重置状态
+            updateNavigationState(tvHome);
+        });
+        
+        // 学习目标
+        tvGoal.setOnClickListener(v -> {
+            Intent intent = new Intent(this, GoalActivity.class);
+            startActivity(intent);
+            updateNavigationState(tvGoal);
+        });
+        
+        // 学习历史
+        tvHistory.setOnClickListener(v -> {
+            Intent intent = new Intent(this, HistoryActivity.class);
+            startActivity(intent);
+            updateNavigationState(tvHistory);
+        });
+        
+        // 个人中心
+        tvProfile.setOnClickListener(v -> {
+            Intent intent = new Intent(this, ProfileActivity.class);
+            // 检查是否已登录,传递登录状态
+            String currentUser = getCurrentLoggedInUser();
+            if (currentUser != null) {
+                intent.putExtra("username", currentUser);
+            }
+            startActivity(intent);
+            updateNavigationState(tvProfile);
+        });
+    }
+    
+    private void updateNavigationState(TextView activeTab) {
+        // 重置所有标签颜色
+        tvHome.setTextColor(getResources().getColor(android.R.color.darker_gray));
+        tvGoal.setTextColor(getResources().getColor(android.R.color.darker_gray));
+        tvHistory.setTextColor(getResources().getColor(android.R.color.darker_gray));
+        tvProfile.setTextColor(getResources().getColor(android.R.color.darker_gray));
+        
+        // 设置当前选中标签颜色
+        activeTab.setTextColor(getResources().getColor(android.R.color.holo_blue_light));
+    }
+
+    private void addMessage(String content, int type) {
+        try {
+            if (content == null || content.isEmpty()) {
+                Log.w("HomeActivity", "尝试添加空消息");
+                return;
+            }
+            
+            if (chatAdapter == null) {
+                Log.e("HomeActivity", "ChatAdapter为空");
+                return;
+            }
+            
+            ChatMessage msg = new ChatMessage(content, type, System.currentTimeMillis());
+            chatAdapter.addMessage(msg);
+            if (userId != -1) {
+                dbHelper.saveChatMessage(userId, content, type, msg.getTimestamp());
+            }
+            
+            if (rvChat != null) {
+                rvChat.scrollToPosition(chatAdapter.getItemCount() - 1);
+            }
+        } catch (Exception e) {
+            Log.e("HomeActivity", "添加消息时发生错误", e);
+            Toast.makeText(this, "添加消息失败: " + e.getMessage(), Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    private void sendToDeepSeek(String userMsg) {
+        try {
+            JSONObject body = new JSONObject();
+            body.put("model", "deepseek-chat");
+            JSONArray messages = new JSONArray();
+            messages.put(new JSONObject().put("role", "user").put("content", userMsg));
+            body.put("messages", messages);
+            
+            Log.d("HomeActivity", "发送请求到DeepSeek: " + body.toString());
+            
+            Request request = new Request.Builder()
+                    .url(API_URL)
+                    .addHeader("Authorization", "Bearer " + API_KEY)
+                    .post(RequestBody.create(body.toString(), MediaType.get("application/json")))
+                    .build();
+                    
+            client.newCall(request).enqueue(new Callback() {
+                @Override
+                public void onFailure(Call call, IOException e) {
+                    Log.e("HomeActivity", "网络请求失败", e);
+                    mainHandler.post(() -> {
+                        addMessage("网络错误,请检查网络连接", ChatMessage.TYPE_AI);
+                        Toast.makeText(HomeActivity.this, "网络请求失败: " + e.getMessage(), Toast.LENGTH_SHORT).show();
+                    });
+                }
+                
+                @Override
+                public void onResponse(Call call, Response response) throws IOException {
+                    String resp = response.body().string();
+                    Log.d("HomeActivity", "收到响应: " + resp);
+                    
+                    try {
+                        if (!response.isSuccessful()) {
+                            mainHandler.post(() -> {
+                                addMessage("服务器错误: " + response.code(), ChatMessage.TYPE_AI);
+                                Toast.makeText(HomeActivity.this, "服务器错误: " + response.code(), Toast.LENGTH_SHORT).show();
+                            });
+                            return;
+                        }
+                        
+                        JSONObject obj = new JSONObject(resp);
+                        JSONArray choices = obj.getJSONArray("choices");
+                        if (choices.length() > 0) {
+                            JSONObject msg = choices.getJSONObject(0).getJSONObject("message");
+                            String aiReply = msg.getString("content");
+                            mainHandler.post(() -> addMessage(aiReply, ChatMessage.TYPE_AI));
+                        } else {
+                            mainHandler.post(() -> addMessage("AI无回复", ChatMessage.TYPE_AI));
+                        }
+                    } catch (Exception e) {
+                        Log.e("HomeActivity", "解析响应失败", e);
+                        mainHandler.post(() -> {
+                            addMessage("解析失败: " + e.getMessage(), ChatMessage.TYPE_AI);
+                            Toast.makeText(HomeActivity.this, "解析失败: " + e.getMessage(), Toast.LENGTH_SHORT).show();
+                        });
+                    }
+                }
+            });
+        } catch (Exception e) {
+            Log.e("HomeActivity", "构造请求失败", e);
+            addMessage("请求构造失败: " + e.getMessage(), ChatMessage.TYPE_AI);
+            Toast.makeText(this, "请求构造失败: " + e.getMessage(), Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    private String getCurrentLoggedInUser() {
+        // 从SharedPreferences获取当前登录用户
+        return getSharedPreferences("login_prefs", MODE_PRIVATE)
+                .getString("current_user", null);
+    }
+} 

+ 77 - 0
ai/app/src/main/java/com/example/ai/MainActivity.java

@@ -0,0 +1,77 @@
+package com.example.ai;
+
+import android.os.Bundle;
+
+import androidx.activity.EdgeToEdge;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.graphics.Insets;
+import androidx.core.view.ViewCompat;
+import androidx.core.view.WindowInsetsCompat;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.Toast;
+import android.database.Cursor;
+
+public class MainActivity extends AppCompatActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        EdgeToEdge.enable(this);
+        setContentView(R.layout.activity_main);
+        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
+            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
+            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
+            return insets;
+        });
+        // 新增:控件引用
+        EditText etUsername = findViewById(R.id.etUsername);
+        EditText etPassword = findViewById(R.id.etPassword);
+        Button btnLogin = findViewById(R.id.btnLogin);
+        Button btnSkip = findViewById(R.id.btnSkip);
+        DBHelper dbHelper = new DBHelper(this);
+        btnLogin.setOnClickListener(v -> {
+            String username = etUsername.getText().toString().trim();
+            String password = etPassword.getText().toString().trim();
+            if (username.isEmpty() || password.isEmpty()) {
+                Toast.makeText(this, "请输入账号和密码", Toast.LENGTH_SHORT).show();
+                return;
+            }
+            Cursor cursor = dbHelper.getReadableDatabase().rawQuery(
+                "SELECT * FROM " + DBHelper.TABLE_USER + " WHERE username=? AND password=?",
+                new String[]{username, password}
+            );
+            if (cursor.moveToFirst()) {
+                Toast.makeText(this, "登录成功", Toast.LENGTH_SHORT).show();
+                int userId = cursor.getInt(cursor.getColumnIndexOrThrow("id"));
+                // 保存登录状态到SharedPreferences
+                getSharedPreferences("login_prefs", MODE_PRIVATE)
+                    .edit()
+                    .putString("current_user", username)
+                    .putInt("current_user_id", userId)
+                    .apply();
+                android.content.Intent intent = new android.content.Intent(this, HomeActivity.class);
+                intent.putExtra("username", username);
+                intent.putExtra("user_id", userId);
+                startActivity(intent);
+                finish();
+            } else {
+                Toast.makeText(this, "账号或密码错误", Toast.LENGTH_SHORT).show();
+            }
+            cursor.close();
+        });
+        btnSkip.setOnClickListener(v -> {
+            // 清除登录状态
+            getSharedPreferences("login_prefs", MODE_PRIVATE)
+                .edit()
+                .remove("current_user")
+                .remove("current_user_id")
+                .apply();
+            android.content.Intent intent = new android.content.Intent(this, HomeActivity.class);
+            intent.putExtra("username", "");
+            intent.putExtra("user_id", -1);
+            startActivity(intent);
+            finish();
+        });
+    }
+}

+ 66 - 0
ai/app/src/main/java/com/example/ai/ProfileActivity.java

@@ -0,0 +1,66 @@
+package com.example.ai;
+
+import android.os.Bundle;
+import androidx.appcompat.app.AppCompatActivity;
+import android.widget.TextView;
+import android.widget.Button;
+import android.widget.LinearLayout;
+
+public class ProfileActivity extends AppCompatActivity {
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_profile);
+        
+        LinearLayout layoutNotLogin = findViewById(R.id.layoutNotLogin);
+        LinearLayout layoutProfileDetail = findViewById(R.id.layoutProfileDetail);
+        Button btnGoLogin = findViewById(R.id.btnGoLogin);
+        TextView tvProfileName = findViewById(R.id.tvProfileName);
+        
+        // 获取用户名,优先从Intent获取,如果没有则从SharedPreferences获取
+        String username = getIntent().getStringExtra("username");
+        if (username == null || username.isEmpty()) {
+            username = getSharedPreferences("login_prefs", MODE_PRIVATE)
+                    .getString("current_user", null);
+        }
+        
+        if (username == null || username.isEmpty()) {
+            // 未登录状态
+            layoutNotLogin.setVisibility(android.view.View.VISIBLE);
+            layoutProfileDetail.setVisibility(android.view.View.GONE);
+            btnGoLogin.setOnClickListener(v -> {
+                startActivity(new android.content.Intent(this, MainActivity.class));
+                finish();
+            });
+        } else {
+            // 已登录状态
+            layoutNotLogin.setVisibility(android.view.View.GONE);
+            layoutProfileDetail.setVisibility(android.view.View.VISIBLE);
+            // 设置用户名
+            if (tvProfileName != null) {
+                tvProfileName.setText(username);
+            }
+            
+            // 设置退出登录按钮
+            Button btnLogout = findViewById(R.id.btnLogout);
+            if (btnLogout != null) {
+                btnLogout.setOnClickListener(v -> {
+                    // 清除登录状态
+                    getSharedPreferences("login_prefs", MODE_PRIVATE)
+                        .edit()
+                        .remove("current_user")
+                        .apply();
+                    // 跳转到登录页面
+                    startActivity(new android.content.Intent(this, MainActivity.class));
+                    finish();
+                });
+            }
+        }
+        
+        // 底部导航
+        findViewById(R.id.tvHome).setOnClickListener(v -> startActivity(new android.content.Intent(this, HomeActivity.class)));
+        findViewById(R.id.tvGoal).setOnClickListener(v -> startActivity(new android.content.Intent(this, GoalActivity.class)));
+        findViewById(R.id.tvHistory).setOnClickListener(v -> startActivity(new android.content.Intent(this, HistoryActivity.class)));
+        findViewById(R.id.tvProfile).setOnClickListener(v -> {}); // 当前页
+    }
+} 

+ 6 - 0
ai/app/src/main/res/drawable/bg_avatar_circle.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#FFFFFF"/>
+    <corners android:radius="48dp"/>
+    <stroke android:width="2dp" android:color="#E5E6EB"/>
+</shape> 

+ 5 - 0
ai/app/src/main/res/drawable/bg_btn_apple.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#007AFF"/>
+    <corners android:radius="16dp"/>
+</shape> 

+ 5 - 0
ai/app/src/main/res/drawable/bg_btn_circle.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#165DFF"/>
+    <corners android:radius="16dp"/>
+</shape> 

+ 6 - 0
ai/app/src/main/res/drawable/bg_edit_apple.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#FFFFFF"/>
+    <corners android:radius="16dp"/>
+    <stroke android:width="1dp" android:color="#E0E0E0"/>
+</shape> 

+ 10 - 0
ai/app/src/main/res/drawable/ic_camera.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+    <path
+        android:fillColor="#FFFFFF"
+        android:pathData="M12,8a4,4 0 1,0 0,8a4,4 0 1,0 0,-8zm8,-2h-3.17l-1.84-2.63A2,2 0 0,0 12,2h0a2,2 0 0,0-1.99,1.37L8.17,6H5a2,2 0 0,0-2,2v10a2,2 0 0,0 2,2h16a2,2 0 0,0 2-2V8a2,2 0 0,0-2-2zm-8,12a6,6 0 1,1 0,-12a6,6 0 0,1 0,12z"/>
+</vector> 

+ 170 - 0
ai/app/src/main/res/drawable/ic_launcher_background.xml

@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="108dp"
+    android:height="108dp"
+    android:viewportWidth="108"
+    android:viewportHeight="108">
+    <path
+        android:fillColor="#3DDC84"
+        android:pathData="M0,0h108v108h-108z" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M9,0L9,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,0L19,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M29,0L29,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M39,0L39,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M49,0L49,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M59,0L59,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M69,0L69,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M79,0L79,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M89,0L89,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M99,0L99,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,9L108,9"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,19L108,19"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,29L108,29"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,39L108,39"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,49L108,49"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,59L108,59"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,69L108,69"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,79L108,79"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,89L108,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,99L108,99"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,29L89,29"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,39L89,39"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,49L89,49"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,59L89,59"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,69L89,69"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,79L89,79"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M29,19L29,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M39,19L39,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M49,19L49,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M59,19L59,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M69,19L69,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M79,19L79,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+</vector>

+ 30 - 0
ai/app/src/main/res/drawable/ic_launcher_foreground.xml

@@ -0,0 +1,30 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:aapt="http://schemas.android.com/aapt"
+    android:width="108dp"
+    android:height="108dp"
+    android:viewportWidth="108"
+    android:viewportHeight="108">
+    <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
+        <aapt:attr name="android:fillColor">
+            <gradient
+                android:endX="85.84757"
+                android:endY="92.4963"
+                android:startX="42.9492"
+                android:startY="49.59793"
+                android:type="linear">
+                <item
+                    android:color="#44000000"
+                    android:offset="0.0" />
+                <item
+                    android:color="#00000000"
+                    android:offset="1.0" />
+            </gradient>
+        </aapt:attr>
+    </path>
+    <path
+        android:fillColor="#FFFFFF"
+        android:fillType="nonZero"
+        android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
+        android:strokeWidth="1"
+        android:strokeColor="#00000000" />
+</vector>

+ 19 - 0
ai/app/src/main/res/layout/activity_goal.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#F5F5F5">
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="学习目标页面"
+        android:textSize="24sp"
+        android:textColor="#333"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"/>
+
+</androidx.constraintlayout.widget.ConstraintLayout> 

+ 19 - 0
ai/app/src/main/res/layout/activity_history.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#F5F5F5">
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="学习历史页面"
+        android:textSize="24sp"
+        android:textColor="#333"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"/>
+
+</androidx.constraintlayout.widget.ConstraintLayout> 

+ 122 - 0
ai/app/src/main/res/layout/activity_home.xml

@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#F8F8F8">
+
+    <TextView
+        android:id="@+id/tvWelcome"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="欢迎来到AI学习搭子!"
+        android:textSize="24sp"
+        android:textStyle="bold"
+        android:textColor="#222"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_marginTop="24dp"/>
+
+    <androidx.recyclerview.widget.RecyclerView
+        android:id="@+id/rvChat"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        app:layout_constraintTop_toBottomOf="@id/tvWelcome"
+        app:layout_constraintBottom_toTopOf="@id/layoutInput"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_marginTop="16dp"
+        android:layout_marginBottom="8dp"
+        android:padding="8dp"
+        android:clipToPadding="false"
+        android:overScrollMode="never"/>
+
+    <LinearLayout
+        android:id="@+id/bottomNav"
+        android:layout_width="0dp"
+        android:layout_height="60dp"
+        android:orientation="horizontal"
+        android:background="#fff"
+        android:elevation="8dp"
+        android:gravity="center"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent">
+
+        <TextView
+            android:id="@+id/tvHome"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:gravity="center"
+            android:text="首页"
+            android:textSize="16sp"
+            android:textColor="#007AFF"/>
+
+        <TextView
+            android:id="@+id/tvGoal"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:gravity="center"
+            android:text="学习目标"
+            android:textSize="16sp"
+            android:textColor="#888"/>
+
+        <TextView
+            android:id="@+id/tvHistory"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:gravity="center"
+            android:text="学习历史"
+            android:textSize="16sp"
+            android:textColor="#888"/>
+
+        <TextView
+            android:id="@+id/tvProfile"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:gravity="center"
+            android:text="个人中心"
+            android:textSize="16sp"
+            android:textColor="#888"/>
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/layoutInput"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:background="#fff"
+        android:padding="8dp"
+        android:elevation="4dp"
+        app:layout_constraintBottom_toTopOf="@id/bottomNav"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent">
+
+        <EditText
+            android:id="@+id/etInput"
+            android:layout_width="0dp"
+            android:layout_height="40dp"
+            android:layout_weight="1"
+            android:background="@drawable/bg_edit_apple"
+            android:hint="请输入你的问题..."
+            android:textSize="16sp"
+            android:padding="10dp"
+            android:inputType="textMultiLine"
+            android:maxLines="4"/>
+
+        <Button
+            android:id="@+id/btnSend"
+            android:layout_width="60dp"
+            android:layout_height="40dp"
+            android:text="发送"
+            android:textColor="#fff"
+            android:background="@drawable/bg_btn_apple"
+            android:layout_marginStart="8dp"/>
+    </LinearLayout>
+
+</androidx.constraintlayout.widget.ConstraintLayout> 

+ 86 - 0
ai/app/src/main/res/layout/activity_main.xml

@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/main"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#F8F8F8"
+    tools:context=".MainActivity">
+
+    <TextView
+        android:id="@+id/tvTitle"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="AI学习搭子"
+        android:textSize="28sp"
+        android:textStyle="bold"
+        android:textColor="#222"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_marginTop="80dp"/>
+
+    <EditText
+        android:id="@+id/etUsername"
+        android:layout_width="0dp"
+        android:layout_height="50dp"
+        android:hint="账号"
+        android:background="@drawable/bg_edit_apple"
+        android:padding="16dp"
+        android:textSize="16sp"
+        android:inputType="text"
+        app:layout_constraintTop_toBottomOf="@id/tvTitle"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_marginTop="40dp"
+        android:layout_marginStart="32dp"
+        android:layout_marginEnd="32dp"/>
+
+    <EditText
+        android:id="@+id/etPassword"
+        android:layout_width="0dp"
+        android:layout_height="50dp"
+        android:hint="密码"
+        android:background="@drawable/bg_edit_apple"
+        android:padding="16dp"
+        android:textSize="16sp"
+        android:inputType="textPassword"
+        app:layout_constraintTop_toBottomOf="@id/etUsername"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_marginTop="20dp"
+        android:layout_marginStart="32dp"
+        android:layout_marginEnd="32dp"/>
+
+    <Button
+        android:id="@+id/btnLogin"
+        android:layout_width="0dp"
+        android:layout_height="50dp"
+        android:text="登录"
+        android:textSize="18sp"
+        android:textColor="#fff"
+        android:background="@drawable/bg_btn_apple"
+        app:layout_constraintTop_toBottomOf="@id/etPassword"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_marginTop="32dp"
+        android:layout_marginStart="32dp"
+        android:layout_marginEnd="32dp"/>
+
+    <Button
+        android:id="@+id/btnSkip"
+        android:layout_width="0dp"
+        android:layout_height="50dp"
+        android:text="跳过"
+        android:textSize="16sp"
+        android:textColor="#007AFF"
+        android:background="@android:color/transparent"
+        app:layout_constraintTop_toBottomOf="@id/btnLogin"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_marginTop="12dp"
+        android:layout_marginStart="32dp"
+        android:layout_marginEnd="32dp"/>
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 381 - 0
ai/app/src/main/res/layout/activity_profile.xml

@@ -0,0 +1,381 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#F2F3F5">
+
+    <!-- AppBar/Toolbar -->
+    <com.google.android.material.appbar.MaterialToolbar
+        android:id="@+id/toolbar"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="#fff"
+        app:title="个人中心"
+        app:titleTextColor="#222"
+        app:menu="@menu/profile_toolbar_menu"
+        app:popupTheme="@style/ThemeOverlay.Material3.Light"/>
+
+    <LinearLayout
+        android:id="@+id/layoutNotLogin"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:visibility="gone"
+        android:padding="32dp">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="未登录"
+            android:textSize="20sp"
+            android:textColor="#222"
+            android:textStyle="bold"
+            android:layout_marginBottom="24dp"/>
+        <Button
+            android:id="@+id/btnGoLogin"
+            android:layout_width="160dp"
+            android:layout_height="48dp"
+            android:text="登录"
+            android:textColor="#fff"
+            android:backgroundTint="#165DFF"/>
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/layoutProfileDetail"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:gravity="center_horizontal">
+        <androidx.core.widget.NestedScrollView
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_marginTop="56dp"
+            android:fillViewport="true"
+            android:paddingBottom="76dp">
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical"
+                android:padding="16dp"
+                android:gravity="center_horizontal">
+
+                <!-- 用户信息区 -->
+                <androidx.cardview.widget.CardView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="16dp"
+                    app:cardCornerRadius="20dp"
+                    app:cardElevation="4dp">
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical"
+                        android:padding="20dp"
+                        android:gravity="center_horizontal">
+
+                        <FrameLayout
+                            android:layout_width="96dp"
+                            android:layout_height="96dp"
+                            android:layout_gravity="center_horizontal">
+                            <ImageView
+                                android:id="@+id/ivAvatar"
+                                android:layout_width="match_parent"
+                                android:layout_height="match_parent"
+                                android:src="@mipmap/ic_launcher_round"
+                                android:scaleType="centerCrop"
+                                android:background="@drawable/bg_avatar_circle"/>
+                            <ImageButton
+                                android:id="@+id/btnEditAvatar"
+                                android:layout_width="32dp"
+                                android:layout_height="32dp"
+                                android:layout_gravity="bottom|end"
+                                android:backgroundTint="#165DFF"
+                                android:background="@drawable/bg_btn_circle"
+                                android:src="@drawable/ic_camera"
+                                android:contentDescription="编辑头像"
+                                android:tint="#fff"
+                                android:elevation="4dp"/>
+                        </FrameLayout>
+
+                        <TextView
+                            android:id="@+id/tvProfileName"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="小明同学"
+                            android:textSize="22sp"
+                            android:textStyle="bold"
+                            android:textColor="#222"
+                            android:layout_marginTop="12dp"/>
+                        <TextView
+                            android:id="@+id/tvProfileGrade"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="初中三年级"
+                            android:textSize="15sp"
+                            android:textColor="#86909C"
+                            android:layout_marginTop="2dp"/>
+                        <com.google.android.material.chip.ChipGroup
+                            android:id="@+id/chipGroupTags"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="10dp"
+                            app:singleLine="false">
+                            <com.google.android.material.chip.Chip
+                                style="@style/Widget.Material3.Chip.Assist"
+                                android:text="数学爱好者"
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                app:chipBackgroundColor="@color/chip_primary_bg"
+                                app:chipStrokeColor="@color/chip_primary_bg"
+                                app:chipStrokeWidth="0dp"
+                                android:textColor="#165DFF"/>
+                            <com.google.android.material.chip.Chip
+                                style="@style/Widget.Material3.Chip.Assist"
+                                android:text="学习进步奖"
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                app:chipBackgroundColor="@color/chip_secondary_bg"
+                                app:chipStrokeColor="@color/chip_secondary_bg"
+                                app:chipStrokeWidth="0dp"
+                                android:textColor="#36BFFA"/>
+                            <com.google.android.material.chip.Chip
+                                style="@style/Widget.Material3.Chip.Assist"
+                                android:text="连续学习5天"
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                app:chipBackgroundColor="@color/chip_accent_bg"
+                                app:chipStrokeColor="@color/chip_accent_bg"
+                                app:chipStrokeWidth="0dp"
+                                android:textColor="#722ED1"/>
+                        </com.google.android.material.chip.ChipGroup>
+
+                        <LinearLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:orientation="horizontal"
+                            android:gravity="center"
+                            android:layout_marginTop="20dp">
+                            <include layout="@layout/item_profile_stat_card"/>
+                            <include layout="@layout/item_profile_stat_card"/>
+                            <include layout="@layout/item_profile_stat_card"/>
+                            <include layout="@layout/item_profile_stat_card"/>
+                        </LinearLayout>
+                    </LinearLayout>
+                </androidx.cardview.widget.CardView>
+
+                <!-- 图表区 -->
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:gravity="center"
+                    android:layout_marginBottom="16dp">
+                    <androidx.cardview.widget.CardView
+                        android:layout_width="0dp"
+                        android:layout_height="220dp"
+                        android:layout_weight="1"
+                        android:layout_marginEnd="8dp"
+                        app:cardCornerRadius="20dp"
+                        app:cardElevation="4dp">
+                        <LinearLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="match_parent"
+                            android:orientation="vertical"
+                            android:padding="16dp">
+                            <TextView
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:text="学习时间分布"
+                                android:textSize="16sp"
+                                android:textStyle="bold"
+                                android:textColor="#222"/>
+                            <View
+                                android:id="@+id/barChart"
+                                android:layout_width="match_parent"
+                                android:layout_height="0dp"
+                                android:layout_weight="1"
+                                android:background="#E5E6EB"/>
+                        </LinearLayout>
+                    </androidx.cardview.widget.CardView>
+                    <androidx.cardview.widget.CardView
+                        android:layout_width="0dp"
+                        android:layout_height="220dp"
+                        android:layout_weight="1"
+                        android:layout_marginStart="8dp"
+                        app:cardCornerRadius="20dp"
+                        app:cardElevation="4dp">
+                        <LinearLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="match_parent"
+                            android:orientation="vertical"
+                            android:padding="16dp">
+                            <TextView
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:text="学习科目分布"
+                                android:textSize="16sp"
+                                android:textStyle="bold"
+                                android:textColor="#222"/>
+                            <View
+                                android:id="@+id/pieChart"
+                                android:layout_width="match_parent"
+                                android:layout_height="0dp"
+                                android:layout_weight="1"
+                                android:background="#E5E6EB"/>
+                        </LinearLayout>
+                    </androidx.cardview.widget.CardView>
+                </LinearLayout>
+
+                <!-- 成就区 -->
+                <androidx.cardview.widget.CardView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="16dp"
+                    app:cardCornerRadius="20dp"
+                    app:cardElevation="4dp">
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical"
+                        android:padding="16dp">
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="学习成就"
+                            android:textSize="16sp"
+                            android:textStyle="bold"
+                            android:textColor="#222"/>
+                        <GridLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:columnCount="4"
+                            android:rowCount="1"
+                            android:layout_marginTop="12dp">
+                            <include layout="@layout/item_profile_achievement_card"/>
+                            <include layout="@layout/item_profile_achievement_card"/>
+                            <include layout="@layout/item_profile_achievement_card"/>
+                            <include layout="@layout/item_profile_achievement_card"/>
+                        </GridLayout>
+                    </LinearLayout>
+                </androidx.cardview.widget.CardView>
+
+                <!-- 设置区 -->
+                <androidx.cardview.widget.CardView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    app:cardCornerRadius="20dp"
+                    app:cardElevation="4dp">
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical"
+                        android:padding="16dp">
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="学习设置"
+                            android:textSize="16sp"
+                            android:textStyle="bold"
+                            android:textColor="#222"/>
+                        <include layout="@layout/item_profile_setting_switch"/>
+                        <include layout="@layout/item_profile_setting_switch"/>
+                        <include layout="@layout/item_profile_setting_switch"/>
+                        <include layout="@layout/item_profile_setting_switch"/>
+                        <include layout="@layout/item_profile_setting_switch"/>
+                        <LinearLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:orientation="horizontal"
+                            android:gravity="center"
+                            android:layout_marginTop="16dp">
+                            <Button
+                                android:layout_width="0dp"
+                                android:layout_height="wrap_content"
+                                android:layout_weight="1"
+                                android:text="通知设置"
+                                android:textColor="#4E5969"
+                                android:backgroundTint="#F2F3F5"/>
+                            <Space android:layout_width="8dp" android:layout_height="wrap_content"/>
+                            <Button
+                                android:layout_width="0dp"
+                                android:layout_height="wrap_content"
+                                android:layout_weight="1"
+                                android:text="账号安全"
+                                android:textColor="#4E5969"
+                                android:backgroundTint="#F2F3F5"/>
+                            <Space android:layout_width="8dp" android:layout_height="wrap_content"/>
+                            <Button
+                                android:layout_width="0dp"
+                                android:layout_height="wrap_content"
+                                android:layout_weight="1"
+                                android:text="帮助中心"
+                                android:textColor="#4E5969"
+                                android:backgroundTint="#F2F3F5"/>
+                        </LinearLayout>
+                        <Button
+                            android:id="@+id/btnLogout"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:text="退出登录"
+                            android:textColor="#F53F3F"
+                            android:backgroundTint="#fff"
+                            android:layout_marginTop="24dp"/>
+                    </LinearLayout>
+                </androidx.cardview.widget.CardView>
+            </LinearLayout>
+        </androidx.core.widget.NestedScrollView>
+    </LinearLayout>
+    <LinearLayout
+        android:id="@+id/bottomNav"
+        android:layout_width="match_parent"
+        android:layout_height="60dp"
+        android:orientation="horizontal"
+        android:background="#fff"
+        android:elevation="8dp"
+        android:gravity="center"
+        android:layout_gravity="bottom"
+        android:layout_marginTop="16dp">
+
+        <TextView
+            android:id="@+id/tvHome"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:gravity="center"
+            android:text="首页"
+            android:textSize="16sp"
+            android:textColor="#888"/>
+
+        <TextView
+            android:id="@+id/tvGoal"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:gravity="center"
+            android:text="学习目标"
+            android:textSize="16sp"
+            android:textColor="#888"/>
+
+        <TextView
+            android:id="@+id/tvHistory"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:gravity="center"
+            android:text="学习历史"
+            android:textSize="16sp"
+            android:textColor="#888"/>
+
+        <TextView
+            android:id="@+id/tvProfile"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:gravity="center"
+            android:text="个人中心"
+            android:textSize="16sp"
+            android:textColor="#007AFF"/>
+    </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout> 

+ 24 - 0
ai/app/src/main/res/layout/item_chat_ai.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:padding="4dp">
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="start"
+        android:orientation="horizontal"
+        android:gravity="start|center_vertical">
+        <TextView
+            android:id="@+id/tvAIContent"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:background="#fff"
+            android:textColor="#222"
+            android:textSize="16sp"
+            android:padding="12dp"
+            android:maxWidth="260dp"
+            android:elevation="2dp"
+            android:text="AI回复"/>
+    </LinearLayout>
+</FrameLayout> 

+ 23 - 0
ai/app/src/main/res/layout/item_chat_user.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:padding="4dp">
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="end"
+        android:orientation="horizontal"
+        android:gravity="end|center_vertical">
+        <TextView
+            android:id="@+id/tvUserContent"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:background="@drawable/bg_btn_apple"
+            android:textColor="#fff"
+            android:textSize="16sp"
+            android:padding="12dp"
+            android:maxWidth="260dp"
+            android:text="用户消息"/>
+    </LinearLayout>
+</FrameLayout> 

+ 50 - 0
ai/app/src/main/res/layout/item_profile_achievement_card.xml

@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="0dp"
+    android:layout_height="wrap_content"
+    android:layout_weight="1"
+    android:orientation="vertical"
+    android:gravity="center"
+    android:padding="8dp">
+    <FrameLayout
+        android:layout_width="48dp"
+        android:layout_height="48dp">
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="#E8F3FF"
+            android:layout_gravity="center"/>
+        <ImageView
+            android:id="@+id/ivAchievementIcon"
+            android:layout_width="32dp"
+            android:layout_height="32dp"
+            android:layout_gravity="center"
+            android:src="@drawable/ic_camera"
+            android:tint="#165DFF"/>
+    </FrameLayout>
+    <TextView
+        android:id="@+id/tvAchievementName"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="学习之星"
+        android:textSize="14sp"
+        android:textStyle="bold"
+        android:textColor="#222"
+        android:layout_marginTop="6dp"/>
+    <TextView
+        android:id="@+id/tvAchievementDesc"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="连续学习7天"
+        android:textSize="11sp"
+        android:textColor="#86909C"
+        android:layout_marginTop="2dp"/>
+    <TextView
+        android:id="@+id/tvAchievementStatus"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="已获得"
+        android:textSize="11sp"
+        android:textColor="#00B42A"
+        android:layout_marginTop="2dp"/>
+</LinearLayout> 

+ 33 - 0
ai/app/src/main/res/layout/item_profile_setting_switch.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="horizontal"
+    android:gravity="center_vertical"
+    android:padding="8dp">
+    <LinearLayout
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:orientation="vertical">
+        <TextView
+            android:id="@+id/tvSettingTitle"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="AI学习助手"
+            android:textSize="15sp"
+            android:textColor="#222"/>
+        <TextView
+            android:id="@+id/tvSettingDesc"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="个性化学习建议和指导"
+            android:textSize="12sp"
+            android:textColor="#86909C"/>
+    </LinearLayout>
+    <Switch
+        android:id="@+id/switchSetting"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:checked="true"/>
+</LinearLayout> 

+ 34 - 0
ai/app/src/main/res/layout/item_profile_stat_card.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="0dp"
+    android:layout_height="wrap_content"
+    android:layout_weight="1"
+    android:orientation="vertical"
+    android:gravity="center"
+    android:background="#F8F8F8"
+    android:layout_margin="4dp"
+    android:padding="8dp"
+    android:layout_marginTop="0dp"
+    android:layout_marginBottom="0dp"
+    android:layout_marginStart="2dp"
+    android:layout_marginEnd="2dp"
+    android:clipToPadding="false"
+    android:elevation="2dp"
+    android:backgroundTint="#F8F8F8">
+    <TextView
+        android:id="@+id/tvStatValue"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="12.5小时"
+        android:textSize="18sp"
+        android:textStyle="bold"
+        android:textColor="#222"/>
+    <TextView
+        android:id="@+id/tvStatDesc"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="本周学习"
+        android:textSize="12sp"
+        android:textColor="#86909C"
+        android:layout_marginTop="2dp"/>
+</LinearLayout> 

+ 13 - 0
ai/app/src/main/res/menu/profile_toolbar_menu.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:id="@+id/action_edit"
+        android:icon="@drawable/ic_camera"
+        android:title="编辑资料"
+        android:showAsAction="ifRoom"/>
+    <item
+        android:id="@+id/action_settings"
+        android:icon="@android:drawable/ic_menu_manage"
+        android:title="设置"
+        android:showAsAction="ifRoom"/>
+</menu> 

+ 6 - 0
ai/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+    <background android:drawable="@drawable/ic_launcher_background" />
+    <foreground android:drawable="@drawable/ic_launcher_foreground" />
+    <monochrome android:drawable="@drawable/ic_launcher_foreground" />
+</adaptive-icon>

+ 6 - 0
ai/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+    <background android:drawable="@drawable/ic_launcher_background" />
+    <foreground android:drawable="@drawable/ic_launcher_foreground" />
+    <monochrome android:drawable="@drawable/ic_launcher_foreground" />
+</adaptive-icon>

BIN
ai/app/src/main/res/mipmap-hdpi/ic_launcher.webp


BIN
ai/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp


BIN
ai/app/src/main/res/mipmap-mdpi/ic_launcher.webp


BIN
ai/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp


BIN
ai/app/src/main/res/mipmap-xhdpi/ic_launcher.webp


BIN
ai/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp


BIN
ai/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp


BIN
ai/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp


BIN
ai/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp


BIN
ai/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp


+ 7 - 0
ai/app/src/main/res/values-night/themes.xml

@@ -0,0 +1,7 @@
+<resources xmlns:tools="http://schemas.android.com/tools">
+    <!-- Base application theme. -->
+    <style name="Base.Theme.Ai" parent="Theme.Material3.DayNight.NoActionBar">
+        <!-- Customize your dark theme here. -->
+        <!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
+    </style>
+</resources>

+ 8 - 0
ai/app/src/main/res/values/colors.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="black">#FF000000</color>
+    <color name="white">#FFFFFFFF</color>
+    <color name="chip_primary_bg">#E8F3FF</color>
+    <color name="chip_secondary_bg">#E6F7FF</color>
+    <color name="chip_accent_bg">#F3F0FF</color>
+</resources>

+ 3 - 0
ai/app/src/main/res/values/strings.xml

@@ -0,0 +1,3 @@
+<resources>
+    <string name="app_name">ai</string>
+</resources>

+ 9 - 0
ai/app/src/main/res/values/themes.xml

@@ -0,0 +1,9 @@
+<resources xmlns:tools="http://schemas.android.com/tools">
+    <!-- Base application theme. -->
+    <style name="Base.Theme.Ai" parent="Theme.Material3.DayNight.NoActionBar">
+        <!-- Customize your light theme here. -->
+        <!-- <item name="colorPrimary">@color/my_light_primary</item> -->
+    </style>
+
+    <style name="Theme.Ai" parent="Base.Theme.Ai" />
+</resources>

+ 13 - 0
ai/app/src/main/res/xml/backup_rules.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+   Sample backup rules file; uncomment and customize as necessary.
+   See https://developer.android.com/guide/topics/data/autobackup
+   for details.
+   Note: This file is ignored for devices older than API 31
+   See https://developer.android.com/about/versions/12/backup-restore
+-->
+<full-backup-content>
+    <!--
+   <include domain="sharedpref" path="."/>
+   <exclude domain="sharedpref" path="device.xml"/>
+-->
+</full-backup-content>

+ 19 - 0
ai/app/src/main/res/xml/data_extraction_rules.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+   Sample data extraction rules file; uncomment and customize as necessary.
+   See https://developer.android.com/about/versions/12/backup-restore#xml-changes
+   for details.
+-->
+<data-extraction-rules>
+    <cloud-backup>
+        <!-- TODO: Use <include> and <exclude> to control what is backed up.
+        <include .../>
+        <exclude .../>
+        -->
+    </cloud-backup>
+    <!--
+    <device-transfer>
+        <include .../>
+        <exclude .../>
+    </device-transfer>
+    -->
+</data-extraction-rules>

+ 17 - 0
ai/app/src/test/java/com/example/ai/ExampleUnitTest.java

@@ -0,0 +1,17 @@
+package com.example.ai;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+public class ExampleUnitTest {
+    @Test
+    public void addition_isCorrect() {
+        assertEquals(4, 2 + 2);
+    }
+}

+ 4 - 0
ai/build.gradle

@@ -0,0 +1,4 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+plugins {
+alias(libs.plugins.android.application) apply false
+}

+ 21 - 0
ai/gradle.properties

@@ -0,0 +1,21 @@
+# 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. For more details, visit
+# https://developer.android.com/r/tools/gradle-multi-project-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
+# 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

+ 22 - 0
ai/gradle/libs.versions.toml

@@ -0,0 +1,22 @@
+[versions]
+agp = "8.11.1"
+junit = "4.13.2"
+junitVersion = "1.1.5"
+espressoCore = "3.5.1"
+appcompat = "1.6.1"
+material = "1.10.0"
+activity = "1.8.0"
+constraintlayout = "2.1.4"
+
+[libraries]
+junit = { group = "junit", name = "junit", version.ref = "junit" }
+ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
+espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
+appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
+material = { group = "com.google.android.material", name = "material", version.ref = "material" }
+activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
+constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
+
+[plugins]
+android-application = { id = "com.android.application", version.ref = "agp" }
+

BIN
ai/gradle/wrapper/gradle-wrapper.jar


+ 6 - 0
ai/gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,6 @@
+#Thu Jul 17 15:05:43 CST 2025
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists

+ 185 - 0
ai/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" "$@"

+ 89 - 0
ai/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

+ 23 - 0
ai/settings.gradle

@@ -0,0 +1,23 @@
+pluginManagement {
+    repositories {
+        google {
+            content {
+                includeGroupByRegex("com\\.android.*")
+                includeGroupByRegex("com\\.google.*")
+                includeGroupByRegex("androidx.*")
+            }
+        }
+        mavenCentral()
+        gradlePluginPortal()
+    }
+}
+dependencyResolutionManagement {
+    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+    repositories {
+        google()
+        mavenCentral()
+    }
+}
+
+rootProject.name = "ai"
+include ':app'