Compare commits
8 Commits
feature/ba
...
master
Author | SHA1 | Date | |
---|---|---|---|
0d40a8abb0 | |||
0804791bd2 | |||
5d5414d51d | |||
046c6a6ae0 | |||
1b0c6982e8 | |||
d0b3b9a663 | |||
9382e7adde | |||
0497e2503b |
@ -17,7 +17,7 @@ android {
|
|||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 6
|
versionCode = 6
|
||||||
versionName = "1.3.0"
|
versionName = "1.4.0"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables {
|
vectorDrawables {
|
||||||
|
@ -165,31 +165,31 @@ abstract class BookkeepingDatabase : RoomDatabase() {
|
|||||||
// 初始化默认分类
|
// 初始化默认分类
|
||||||
database.categoryDao().apply {
|
database.categoryDao().apply {
|
||||||
// 支出分类
|
// 支出分类
|
||||||
insertCategory(Category(name = "餐饮", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_food_24dp))
|
insertCategory(Category(name = "餐饮", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_food_24dp)) // "餐饮" to R.drawable.ic_category_food_24dp
|
||||||
insertCategory(Category(name = "交通", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_taxi_24dp))
|
insertCategory(Category(name = "交通", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_taxi_24dp)) // "交通" to R.drawable.ic_category_taxi_24dp
|
||||||
insertCategory(Category(name = "购物", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_supermarket_24dp))
|
insertCategory(Category(name = "购物", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_supermarket_24dp)) // "购物" to R.drawable.ic_category_supermarket_24dp
|
||||||
insertCategory(Category(name = "娱乐", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_bar_24dp))
|
insertCategory(Category(name = "娱乐", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_bar_24dp)) // "娱乐" to R.drawable.ic_category_bar_24dp
|
||||||
insertCategory(Category(name = "居住", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_hotel_24dp))
|
insertCategory(Category(name = "居住", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_hotel_24dp)) // "居住" to R.drawable.ic_category_hotel_24dp
|
||||||
insertCategory(Category(name = "医疗", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_medicine_24dp))
|
insertCategory(Category(name = "医疗", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_medicine_24dp)) // "医疗" to R.drawable.ic_category_medicine_24dp
|
||||||
insertCategory(Category(name = "教育", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_training_24dp))
|
insertCategory(Category(name = "教育", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_training_24dp)) // "教育" to R.drawable.ic_category_training_24dp
|
||||||
insertCategory(Category(name = "宠物", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_pet_24dp))
|
insertCategory(Category(name = "宠物", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_pet_24dp)) // "宠物" to R.drawable.ic_category_pet_24dp
|
||||||
insertCategory(Category(name = "花卉", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_flower_24dp))
|
insertCategory(Category(name = "鲜花", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_flower_24dp)) // "鲜花" to R.drawable.ic_category_flower_24dp
|
||||||
insertCategory(Category(name = "酒吧", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_bar_24dp))
|
insertCategory(Category(name = "外卖", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_delivery_24dp)) // "外卖" to R.drawable.ic_category_delivery_24dp
|
||||||
insertCategory(Category(name = "快递", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_delivery_24dp))
|
insertCategory(Category(name = "数码", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_digital_24dp)) // "数码" to R.drawable.ic_category_digital_24dp
|
||||||
insertCategory(Category(name = "数码", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_digital_24dp))
|
insertCategory(Category(name = "化妆品", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_cosmetics_24dp)) // "化妆品" to R.drawable.ic_category_cosmetics_24dp
|
||||||
insertCategory(Category(name = "化妆品", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_cosmetics_24dp))
|
insertCategory(Category(name = "水果", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_fruit_24dp)) // "水果" to R.drawable.ic_category_fruit_24dp
|
||||||
insertCategory(Category(name = "水果", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_fruit_24dp))
|
insertCategory(Category(name = "零食", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_snack_24dp)) // "零食" to R.drawable.ic_category_snack_24dp
|
||||||
insertCategory(Category(name = "零食", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_snack_24dp))
|
insertCategory(Category(name = "蔬菜", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_vegetable_24dp)) // "蔬菜" to R.drawable.ic_category_vegetable_24dp
|
||||||
insertCategory(Category(name = "蔬菜", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_vegetable_24dp))
|
insertCategory(Category(name = "会员", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_membership_24dp)) // "工资" to R.drawable.ic_category_membership_24dp
|
||||||
insertCategory(Category(name = "会员", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_membership_24dp))
|
insertCategory(Category(name = "礼物", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_gift_24dp)) // "礼物" to R.drawable.ic_category_gift_24dp
|
||||||
insertCategory(Category(name = "礼物", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_gift_24dp))
|
insertCategory(Category(name = "其他支出", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_more_24dp)) // "其他" to R.drawable.ic_category_more_24dp
|
||||||
insertCategory(Category(name = "其他支出", type = TransactionType.EXPENSE, icon = R.drawable.ic_category_more_24dp))
|
|
||||||
|
|
||||||
// 收入分类
|
// 收入分类
|
||||||
insertCategory(Category(name = "工资", type = TransactionType.INCOME, icon = R.drawable.ic_category_membership_24dp))
|
insertCategory(Category(name = "工资", type = TransactionType.INCOME, icon = R.drawable.ic_category_membership_24dp)) // "工资" to R.drawable.ic_category_membership_24dp
|
||||||
insertCategory(Category(name = "奖金", type = TransactionType.INCOME, icon = R.drawable.ic_category_gift_24dp))
|
insertCategory(Category(name = "奖金", type = TransactionType.INCOME, icon = R.drawable.ic_category_gift_24dp)) // "奖金" to R.drawable.ic_category_gift_24dp
|
||||||
insertCategory(Category(name = "投资", type = TransactionType.INCOME, icon = R.drawable.ic_category_digital_24dp))
|
insertCategory(Category(name = "投资", type = TransactionType.INCOME, icon = R.drawable.ic_category_digital_24dp)) // "投资" to R.drawable.ic_category_digital_24dp
|
||||||
insertCategory(Category(name = "其他收入", type = TransactionType.INCOME, icon = R.drawable.ic_category_more_24dp))
|
insertCategory(Category(name = "其他收入", type = TransactionType.INCOME, icon = R.drawable.ic_category_more_24dp)) // "其他" to R.drawable.ic_category_more_24dp
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,48 +9,47 @@ import com.yovinchen.bookkeeping.R
|
|||||||
object IconManager {
|
object IconManager {
|
||||||
// 类别图标映射
|
// 类别图标映射
|
||||||
private val categoryIcons = mapOf(
|
private val categoryIcons = mapOf(
|
||||||
"食品" to R.drawable.ic_category_food_24dp,
|
"餐饮" to R.drawable.ic_category_food_24dp,
|
||||||
"交通" to R.drawable.ic_category_taxi_24dp,
|
"交通" to R.drawable.ic_category_taxi_24dp,
|
||||||
"娱乐" to R.drawable.ic_category_bar_24dp,
|
|
||||||
"购物" to R.drawable.ic_category_supermarket_24dp,
|
"购物" to R.drawable.ic_category_supermarket_24dp,
|
||||||
"工资" to R.drawable.ic_category_membership_24dp,
|
"娱乐" to R.drawable.ic_category_bar_24dp,
|
||||||
"服装" to R.drawable.ic_category_clothes_24dp,
|
"居住" to R.drawable.ic_category_hotel_24dp,
|
||||||
"数码" to R.drawable.ic_category_digital_24dp,
|
|
||||||
"饮料" to R.drawable.ic_category_drink_24dp,
|
|
||||||
"医疗" to R.drawable.ic_category_medicine_24dp,
|
"医疗" to R.drawable.ic_category_medicine_24dp,
|
||||||
"旅行" to R.drawable.ic_category_travel_24dp,
|
"教育" to R.drawable.ic_category_training_24dp,
|
||||||
"便利店" to R.drawable.ic_category_convenience_24dp,
|
|
||||||
"化妆品" to R.drawable.ic_category_cosmetics_24dp,
|
|
||||||
"外卖" to R.drawable.ic_category_delivery_24dp,
|
|
||||||
"鲜花" to R.drawable.ic_category_flower_24dp,
|
|
||||||
"水果" to R.drawable.ic_category_fruit_24dp,
|
|
||||||
"礼物" to R.drawable.ic_category_gift_24dp,
|
|
||||||
"住宿" to R.drawable.ic_category_hotel_24dp,
|
|
||||||
"宠物" to R.drawable.ic_category_pet_24dp,
|
"宠物" to R.drawable.ic_category_pet_24dp,
|
||||||
"景点" to R.drawable.ic_category_scenic_24dp,
|
"鲜花" to R.drawable.ic_category_flower_24dp,
|
||||||
|
"外卖" to R.drawable.ic_category_delivery_24dp,
|
||||||
|
"数码" to R.drawable.ic_category_digital_24dp,
|
||||||
|
"化妆品" to R.drawable.ic_category_cosmetics_24dp,
|
||||||
|
"水果" to R.drawable.ic_category_fruit_24dp,
|
||||||
"零食" to R.drawable.ic_category_snack_24dp,
|
"零食" to R.drawable.ic_category_snack_24dp,
|
||||||
"培训" to R.drawable.ic_category_training_24dp,
|
|
||||||
"蔬菜" to R.drawable.ic_category_vegetable_24dp,
|
"蔬菜" to R.drawable.ic_category_vegetable_24dp,
|
||||||
"婴儿" to R.drawable.ic_category_baby_24dp,
|
"工资" to R.drawable.ic_category_membership_24dp,
|
||||||
"餐饮" to R.drawable.ic_category_food_24dp, // 添加餐饮分类
|
"礼物" to R.drawable.ic_category_gift_24dp,
|
||||||
"居住" to R.drawable.ic_category_hotel_24dp, // 添加居住分类
|
"其他" to R.drawable.ic_category_more_24dp,
|
||||||
|
"工资" to R.drawable.ic_category_membership_24dp,
|
||||||
|
"会员" to R.drawable.ic_category_membership_24dp,
|
||||||
|
"奖金" to R.drawable.ic_category_gift_24dp,
|
||||||
|
"投资" to R.drawable.ic_category_digital_24dp,
|
||||||
"其他" to R.drawable.ic_category_more_24dp
|
"其他" to R.drawable.ic_category_more_24dp
|
||||||
)
|
)
|
||||||
|
|
||||||
// 成员图标映射
|
// 成员图标映射
|
||||||
private val memberIcons = mapOf(
|
private val memberIcons = mapOf(
|
||||||
"自己" to R.drawable.ic_member_boy_24dp,
|
"自己" to R.drawable.ic_member_boy_24dp,
|
||||||
|
"老婆" to R.drawable.ic_member_bride_24dp,
|
||||||
|
"老公" to R.drawable.ic_member_groom_24dp,
|
||||||
"家庭" to R.drawable.ic_member_family_24dp,
|
"家庭" to R.drawable.ic_member_family_24dp,
|
||||||
"父亲" to R.drawable.ic_member_father_24dp,
|
"儿子" to R.drawable.ic_member_baby_boy_24dp,
|
||||||
"母亲" to R.drawable.ic_member_mother_24dp,
|
"女儿" to R.drawable.ic_member_baby_girl_24dp,
|
||||||
"男宝" to R.drawable.ic_member_baby_boy_24dp,
|
"爸爸" to R.drawable.ic_member_father_24dp,
|
||||||
"女宝" to R.drawable.ic_member_baby_girl_24dp,
|
"妈妈" to R.drawable.ic_member_mother_24dp,
|
||||||
"新娘" to R.drawable.ic_member_bride_24dp,
|
|
||||||
"新郎" to R.drawable.ic_member_groom_24dp,
|
|
||||||
"爷爷" to R.drawable.ic_member_grandfather_24dp,
|
"爷爷" to R.drawable.ic_member_grandfather_24dp,
|
||||||
"奶奶" to R.drawable.ic_member_grandmother_24dp,
|
"奶奶" to R.drawable.ic_member_grandmother_24dp,
|
||||||
"男生" to R.drawable.ic_member_boy_24dp,
|
"男生" to R.drawable.ic_member_boy_24dp,
|
||||||
"女生" to R.drawable.ic_member_girl_24dp,
|
"女生" to R.drawable.ic_member_girl_24dp,
|
||||||
|
"外公" to R.drawable.ic_member_grandfather_24dp,
|
||||||
|
"外婆" to R.drawable.ic_member_grandmother_24dp,
|
||||||
"其他" to R.drawable.ic_member_girl_24dp
|
"其他" to R.drawable.ic_member_girl_24dp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user