From 202e1f7fd70eac25916b06fe80b61fbe616a305a Mon Sep 17 00:00:00 2001 From: yovinchen Date: Wed, 27 Nov 2024 09:56:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=B8=8E=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96:=20=E6=9B=B4=E6=96=B0=E6=88=90=E5=91=98?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 更新README文档 - 新增成员管理功能说明 - 重新组织功能列表 - 优化分支管理说明 2. 代码优化 - 优化导入语句 - 移除未使用的导入 - 简化数据库回调实现 --- README.md | 25 ++++++++++++------- app/src/main/AndroidManifest.xml | 1 - .../bookkeeping/data/BookkeepingDatabase.kt | 2 +- .../ui/dialog/CategoryManagementDialog.kt | 25 ++++++++++++++++--- .../ui/navigation/MainNavigation.kt | 13 +++++++--- .../bookkeeping/ui/screen/SettingsScreen.kt | 24 ++++++++++++++---- 6 files changed, 67 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index af7def0..225f67f 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ ## 主要特性 - 💰 收入/支出记录管理 +- 👥 成员管理系统 - 📊 分类管理系统 - 📅 自定义日期选择器 - 📈 月度统计视图 @@ -25,38 +26,44 @@ ## 开发计划 -### 1. 数据统计与可视化 (feature/statistics) +### 1. 成员管理功能 (feature/member) +- [ ] 成员添加/编辑/删除 +- [ ] 记账时选择相关成员 +- [ ] 成员消费统计 +- [ ] 成员间账单分摊 + +### 2. 数据统计与可视化 (feature/statistics) - [ ] 支出/收入趋势图表 - [ ] 分类占比饼图 - [ ] 月度/年度报表 -### 2. 数据导出与备份 (feature/backup) +### 3. 数据导出与备份 (feature/backup) - [ ] 导出 CSV/Excel 功能 - [ ] 云端备份支持 - [ ] 数据迁移工具 -### 3. 预算管理 (feature/budget) +### 4. 预算管理 (feature/budget) - [ ] 月度预算设置 - [ ] 预算超支提醒 - [ ] 分类预算管理 -### 4. 用户体验优化 (feature/ux-enhancement) +### 5. 用户体验优化 (feature/ux-enhancement) - [ ] 深色模式支持 - [ ] 手势操作优化 - [ ] 快速记账小组件 - [ ] 多语言支持 -### 5. 性能优化 (feature/performance) +### 6. 性能优化 (feature/performance) - [ ] 大数据量处理优化 - [ ] 启动速度优化 - [ ] 内存使用优化 ## 分支管理 -- `master`: 主分支,保持稳定可用 -- `develop`: 开发分支,新功能开发的基础分支 -- `feature/*`: 具体功能开发分支 -- `release/*`: 发布准备分支 +- `master`: 稳定主分支 +- `develop`: 主开发分支 +- `feature/*`: 功能开发分支 +- `release/*`: 版本发布分支 ## 如何贡献 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b9dd079..e86bf17 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,7 +15,6 @@ diff --git a/app/src/main/java/com/yovinchen/bookkeeping/data/BookkeepingDatabase.kt b/app/src/main/java/com/yovinchen/bookkeeping/data/BookkeepingDatabase.kt index 4e91098..5700119 100644 --- a/app/src/main/java/com/yovinchen/bookkeeping/data/BookkeepingDatabase.kt +++ b/app/src/main/java/com/yovinchen/bookkeeping/data/BookkeepingDatabase.kt @@ -138,7 +138,7 @@ abstract class BookkeepingDatabase : RoomDatabase() { BookkeepingDatabase::class.java, "bookkeeping_database" ) - .addCallback(object : RoomDatabase.Callback() { + .addCallback(object : Callback() { override fun onCreate(db: SupportSQLiteDatabase) { super.onCreate(db) Log.d(TAG, "Database created, initializing default categories") diff --git a/app/src/main/java/com/yovinchen/bookkeeping/ui/dialog/CategoryManagementDialog.kt b/app/src/main/java/com/yovinchen/bookkeeping/ui/dialog/CategoryManagementDialog.kt index 5a3f5d3..db63cc8 100644 --- a/app/src/main/java/com/yovinchen/bookkeeping/ui/dialog/CategoryManagementDialog.kt +++ b/app/src/main/java/com/yovinchen/bookkeeping/ui/dialog/CategoryManagementDialog.kt @@ -2,15 +2,32 @@ package com.yovinchen.bookkeeping.ui.dialog import android.util.Log import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Add import androidx.compose.material.icons.filled.Delete -import androidx.compose.material.icons.filled.Edit -import androidx.compose.material3.* -import androidx.compose.runtime.* +import androidx.compose.material3.AlertDialog +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.FilterChip +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.OutlinedTextField +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp diff --git a/app/src/main/java/com/yovinchen/bookkeeping/ui/navigation/MainNavigation.kt b/app/src/main/java/com/yovinchen/bookkeeping/ui/navigation/MainNavigation.kt index 6278042..a8d05d3 100644 --- a/app/src/main/java/com/yovinchen/bookkeeping/ui/navigation/MainNavigation.kt +++ b/app/src/main/java/com/yovinchen/bookkeeping/ui/navigation/MainNavigation.kt @@ -4,13 +4,20 @@ import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Home import androidx.compose.material.icons.filled.Settings -import androidx.compose.material3.* -import androidx.compose.runtime.* +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.NavigationBar +import androidx.compose.material3.NavigationBarItem +import androidx.compose.material3.NavigationBarItemDefaults +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.navigation.NavDestination.Companion.hierarchy import androidx.navigation.NavGraph.Companion.findStartDestination import androidx.navigation.compose.NavHost -import androidx.compose.ui.graphics.Color import androidx.navigation.compose.composable import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController diff --git a/app/src/main/java/com/yovinchen/bookkeeping/ui/screen/SettingsScreen.kt b/app/src/main/java/com/yovinchen/bookkeeping/ui/screen/SettingsScreen.kt index daffcca..05fb814 100644 --- a/app/src/main/java/com/yovinchen/bookkeeping/ui/screen/SettingsScreen.kt +++ b/app/src/main/java/com/yovinchen/bookkeeping/ui/screen/SettingsScreen.kt @@ -1,16 +1,30 @@ package com.yovinchen.bookkeeping.ui.screen import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.* -import androidx.compose.material3.* -import androidx.compose.runtime.* +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.AlertDialog +import androidx.compose.material3.Divider +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.ListItem +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.RadioButton +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton +import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.lifecycle.viewmodel.compose.viewModel -import com.yovinchen.bookkeeping.model.Category import com.yovinchen.bookkeeping.model.ThemeMode -import com.yovinchen.bookkeeping.model.TransactionType import com.yovinchen.bookkeeping.ui.components.ColorPicker import com.yovinchen.bookkeeping.ui.components.predefinedColors import com.yovinchen.bookkeeping.ui.dialog.CategoryManagementDialog