🎉 发布 3.0.0 版本
12
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
|
|
@ -1,5 +1,5 @@
|
|||
name: 问题反馈 / Bug Report
|
||||
description: 发现并反馈问题以帮助改进待办 / Create a report to help us improve To Do
|
||||
description: 发现并反馈问题以帮助改进 VerveDo / Create a report to help us improve VerveDo
|
||||
title: "[Bug] "
|
||||
labels: [ "bug" ]
|
||||
body:
|
||||
|
|
@ -8,7 +8,7 @@ body:
|
|||
attributes:
|
||||
label: 检查列表 / Checklist
|
||||
options:
|
||||
- label: 我正在使用待办的最新版本 / I am using the latest version of To Do
|
||||
- label: 我正在使用 VerveDo 的最新版本 / I am using the latest version of VerveDo
|
||||
required: true
|
||||
- label: 确认没有之前相似或重复的问题(若重复会直接关闭) / Confirm that there are no similar or duplicate issues previously raised (if duplicate, the issue will be closed directly)
|
||||
required: true
|
||||
|
|
@ -16,8 +16,8 @@ body:
|
|||
- type: dropdown
|
||||
id: version-variant
|
||||
attributes:
|
||||
label: 待办版本类型 / To Do Variant
|
||||
description: 请选择当前待办的版本类型 / Select the version of To Do variant you're currently using
|
||||
label: VerveDo 版本类型 / VerveDo Variant
|
||||
description: 请选择当前 VerveDo 的版本类型 / Select the version of VerveDo variant you're currently using
|
||||
options:
|
||||
- 最新 Release(F-Droid)版 / Latest release (F-Droid)
|
||||
- 最新 CI 版 / Latest CI
|
||||
|
|
@ -27,8 +27,8 @@ body:
|
|||
- type: input
|
||||
id: version-code
|
||||
attributes:
|
||||
label: 待办版本
|
||||
description: 请输入你正在使用的待办版本,你可以在设置中找到 / Enter the version of To Do you're using. You can find this in the settings
|
||||
label: VerveDo 版本
|
||||
description: 请输入你正在使用的 VerveDo 版本,你可以在设置中找到 / Enter the version of VerveDo you're using. You can find this in the settings
|
||||
placeholder: 例如:2.0.2(561) / e.g. 2.0.2(561)
|
||||
validations:
|
||||
required: true
|
||||
|
|
|
|||
2
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
|
|
@ -1,5 +1,5 @@
|
|||
name: 功能请求 / Feature request
|
||||
description: 为待办提出一个新功能 / Suggest an idea for To Do
|
||||
description: 为 VerveDo 提出一个新功能 / Suggest an idea for VerveDo
|
||||
title: "[Feature] "
|
||||
labels: [ "enhancement" ]
|
||||
body:
|
||||
|
|
|
|||
4
.github/workflows/android_ci.yml
vendored
|
|
@ -43,7 +43,7 @@ jobs:
|
|||
run: chmod +x gradlew
|
||||
|
||||
- name: Write sign info
|
||||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && github.repository == 'Super12138/ToDo'
|
||||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && github.repository == 'Super12138/VerveDo'
|
||||
run: |
|
||||
if [ ! -z "${{ secrets.SIGNING_KEY }}" ]; then
|
||||
echo releaseStorePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> gradle.properties
|
||||
|
|
@ -61,7 +61,7 @@ jobs:
|
|||
run: ./gradlew assembleRelease
|
||||
|
||||
- name: Upload APK
|
||||
if: success() && github.event_name != 'pull_request' && github.repository == 'Super12138/ToDo'
|
||||
if: success() && github.event_name != 'pull_request' && github.repository == 'Super12138/VerveDo'
|
||||
uses: actions/upload-artifact@v6.0.0
|
||||
with:
|
||||
name: Release
|
||||
|
|
|
|||
4
.github/workflows/script_build.yml
vendored
|
|
@ -1,4 +1,4 @@
|
|||
name: Todo Script Build
|
||||
name: VerveDo Script Build
|
||||
|
||||
on:
|
||||
push:
|
||||
|
|
@ -37,5 +37,5 @@ jobs:
|
|||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v6.0.0
|
||||
with:
|
||||
name: Todo Script
|
||||
name: VerveDo Script
|
||||
path: ./script/updateVersionCode.js
|
||||
40
README.md
|
|
@ -1,24 +1,28 @@
|
|||

|
||||

|
||||
|
||||
# 待办
|
||||
# VerveDo
|
||||
|
||||
一个简单的、遵循 Material 3 Expressive 的待办应用,使用 Jetpack Compose 编写
|
||||
|
||||
**简体中文** | [English](https://github.com/Super12138/ToDo/blob/main/README_EN.md)
|
||||
**简体中文** | [English](https://github.com/Super12138/VerveDo/blob/main/README_EN.md)
|
||||
|
||||
[](https://github.com/Super12138/ToDo/actions/workflows/android_ci.yml)
|
||||

|
||||

|
||||
[](https://github.com/Super12138/VerveDo/actions/workflows/android_ci.yml)
|
||||

|
||||

|
||||
|
||||
# 📦 版本支持
|
||||
|
||||
支持 `Android 7.0 (Nougat)` 至 `Android 16.0 (Baklava)`
|
||||
|
||||
# 📃 许可证
|
||||
|
||||
[GPL-3.0-only](https://github.com/Super12138/VerveDo/blob/main/LICENSE)
|
||||
|
||||
# ✨ 功能
|
||||
|
||||
- [x] Jetpack Compose
|
||||
|
||||
- [x] 最新的 Material 3 Expressive 设计
|
||||
- [x] Material 3 **Expressive** 设计
|
||||
|
||||
- [x] 任务分类
|
||||
|
||||
|
|
@ -26,16 +30,18 @@
|
|||
|
||||
- [x] 数据备份
|
||||
|
||||
- [ ] 时间划分功能(正在施工中)
|
||||
- [x] 时间划分功能
|
||||
|
||||
- ...
|
||||
|
||||
# ⬇️ 下载
|
||||
|
||||
> [!IMPORTANT]
|
||||
> 下方两个渠道是官方认定的安全渠道,请从这两个渠道下载待办以保证个人隐私不被侵犯。
|
||||
>
|
||||
>
|
||||
> 待办不会自动更新,建议[订阅 GitHub Release 发行通知](https://docs.github.com/zh/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications#configuring-your-watch-settings-for-an-individual-repository)或者[安装 F-Droid](https://f-droid.org/) 检查更新
|
||||
|
||||
[前往 GitHub Release](https://github.com/Super12138/ToDo/releases/)
|
||||
[前往 GitHub Release](https://github.com/Super12138/VerveDo/releases/)
|
||||
|
||||
或者[从 F-Droid 上下载](https://f-droid.org/packages/cn.super12138.todo)
|
||||
|
||||
|
|
@ -43,12 +49,8 @@
|
|||
|
||||
# 📸 截图
|
||||
|
||||
|  |  |
|
||||
| -------------------------------------------------------------- | ---------------------------------------------------------------- |
|
||||
| 主界面(浅色) | 主界面(深色) |
|
||||
|  |  |
|
||||
| 添加待办 | 正在完成待办的效果 |
|
||||
|
||||
# 📃 许可证
|
||||
|
||||
[GPL-3.0-only](https://github.com/Super12138/ToDo/blob/main/LICENSE)
|
||||
|  |  |
|
||||
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
|
||||
| 概览界面(浅色) | 概览界面(深色) |
|
||||
|  |  |
|
||||
| 待办列表 | 添加待办 |
|
||||
|
|
|
|||
60
README_EN.md
|
|
@ -1,41 +1,55 @@
|
|||

|
||||
# To Do
|
||||
A simple to-do app that follows Material Design 3, using Jetpack Compose
|
||||

|
||||
|
||||
[简体中文](https://github.com/Super12138/ToDo/blob/main/README.md) | **English**
|
||||
# VerveDo
|
||||
|
||||
[](https://github.com/Super12138/ToDo/actions/workflows/android_ci.yml)
|
||||

|
||||

|
||||
A simple to-do app that follows Material 3 Expressive, using Jetpack Compose.
|
||||
|
||||
[简体中文](https://github.com/Super12138/VerveDo/blob/main/README.md) | **English**
|
||||
|
||||
[](https://github.com/Super12138/VerveDo/actions/workflows/android_ci.yml)
|
||||

|
||||

|
||||
|
||||
# 📦 Supported Versions
|
||||
|
||||
From `Android 7.0 (Nougat)` to `Android 16.0 (Baklava)`
|
||||
|
||||
# 📃 License
|
||||
|
||||
[GPL-3.0-only](https://github.com/Super12138/VerveDo/blob/main/LICENSE)
|
||||
|
||||
# ✨ Features
|
||||
- Jetpack Compose
|
||||
- Customizable theming system based on Material Design 3
|
||||
- Custom categories
|
||||
- Task priority
|
||||
|
||||
- [x] Jetpack Compose
|
||||
|
||||
- [x] Material 3 **Expressive** Design
|
||||
|
||||
- [x] Task Categorization
|
||||
|
||||
- [x] Task Priority
|
||||
|
||||
- [x] Data Backup
|
||||
|
||||
- [x] Time Segmentation
|
||||
|
||||
- ...
|
||||
|
||||
# ⬇️ Download
|
||||
|
||||
> [!IMPORTANT]
|
||||
> The two download channels below are the official and secure sources for To Do. To protect your privacy, only download the app from these links.
|
||||
> The two download channels below are the official and secure sources for VerveDo. To protect your privacy, only download the app from these links.
|
||||
>
|
||||
> To Do can't update automatically. It is recommended to [subscribe to GitHub Release notifications](https://docs.github.com/en/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications#configuring-your-watch-settings-for-an-individual-repository) or [install F-Droid](https://f-droid.org/) to check for updates.
|
||||
> VerveDo can't update automatically. It is recommended to [subscribe to GitHub Release notifications](https://docs.github.com/en/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications#configuring-your-watch-settings-for-an-individual-repository) or [install F-Droid](https://f-droid.org/) to check for updates.
|
||||
|
||||
[From Github Release](https://github.com/Super12138/ToDo/releases/)
|
||||
[From Github Release](https://github.com/Super12138/VerveDo/releases/)
|
||||
|
||||
Or get it from F-Droid
|
||||
Or get it from [F-Droid](https://f-droid.org/packages/cn.super12138.todo)
|
||||
[<img src="./art/get-it-on-fdroid.png" height="100" />](https://f-droid.org/packages/cn.super12138.todo)
|
||||
|
||||
|
||||
# 📸 Screenshots
|
||||
|  |  |
|
||||
| --- | --- |
|
||||
| Main page (Light) | Main page (Dark) |
|
||||
|  |  |
|
||||
| Add task page | The effect of completing a task |
|
||||
|
||||
# 📃 License
|
||||
[GPL-3.0-only](https://github.com/Super12138/ToDo/blob/main/LICENSE)
|
||||
|  |  |
|
||||
| ---------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
|
||||
| Overview page (Light) | Overview page (Dark) |
|
||||
|  |  |
|
||||
| Task list | Add new task |
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ android {
|
|||
applicationId = "cn.super12138.todo"
|
||||
minSdk = 24
|
||||
targetSdk = 36
|
||||
versionCode = 997
|
||||
versionName = "2.3.3"
|
||||
versionCode = 998
|
||||
versionName = "3.0.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import androidx.compose.ui.graphics.Color
|
|||
import androidx.compose.ui.graphics.Shape
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
object TodoDefaults {
|
||||
object VerveDoDefaults {
|
||||
/**
|
||||
* 屏幕左右两边预留边距(防止内容全部贴边显示过丑)
|
||||
*/
|
||||
|
|
@ -27,7 +27,7 @@ import cn.super12138.todo.constants.Constants
|
|||
import cn.super12138.todo.logic.datastore.DataStoreManager
|
||||
import cn.super12138.todo.logic.model.DarkMode
|
||||
import cn.super12138.todo.logic.model.PaletteStyle
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.components.Konfetti
|
||||
import cn.super12138.todo.ui.navigation.VerveDoDestinations
|
||||
import cn.super12138.todo.ui.navigation.TopNavigation
|
||||
|
|
@ -106,7 +106,7 @@ class MainActivity : ComponentActivity() {
|
|||
dynamicColor = dynamicColor
|
||||
) {
|
||||
Surface(
|
||||
color = TodoDefaults.Colors.Background,
|
||||
color = VerveDoDefaults.Colors.Background,
|
||||
modifier = Modifier.fillMaxSize()
|
||||
) {
|
||||
val view = LocalView.current
|
||||
|
|
@ -140,7 +140,7 @@ class MainActivity : ComponentActivity() {
|
|||
)
|
||||
}
|
||||
},
|
||||
containerColor = TodoDefaults.Colors.Background,
|
||||
containerColor = VerveDoDefaults.Colors.Background,
|
||||
modifier = Modifier.fillMaxSize()
|
||||
) {
|
||||
TopNavigation(
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import androidx.compose.ui.res.painterResource
|
|||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import cn.super12138.todo.R
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
|
||||
enum class EmptyTipType {
|
||||
Search,
|
||||
|
|
@ -36,7 +36,7 @@ fun EmptyTip(
|
|||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = modifier
|
||||
.padding(TodoDefaults.screenHorizontalPadding)
|
||||
.padding(VerveDoDefaults.screenHorizontalPadding)
|
||||
.size(size)
|
||||
.clip(CircleShape)
|
||||
.background(containerColor)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import androidx.compose.ui.res.painterResource
|
|||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import cn.super12138.todo.R
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.utils.VibrationUtils
|
||||
|
||||
/**
|
||||
|
|
@ -130,7 +130,7 @@ fun TopAppBarScaffold(
|
|||
navigationIcon = navigationIcon,
|
||||
actions = actions,
|
||||
colors = TopAppBarDefaults.topAppBarColors(
|
||||
containerColor = TodoDefaults.Colors.Background,
|
||||
containerColor = VerveDoDefaults.Colors.Background,
|
||||
)
|
||||
)
|
||||
},
|
||||
|
|
@ -151,8 +151,8 @@ fun TopAppBarScaffold(
|
|||
floatingActionButton: @Composable () -> Unit = {},
|
||||
floatingActionButtonPosition: FabPosition = FabPosition.End,
|
||||
contentWindowInsets: WindowInsets = ScaffoldDefaults.contentWindowInsets,
|
||||
containerColor: Color = TodoDefaults.Colors.Background,
|
||||
screenShape: Shape = TodoDefaults.ScreenContainerShape,
|
||||
containerColor: Color = VerveDoDefaults.Colors.Background,
|
||||
screenShape: Shape = VerveDoDefaults.ScreenContainerShape,
|
||||
content: @Composable () -> Unit
|
||||
) = Scaffold(
|
||||
modifier = modifier,
|
||||
|
|
@ -166,7 +166,7 @@ fun TopAppBarScaffold(
|
|||
Surface(
|
||||
modifier = Modifier
|
||||
.padding(paddingValues = innerPadding)
|
||||
.padding(horizontal = TodoDefaults.screenHorizontalPadding),
|
||||
.padding(horizontal = VerveDoDefaults.screenHorizontalPadding),
|
||||
color = containerColor,
|
||||
shape = screenShape,
|
||||
content = content
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
|||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
|
||||
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||
@Composable
|
||||
|
|
@ -14,9 +14,9 @@ fun RoundedScreenContainer(
|
|||
content: @Composable () -> Unit,
|
||||
) {
|
||||
Surface(
|
||||
modifier = modifier.padding(horizontal = TodoDefaults.screenHorizontalPadding),
|
||||
color = TodoDefaults.Colors.Background,
|
||||
shape = TodoDefaults.ScreenContainerShape,
|
||||
modifier = modifier.padding(horizontal = VerveDoDefaults.screenHorizontalPadding),
|
||||
color = VerveDoDefaults.Colors.Background,
|
||||
shape = VerveDoDefaults.ScreenContainerShape,
|
||||
content = content
|
||||
)
|
||||
}
|
||||
|
|
@ -36,7 +36,7 @@ import androidx.compose.ui.text.style.TextOverflow
|
|||
import androidx.compose.ui.text.withStyle
|
||||
import androidx.compose.ui.unit.dp
|
||||
import cn.super12138.todo.R
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.activities.CrashActivity.Companion.BEGINNING_CRASH
|
||||
import cn.super12138.todo.ui.activities.CrashActivity.Companion.BRAND_PREFIX
|
||||
import cn.super12138.todo.ui.activities.CrashActivity.Companion.CRASH_TIME_PREFIX
|
||||
|
|
@ -113,7 +113,7 @@ fun CrashPage(
|
|||
Column(
|
||||
modifier = Modifier
|
||||
.padding(innerPadding)
|
||||
.padding(horizontal = TodoDefaults.screenHorizontalPadding)
|
||||
.padding(horizontal = VerveDoDefaults.screenHorizontalPadding)
|
||||
.fillMaxSize()
|
||||
.verticalScroll(scrollState)
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import cn.super12138.todo.R
|
|||
import cn.super12138.todo.constants.Constants
|
||||
import cn.super12138.todo.logic.database.TodoEntity
|
||||
import cn.super12138.todo.logic.datastore.DataStoreManager
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.components.ChipItem
|
||||
import cn.super12138.todo.ui.components.ConfirmDialog
|
||||
import cn.super12138.todo.ui.components.TodoFloatingActionButton
|
||||
|
|
@ -184,7 +184,7 @@ fun SharedTransitionScope.TaskEditorPage(
|
|||
modifier = Modifier.fillMaxSize()
|
||||
) {
|
||||
item(key = 0) {
|
||||
Spacer(modifier = Modifier.size(TodoDefaults.screenVerticalPadding))
|
||||
Spacer(modifier = Modifier.size(VerveDoDefaults.screenVerticalPadding))
|
||||
}
|
||||
|
||||
item(key = 1) {
|
||||
|
|
@ -262,7 +262,7 @@ fun SharedTransitionScope.TaskEditorPage(
|
|||
}
|
||||
|
||||
item(key = 5) {
|
||||
Spacer(modifier = Modifier.size(TodoDefaults.screenVerticalPadding))
|
||||
Spacer(modifier = Modifier.size(VerveDoDefaults.screenVerticalPadding))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,17 @@ class EditorState(val initialTodo: TodoEntity? = null) {
|
|||
object Saver : androidx.compose.runtime.saveable.Saver<EditorState, Any> {
|
||||
override fun SaverScope.save(value: EditorState): Any {
|
||||
return listOf(
|
||||
value.initialTodo,
|
||||
// 避免错误:java.lang.RuntimeException: Parcel: unable to marshal value TodoEntity(...)
|
||||
value.initialTodo?.let {
|
||||
listOf(
|
||||
it.content,
|
||||
it.category,
|
||||
it.isCompleted,
|
||||
it.priority,
|
||||
it.dueDate,
|
||||
it.id
|
||||
)
|
||||
},
|
||||
value.toDoContent,
|
||||
value.isErrorContent,
|
||||
value.selectedCategoryIndex,
|
||||
|
|
@ -93,7 +103,17 @@ class EditorState(val initialTodo: TodoEntity? = null) {
|
|||
|
||||
override fun restore(value: Any): EditorState {
|
||||
val list = value as List<*>
|
||||
val initialTodo = list[0] as? TodoEntity?
|
||||
val initialTodoList = list[0] as? List<*>
|
||||
val initialTodo = initialTodoList?.let {
|
||||
TodoEntity(
|
||||
content = it[0] as String,
|
||||
category = it[1] as String,
|
||||
isCompleted = it[2] as Boolean,
|
||||
priority = it[3] as Float,
|
||||
dueDate = it[4] as Long?,
|
||||
id = it[5] as Int
|
||||
)
|
||||
}
|
||||
return EditorState(initialTodo).apply {
|
||||
toDoContent = list[1] as String
|
||||
isErrorContent = list[2] as Boolean
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import cn.super12138.todo.R
|
||||
import cn.super12138.todo.logic.database.TodoEntity
|
||||
import cn.super12138.todo.ui.components.TopAppBarScaffold
|
||||
import cn.super12138.todo.ui.pages.overview.components.ListCard
|
||||
import cn.super12138.todo.ui.pages.overview.components.ProgressCard
|
||||
|
|
@ -33,15 +34,14 @@ fun OverviewPage(
|
|||
val totalTasks by remember { derivedStateOf { toDos.size } }
|
||||
val completedTasks by remember { derivedStateOf { toDos.count { it.isCompleted } } }
|
||||
|
||||
val todayMillis = SystemUtils.getToday()
|
||||
val todayMillis = SystemUtils.getTodayEightAM()
|
||||
val dayMillis = 24L * 60 * 60 * 1000
|
||||
val todayEnd = todayMillis + dayMillis
|
||||
|
||||
val todayTodo by remember {
|
||||
derivedStateOf {
|
||||
toDos.filter { todo ->
|
||||
val due = todo.dueDate ?: return@filter false
|
||||
due in todayMillis until todayEnd
|
||||
due == todayMillis
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -49,10 +49,16 @@ fun OverviewPage(
|
|||
val nextWeekTodo by remember {
|
||||
derivedStateOf {
|
||||
val weekFromToday = todayMillis + 7 * dayMillis
|
||||
toDos.filter { todo ->
|
||||
val due = todo.dueDate ?: return@filter false
|
||||
due in todayMillis until weekFromToday
|
||||
}
|
||||
toDos
|
||||
.filter { todo ->
|
||||
val due = todo.dueDate ?: return@filter false
|
||||
due in todayMillis..weekFromToday && !todo.isCompleted
|
||||
}
|
||||
.sortedWith(
|
||||
comparator = compareBy<TodoEntity> { it.dueDate }
|
||||
.thenBy { it.category }
|
||||
.thenByDescending { it.priority }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import androidx.compose.ui.unit.dp
|
|||
import cn.super12138.todo.R
|
||||
import cn.super12138.todo.logic.database.TodoEntity
|
||||
import cn.super12138.todo.logic.model.Priority
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.components.EmptyTip
|
||||
import cn.super12138.todo.ui.components.EmptyTipType
|
||||
import cn.super12138.todo.ui.theme.fadeScale
|
||||
|
|
@ -44,18 +44,18 @@ fun ListCard(
|
|||
modifier: Modifier = Modifier,
|
||||
title: String,
|
||||
list: List<TodoEntity>,
|
||||
containerColor: Color = TodoDefaults.Colors.Container,
|
||||
containerColor: Color = VerveDoDefaults.Colors.Container,
|
||||
emptyTipContainerColor: Color = MaterialTheme.colorScheme.secondaryContainer
|
||||
) {
|
||||
Card(
|
||||
modifier = modifier.height(TodoDefaults.overviewCardHeight * 2),
|
||||
modifier = modifier.height(VerveDoDefaults.overviewCardHeight * 2),
|
||||
colors = CardDefaults.cardColors(containerColor = containerColor),
|
||||
shape = TodoDefaults.defaultShape
|
||||
shape = VerveDoDefaults.defaultShape
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(TodoDefaults.screenHorizontalPadding),
|
||||
.padding(VerveDoDefaults.screenHorizontalPadding),
|
||||
horizontalAlignment = Alignment.Start,
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
|
|
@ -123,7 +123,7 @@ fun UpcomingTaskItem(
|
|||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.wrapContentHeight()
|
||||
.padding(vertical = TodoDefaults.settingsItemVerticalPadding / 4),
|
||||
.padding(vertical = VerveDoDefaults.settingsItemVerticalPadding / 4),
|
||||
horizontalAlignment = Alignment.Start
|
||||
) {
|
||||
Row(
|
||||
|
|
@ -145,7 +145,7 @@ fun UpcomingTaskItem(
|
|||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
fontWeight = FontWeight.Bold
|
||||
),
|
||||
modifier = Modifier.padding(start = TodoDefaults.screenVerticalPadding)
|
||||
modifier = Modifier.padding(start = VerveDoDefaults.screenVerticalPadding)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ fun UpcomingTaskItem(
|
|||
Text(
|
||||
text = stringResource(priority.nameRes),
|
||||
style = MaterialTheme.typography.labelMedium.copy(priority.containerColor()),
|
||||
modifier = Modifier.padding(start = TodoDefaults.screenVerticalPadding)
|
||||
modifier = Modifier.padding(start = VerveDoDefaults.screenVerticalPadding)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import androidx.compose.ui.res.stringResource
|
|||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import cn.super12138.todo.R
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.components.EmptyTip
|
||||
import cn.super12138.todo.ui.components.EmptyTipType
|
||||
import cn.super12138.todo.ui.theme.fadeScale
|
||||
|
|
@ -43,20 +43,20 @@ fun ProgressCard(
|
|||
title: String,
|
||||
total: Int,
|
||||
completed: Int,
|
||||
containerColor: Color = TodoDefaults.Colors.Container,
|
||||
containerColor: Color = VerveDoDefaults.Colors.Container,
|
||||
emptyTipContainerColor: Color = MaterialTheme.colorScheme.secondaryContainer
|
||||
) {
|
||||
val progress = if (total == 0) 0f else completed / total.toFloat()
|
||||
|
||||
Card(
|
||||
modifier = modifier.height(TodoDefaults.overviewCardHeight * 2),
|
||||
modifier = modifier.height(VerveDoDefaults.overviewCardHeight * 2),
|
||||
colors = CardDefaults.cardColors(containerColor = containerColor),
|
||||
shape = TodoDefaults.defaultShape
|
||||
shape = VerveDoDefaults.defaultShape
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(TodoDefaults.screenHorizontalPadding),
|
||||
.padding(VerveDoDefaults.screenHorizontalPadding),
|
||||
horizontalAlignment = Alignment.Start,
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
|
|
@ -112,7 +112,7 @@ fun ProgressCard(
|
|||
stroke = thickStroke,
|
||||
trackStroke = thickStroke,
|
||||
modifier = Modifier
|
||||
.padding(TodoDefaults.screenHorizontalPadding)
|
||||
.padding(VerveDoDefaults.screenHorizontalPadding)
|
||||
.size(90.dp)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import androidx.compose.ui.graphics.ColorProducer
|
|||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.theme.shapeByInteraction
|
||||
|
||||
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||
|
|
@ -41,17 +41,17 @@ fun RoundedCornerCardLarge(
|
|||
@DrawableRes iconRes: Int,
|
||||
title: String,
|
||||
count: Int,
|
||||
containerColor: Color = TodoDefaults.Colors.Container,
|
||||
shapes: ButtonShapes = TodoDefaults.shapes(),
|
||||
containerColor: Color = VerveDoDefaults.Colors.Container,
|
||||
shapes: ButtonShapes = VerveDoDefaults.shapes(),
|
||||
onClick: () -> Unit = {}
|
||||
) {
|
||||
val interactionSource = remember { MutableInteractionSource() }
|
||||
val pressed by interactionSource.collectIsPressedAsState()
|
||||
val animatedShape = shapeByInteraction(shapes, pressed, TodoDefaults.shapesDefaultAnimationSpec)
|
||||
val animatedShape = shapeByInteraction(shapes, pressed, VerveDoDefaults.shapesDefaultAnimationSpec)
|
||||
|
||||
val cardColors = CardDefaults.cardColors(containerColor = containerColor)
|
||||
Card(
|
||||
modifier = modifier.height(TodoDefaults.overviewCardHeight),
|
||||
modifier = modifier.height(VerveDoDefaults.overviewCardHeight),
|
||||
colors = cardColors,
|
||||
shape = animatedShape
|
||||
) {
|
||||
|
|
@ -63,7 +63,7 @@ fun RoundedCornerCardLarge(
|
|||
onClick = onClick,
|
||||
interactionSource = interactionSource
|
||||
)
|
||||
.padding(TodoDefaults.screenHorizontalPadding),
|
||||
.padding(VerveDoDefaults.screenHorizontalPadding),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(16.dp)
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ fun SettingsData(
|
|||
title = stringResource(R.string.pref_backup),
|
||||
description = stringResource(R.string.pref_backup_desc),
|
||||
onClick = {
|
||||
backupLauncher.launch("Todo-backup-${SystemUtils.getTime()}.zip")
|
||||
backupLauncher.launch("VerveDo-backup-${SystemUtils.getTime()}.zip")
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import androidx.compose.ui.graphics.graphicsLayer
|
|||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.utils.drawFadedEdge
|
||||
|
||||
@Composable
|
||||
|
|
@ -37,12 +37,12 @@ fun RowSettingsItem(
|
|||
title: String,
|
||||
description: String? = null,
|
||||
trailingContent: (@Composable () -> Unit)? = null,
|
||||
background: Color = TodoDefaults.Colors.Container,
|
||||
background: Color = VerveDoDefaults.Colors.Container,
|
||||
horizontalArrangement: Arrangement.Horizontal = Arrangement.Start,
|
||||
verticalAlignment: Alignment.Vertical = Alignment.Top,
|
||||
scrollState: ScrollState = rememberScrollState(),
|
||||
fadedEdgeWidth: Dp,
|
||||
maskColor: Color = TodoDefaults.Colors.Container,
|
||||
maskColor: Color = VerveDoDefaults.Colors.Container,
|
||||
content: @Composable RowScope.() -> Unit
|
||||
) {
|
||||
MoreContentSettingsItem(
|
||||
|
|
@ -88,11 +88,11 @@ fun LazyRowSettingsItem(
|
|||
title: String,
|
||||
description: String? = null,
|
||||
trailingContent: (@Composable () -> Unit)? = null,
|
||||
background: Color = TodoDefaults.Colors.Container,
|
||||
background: Color = VerveDoDefaults.Colors.Container,
|
||||
horizontalArrangement: Arrangement.Horizontal = Arrangement.Start,
|
||||
verticalAlignment: Alignment.Vertical = Alignment.Top,
|
||||
fadedEdgeWidth: Dp,
|
||||
maskColor: Color = TodoDefaults.Colors.Container,
|
||||
maskColor: Color = VerveDoDefaults.Colors.Container,
|
||||
content: LazyListScope.() -> Unit
|
||||
) {
|
||||
MoreContentSettingsItem(
|
||||
|
|
@ -137,8 +137,8 @@ fun MoreContentSettingsItem(
|
|||
title: String,
|
||||
description: String? = null,
|
||||
trailingContent: (@Composable () -> Unit)? = null,
|
||||
background: Color = TodoDefaults.Colors.Container,
|
||||
shape: CornerBasedShape = TodoDefaults.defaultShape,
|
||||
background: Color = VerveDoDefaults.Colors.Container,
|
||||
shape: CornerBasedShape = VerveDoDefaults.defaultShape,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
Column(
|
||||
|
|
@ -148,8 +148,8 @@ fun MoreContentSettingsItem(
|
|||
.clip(shape)
|
||||
.background(background)
|
||||
.padding(
|
||||
horizontal = TodoDefaults.settingsItemHorizontalPadding,
|
||||
vertical = TodoDefaults.settingsItemVerticalPadding
|
||||
horizontal = VerveDoDefaults.settingsItemHorizontalPadding,
|
||||
vertical = VerveDoDefaults.settingsItemVerticalPadding
|
||||
)
|
||||
) {
|
||||
Row {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
|
||||
@Composable
|
||||
fun SettingsCategory(
|
||||
|
|
@ -21,10 +21,10 @@ fun SettingsCategory(
|
|||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.padding(
|
||||
top = if (first) 0.dp else TodoDefaults.screenVerticalPadding,
|
||||
start = TodoDefaults.screenHorizontalPadding / 2,
|
||||
end = TodoDefaults.screenHorizontalPadding / 2,
|
||||
bottom = TodoDefaults.screenVerticalPadding
|
||||
top = if (first) 0.dp else VerveDoDefaults.screenVerticalPadding,
|
||||
start = VerveDoDefaults.screenHorizontalPadding / 2,
|
||||
end = VerveDoDefaults.screenHorizontalPadding / 2,
|
||||
bottom = VerveDoDefaults.screenVerticalPadding
|
||||
)
|
||||
) {
|
||||
Text(
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import androidx.compose.foundation.lazy.LazyListState
|
|||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
|
||||
@Composable
|
||||
fun SettingsContainer(
|
||||
|
|
@ -18,18 +18,18 @@ fun SettingsContainer(
|
|||
content: LazyListScope.() -> Unit,
|
||||
) {
|
||||
LazyColumn(
|
||||
verticalArrangement = Arrangement.spacedBy(TodoDefaults.settingsItemPadding),
|
||||
verticalArrangement = Arrangement.spacedBy(VerveDoDefaults.settingsItemPadding),
|
||||
state = state,
|
||||
modifier = modifier
|
||||
) {
|
||||
item {
|
||||
Spacer(modifier = Modifier.size(TodoDefaults.screenVerticalPadding))
|
||||
Spacer(modifier = Modifier.size(VerveDoDefaults.screenVerticalPadding))
|
||||
}
|
||||
|
||||
content()
|
||||
|
||||
item {
|
||||
Spacer(modifier = Modifier.size(TodoDefaults.screenVerticalPadding))
|
||||
Spacer(modifier = Modifier.size(VerveDoDefaults.screenVerticalPadding))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -25,7 +25,7 @@ import androidx.compose.ui.draw.clip
|
|||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.semantics.Role
|
||||
import androidx.compose.ui.unit.dp
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.components.BasicDialog
|
||||
import cn.super12138.todo.ui.theme.shapeByInteraction
|
||||
import cn.super12138.todo.utils.VibrationUtils
|
||||
|
|
@ -86,9 +86,9 @@ fun RadioItem(
|
|||
.height(56.dp)
|
||||
.clip(
|
||||
shapeByInteraction(
|
||||
shapes = TodoDefaults.shapes(),
|
||||
shapes = VerveDoDefaults.shapes(),
|
||||
pressed = pressed,
|
||||
animationSpec = TodoDefaults.shapesDefaultAnimationSpec
|
||||
animationSpec = VerveDoDefaults.shapesDefaultAnimationSpec
|
||||
)
|
||||
)
|
||||
// .background(MaterialTheme.colorScheme.surfaceContainerHighest)
|
||||
|
|
@ -101,7 +101,7 @@ fun RadioItem(
|
|||
},
|
||||
role = Role.RadioButton
|
||||
)
|
||||
.padding(horizontal = TodoDefaults.screenHorizontalPadding),
|
||||
.padding(horizontal = VerveDoDefaults.screenHorizontalPadding),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
RadioButton(
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import androidx.compose.ui.platform.LocalView
|
|||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.sp
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.theme.shapeByInteraction
|
||||
import cn.super12138.todo.utils.VibrationUtils
|
||||
|
||||
|
|
@ -61,8 +61,8 @@ fun SettingsItem(
|
|||
title: String,
|
||||
description: String? = null,
|
||||
trailingContent: (@Composable () -> Unit)? = null,
|
||||
background: Color = TodoDefaults.Colors.Container,
|
||||
shapes: ButtonShapes = TodoDefaults.shapes(),
|
||||
background: Color = VerveDoDefaults.Colors.Container,
|
||||
shapes: ButtonShapes = VerveDoDefaults.shapes(),
|
||||
enableClick: Boolean = true,
|
||||
onClick: () -> Unit = {}
|
||||
) = SettingsItem(
|
||||
|
|
@ -82,7 +82,7 @@ fun SettingsItem(
|
|||
painter = leadingIcon,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSurface,
|
||||
modifier = Modifier.padding(end = TodoDefaults.settingsItemHorizontalPadding)
|
||||
modifier = Modifier.padding(end = VerveDoDefaults.settingsItemHorizontalPadding)
|
||||
)
|
||||
// }
|
||||
}
|
||||
|
|
@ -125,8 +125,8 @@ fun SettingsItem(
|
|||
title: String,
|
||||
description: String? = null,
|
||||
trailingContent: (@Composable () -> Unit)? = null,
|
||||
background: Color = TodoDefaults.Colors.Container,
|
||||
shapes: ButtonShapes = TodoDefaults.shapes(),
|
||||
background: Color = VerveDoDefaults.Colors.Container,
|
||||
shapes: ButtonShapes = VerveDoDefaults.shapes(),
|
||||
enableClick: Boolean = true,
|
||||
onClick: () -> Unit = {}
|
||||
) = SettingsItem(
|
||||
|
|
@ -136,7 +136,7 @@ fun SettingsItem(
|
|||
imageVector = it,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSurface,
|
||||
modifier = Modifier.padding(end = TodoDefaults.settingsItemHorizontalPadding),
|
||||
modifier = Modifier.padding(end = VerveDoDefaults.settingsItemHorizontalPadding),
|
||||
)
|
||||
}
|
||||
},
|
||||
|
|
@ -159,8 +159,8 @@ fun SettingsItem(
|
|||
title: String,
|
||||
description: String? = null,
|
||||
trailingContent: (@Composable () -> Unit)? = null,
|
||||
background: Color = TodoDefaults.Colors.Container,
|
||||
shapes: ButtonShapes = TodoDefaults.shapes(),
|
||||
background: Color = VerveDoDefaults.Colors.Container,
|
||||
shapes: ButtonShapes = VerveDoDefaults.shapes(),
|
||||
enableClick: Boolean = true,
|
||||
onClick: () -> Unit = {},
|
||||
) = SettingsItem(
|
||||
|
|
@ -204,8 +204,8 @@ fun SettingsItem(
|
|||
headlineContent: (@Composable () -> Unit)? = null,
|
||||
supportingContent: (@Composable () -> Unit)? = null,
|
||||
trailingContent: (@Composable () -> Unit)? = null,
|
||||
background: Color = TodoDefaults.Colors.Container,
|
||||
shapes: ButtonShapes = TodoDefaults.shapes(),
|
||||
background: Color = VerveDoDefaults.Colors.Container,
|
||||
shapes: ButtonShapes = VerveDoDefaults.shapes(),
|
||||
interactionSource: MutableInteractionSource? = null,
|
||||
enableClick: Boolean = true,
|
||||
onClick: () -> Unit = {},
|
||||
|
|
@ -213,7 +213,7 @@ fun SettingsItem(
|
|||
val view = LocalView.current
|
||||
val userInteractionSource = interactionSource ?: remember { MutableInteractionSource() }
|
||||
val pressed by userInteractionSource.collectIsPressedAsState()
|
||||
val animatedShape = shapeByInteraction(shapes, pressed, TodoDefaults.shapesDefaultAnimationSpec)
|
||||
val animatedShape = shapeByInteraction(shapes, pressed, VerveDoDefaults.shapesDefaultAnimationSpec)
|
||||
|
||||
Row(
|
||||
modifier = modifier
|
||||
|
|
@ -230,8 +230,8 @@ fun SettingsItem(
|
|||
)
|
||||
.background(background)
|
||||
.padding(
|
||||
horizontal = TodoDefaults.settingsItemHorizontalPadding,
|
||||
vertical = TodoDefaults.settingsItemVerticalPadding
|
||||
horizontal = VerveDoDefaults.settingsItemHorizontalPadding,
|
||||
vertical = VerveDoDefaults.settingsItemVerticalPadding
|
||||
),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import androidx.compose.ui.semantics.clearAndSetSemantics
|
|||
import androidx.compose.ui.semantics.contentDescription
|
||||
import androidx.compose.ui.unit.dp
|
||||
import cn.super12138.todo.R
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
|
||||
@Composable
|
||||
fun SettingsPlainBox(
|
||||
|
|
@ -30,8 +30,8 @@ fun SettingsPlainBox(
|
|||
.fillMaxWidth()
|
||||
.wrapContentHeight()
|
||||
.padding(
|
||||
vertical = TodoDefaults.settingsItemVerticalPadding,
|
||||
horizontal = TodoDefaults.settingsItemHorizontalPadding / 2
|
||||
vertical = VerveDoDefaults.settingsItemVerticalPadding,
|
||||
horizontal = VerveDoDefaults.settingsItemHorizontalPadding / 2
|
||||
),
|
||||
) {
|
||||
Icon(
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.utils.VibrationUtils
|
||||
|
||||
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||
|
|
@ -30,7 +30,7 @@ fun SwitchSettingsItem(
|
|||
Switch(
|
||||
checked = checked,
|
||||
onCheckedChange = null,
|
||||
modifier = Modifier.padding(start = TodoDefaults.settingsItemHorizontalPadding / 2)
|
||||
modifier = Modifier.padding(start = VerveDoDefaults.settingsItemHorizontalPadding / 2)
|
||||
)
|
||||
},
|
||||
onClick = { onCheckedChange(!checked) },
|
||||
|
|
@ -60,7 +60,7 @@ fun SwitchSettingsItem(
|
|||
VibrationUtils.performHapticFeedback(view)
|
||||
onCheckedChange(it)
|
||||
},
|
||||
modifier = Modifier.padding(start = TodoDefaults.settingsItemHorizontalPadding / 2)
|
||||
modifier = Modifier.padding(start = VerveDoDefaults.settingsItemHorizontalPadding / 2)
|
||||
)
|
||||
},
|
||||
onClick = { onCheckedChange(!checked) },
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import androidx.compose.ui.platform.LocalView
|
|||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.semantics.Role
|
||||
import androidx.compose.ui.unit.dp
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.theme.shapeByInteraction
|
||||
import cn.super12138.todo.utils.VibrationUtils
|
||||
|
||||
|
|
@ -42,13 +42,13 @@ fun DarkModeItem(
|
|||
containerColor: Color,
|
||||
selected: Boolean,
|
||||
onSelect: () -> Unit,
|
||||
shapes: ButtonShapes = TodoDefaults.shapes()
|
||||
shapes: ButtonShapes = VerveDoDefaults.shapes()
|
||||
) {
|
||||
val view = LocalView.current
|
||||
|
||||
val interactionSource = remember { MutableInteractionSource() }
|
||||
val pressed by interactionSource.collectIsPressedAsState()
|
||||
val animatedShape = shapeByInteraction(shapes, pressed, TodoDefaults.shapesDefaultAnimationSpec)
|
||||
val animatedShape = shapeByInteraction(shapes, pressed, VerveDoDefaults.shapesDefaultAnimationSpec)
|
||||
|
||||
val borderWidth by animateDpAsState(if (selected) 3.dp else (-1).dp)
|
||||
Column(
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import androidx.compose.ui.res.stringResource
|
|||
import androidx.compose.ui.unit.dp
|
||||
import cn.super12138.todo.R
|
||||
import cn.super12138.todo.logic.model.DarkMode
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.pages.settings.components.LazyRowSettingsItem
|
||||
|
||||
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||
|
|
@ -32,7 +32,7 @@ fun DarkModePicker(
|
|||
title = stringResource(R.string.pref_dark_mode),
|
||||
description = stringResource(R.string.pref_dark_mode_desc),
|
||||
horizontalArrangement = Arrangement.spacedBy(5.dp),
|
||||
fadedEdgeWidth = TodoDefaults.fadedEdgeWidth,
|
||||
fadedEdgeWidth = VerveDoDefaults.fadedEdgeWidth,
|
||||
modifier = modifier
|
||||
) {
|
||||
items(items = darkModeList, key = { it.id }) {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import androidx.compose.ui.unit.dp
|
|||
import androidx.compose.ui.util.fastForEach
|
||||
import cn.super12138.todo.logic.model.ContrastLevel
|
||||
import cn.super12138.todo.logic.model.PaletteStyle
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.theme.dynamicColorScheme
|
||||
import cn.super12138.todo.ui.theme.shapeByInteraction
|
||||
import cn.super12138.todo.utils.VibrationUtils
|
||||
|
|
@ -50,12 +50,12 @@ fun PaletteItem(
|
|||
contrastLevel: ContrastLevel,
|
||||
selected: Boolean,
|
||||
onSelect: () -> Unit,
|
||||
shapes: ButtonShapes = TodoDefaults.shapes()
|
||||
shapes: ButtonShapes = VerveDoDefaults.shapes()
|
||||
) {
|
||||
val view = LocalView.current
|
||||
val interactionSource = remember { MutableInteractionSource() }
|
||||
val pressed by interactionSource.collectIsPressedAsState()
|
||||
val animatedShape = shapeByInteraction(shapes, pressed, TodoDefaults.shapesDefaultAnimationSpec)
|
||||
val animatedShape = shapeByInteraction(shapes, pressed, VerveDoDefaults.shapesDefaultAnimationSpec)
|
||||
|
||||
Column(
|
||||
modifier = modifier
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import cn.super12138.todo.R
|
|||
import cn.super12138.todo.logic.model.ContrastLevel
|
||||
import cn.super12138.todo.logic.model.DarkMode
|
||||
import cn.super12138.todo.logic.model.PaletteStyle
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.pages.settings.components.LazyRowSettingsItem
|
||||
|
||||
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||
|
|
@ -34,7 +34,7 @@ fun PalettePicker(
|
|||
title = stringResource(R.string.pref_palette_style),
|
||||
description = stringResource(R.string.pref_palette_style_desc),
|
||||
horizontalArrangement = Arrangement.spacedBy(5.dp),
|
||||
fadedEdgeWidth = TodoDefaults.fadedEdgeWidth,
|
||||
fadedEdgeWidth = VerveDoDefaults.fadedEdgeWidth,
|
||||
modifier = modifier
|
||||
) {
|
||||
items(items = paletteOptions, key = { it.id }) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import cn.super12138.todo.R
|
|||
import cn.super12138.todo.constants.Constants
|
||||
import cn.super12138.todo.logic.database.TodoEntity
|
||||
import cn.super12138.todo.logic.model.Priority
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.components.ConfirmDialog
|
||||
import cn.super12138.todo.ui.components.EmptyTip
|
||||
import cn.super12138.todo.ui.components.EmptyTipType
|
||||
|
|
@ -168,11 +168,11 @@ fun SharedTransitionScope.TasksPage(
|
|||
} else {
|
||||
LazyColumn(
|
||||
state = viewModel.toDoListState,
|
||||
verticalArrangement = Arrangement.spacedBy(TodoDefaults.settingsItemPadding),
|
||||
verticalArrangement = Arrangement.spacedBy(VerveDoDefaults.settingsItemPadding),
|
||||
modifier = Modifier.fillMaxSize()
|
||||
) {
|
||||
item {
|
||||
Spacer(modifier = Modifier.size(TodoDefaults.screenVerticalPadding))
|
||||
Spacer(modifier = Modifier.size(VerveDoDefaults.screenVerticalPadding))
|
||||
}
|
||||
|
||||
items(
|
||||
|
|
@ -214,7 +214,7 @@ fun SharedTransitionScope.TasksPage(
|
|||
}
|
||||
|
||||
item {
|
||||
Spacer(modifier = Modifier.size(TodoDefaults.screenVerticalPadding))
|
||||
Spacer(modifier = Modifier.size(VerveDoDefaults.screenVerticalPadding))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ import androidx.compose.ui.text.style.TextOverflow
|
|||
import androidx.compose.ui.unit.dp
|
||||
import cn.super12138.todo.R
|
||||
import cn.super12138.todo.logic.model.Priority
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.theme.shapeByInteraction
|
||||
import cn.super12138.todo.utils.VibrationUtils
|
||||
import cn.super12138.todo.utils.containerColor
|
||||
|
|
@ -71,11 +71,11 @@ fun TodoCard(
|
|||
onCardClick: () -> Unit = {},
|
||||
onCardLongClick: () -> Unit = {},
|
||||
onChecked: () -> Unit = {},
|
||||
shapes: ButtonShapes = TodoDefaults.shapes(),
|
||||
shapes: ButtonShapes = VerveDoDefaults.shapes(),
|
||||
) {
|
||||
val view = LocalView.current
|
||||
val context = LocalContext.current
|
||||
val cardColors = CardDefaults.cardColors(containerColor = TodoDefaults.Colors.Container)
|
||||
val cardColors = CardDefaults.cardColors(containerColor = VerveDoDefaults.Colors.Container)
|
||||
val animatedContainerColor by animateColorAsState(targetValue = if (selected) MaterialTheme.colorScheme.secondaryContainer else if (completed) cardColors.disabledContainerColor else cardColors.containerColor)
|
||||
|
||||
val interactionSource = remember { MutableInteractionSource() }
|
||||
|
|
@ -83,7 +83,7 @@ fun TodoCard(
|
|||
val animatedShape = shapeByInteraction(
|
||||
shapes = shapes,
|
||||
pressed = if (selected) true else pressed,
|
||||
animationSpec = TodoDefaults.shapesDefaultAnimationSpec
|
||||
animationSpec = VerveDoDefaults.shapesDefaultAnimationSpec
|
||||
)
|
||||
|
||||
val enterTransition = fadeIn(MaterialTheme.motionScheme.fastSpatialSpec()) + expandHorizontally(
|
||||
|
|
@ -97,7 +97,7 @@ fun TodoCard(
|
|||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.height(TodoDefaults.toDoCardHeight)
|
||||
.height(VerveDoDefaults.toDoCardHeight)
|
||||
.clip(animatedShape)
|
||||
.combinedClickable(
|
||||
interactionSource = interactionSource,
|
||||
|
|
@ -112,7 +112,7 @@ fun TodoCard(
|
|||
.drawBehind {
|
||||
drawRect(animatedContainerColor)
|
||||
}
|
||||
.padding(start = TodoDefaults.screenHorizontalPadding)
|
||||
.padding(start = VerveDoDefaults.screenHorizontalPadding)
|
||||
) {
|
||||
AnimatedVisibility(
|
||||
visible = selected,
|
||||
|
|
@ -159,14 +159,14 @@ fun TodoCard(
|
|||
Column(
|
||||
horizontalAlignment = Alignment.End,
|
||||
modifier = Modifier.padding(
|
||||
start = TodoDefaults.screenVerticalPadding,
|
||||
end = TodoDefaults.screenHorizontalPadding
|
||||
start = VerveDoDefaults.screenVerticalPadding,
|
||||
end = VerveDoDefaults.screenHorizontalPadding
|
||||
)
|
||||
) {
|
||||
Text(
|
||||
text = dueDate.toLocalDateString(),
|
||||
style = MaterialTheme.typography.labelLarge.copy(
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
color = if (completed) cardColors.disabledContentColor else MaterialTheme.colorScheme.onSurface,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
)
|
||||
|
|
@ -174,7 +174,7 @@ fun TodoCard(
|
|||
Text(
|
||||
text = dueDate.toRelativeTimeString(context),
|
||||
style = MaterialTheme.typography.labelSmall.copy(
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
color = if (completed) cardColors.disabledContentColor else MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
@ -211,7 +211,7 @@ fun TodoCard(
|
|||
contentAlignment = Alignment.Center,
|
||||
modifier = Modifier
|
||||
.fillMaxHeight()
|
||||
.background(TodoDefaults.Colors.Green)
|
||||
.background(VerveDoDefaults.Colors.Green)
|
||||
.clickable {
|
||||
VibrationUtils.performHapticFeedback(view)
|
||||
onChecked()
|
||||
|
|
@ -221,7 +221,7 @@ fun TodoCard(
|
|||
painter = painterResource(R.drawable.ic_check),
|
||||
tint = Color.White,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.padding(TodoDefaults.screenHorizontalPadding)
|
||||
modifier = Modifier.padding(VerveDoDefaults.screenHorizontalPadding)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import androidx.compose.ui.res.stringResource
|
|||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import cn.super12138.todo.R
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.VerveDoDefaults
|
||||
import cn.super12138.todo.ui.theme.fadeScale
|
||||
import cn.super12138.todo.utils.VibrationUtils
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ fun TodoTopAppBar(
|
|||
targetValue = if (selectedMode) {
|
||||
MaterialTheme.colorScheme.surfaceContainerHighest
|
||||
} else {
|
||||
TodoDefaults.Colors.Background
|
||||
VerveDoDefaults.Colors.Background
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ class MainViewModel : ViewModel() {
|
|||
|
||||
SortingMethod.DueDate -> list.sortedWith(
|
||||
comparator = compareBy<TodoEntity> { it.isCompleted }
|
||||
.thenBy { it.category }
|
||||
.thenBy { it.dueDate }
|
||||
.thenByDescending { it.priority }
|
||||
)
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@ object SystemUtils {
|
|||
/**
|
||||
* 获取当天的时间戳
|
||||
*/
|
||||
fun getToday(): Long = Calendar.getInstance().apply {
|
||||
fun getTodayEightAM(): Long = Calendar.getInstance().apply {
|
||||
// 将时间设置为当天的开始(00:00:00.000)
|
||||
// 兼容API24
|
||||
set(Calendar.HOUR_OF_DAY, 0)
|
||||
set(Calendar.HOUR_OF_DAY, 8)
|
||||
set(Calendar.MINUTE, 0)
|
||||
set(Calendar.SECOND, 0)
|
||||
set(Calendar.MILLISECOND, 0)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import androidx.compose.ui.unit.Dp
|
|||
import cn.super12138.todo.R
|
||||
import cn.super12138.todo.logic.model.Priority
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Calendar
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
import kotlin.time.Duration.Companion.days
|
||||
|
|
@ -25,8 +24,8 @@ import kotlin.time.Duration.Companion.milliseconds
|
|||
@Stable
|
||||
fun Priority.containerColor(): Color =
|
||||
when (this) {
|
||||
Priority.NotUrgent -> MaterialTheme.colorScheme.surfaceContainerHighest
|
||||
Priority.NotImportant -> MaterialTheme.colorScheme.surfaceContainerHighest
|
||||
Priority.NotUrgent -> MaterialTheme.colorScheme.onSurfaceVariant
|
||||
Priority.NotImportant -> MaterialTheme.colorScheme.onSurfaceVariant
|
||||
Priority.Default -> MaterialTheme.colorScheme.secondary
|
||||
Priority.Important -> MaterialTheme.colorScheme.tertiary
|
||||
Priority.Urgent -> MaterialTheme.colorScheme.error
|
||||
|
|
@ -100,14 +99,7 @@ fun Long?.toLocalDateString(): String {
|
|||
*/
|
||||
fun Long?.toRelativeTimeString(context: Context): String {
|
||||
if (this == null) return ""
|
||||
val today = Calendar.getInstance().apply {
|
||||
// 将时间设置为当天的开始(00:00:00.000)
|
||||
// 兼容API24
|
||||
set(Calendar.HOUR_OF_DAY, 0)
|
||||
set(Calendar.MINUTE, 0)
|
||||
set(Calendar.SECOND, 0)
|
||||
set(Calendar.MILLISECOND, 0)
|
||||
}.timeInMillis
|
||||
val today = SystemUtils.getTodayEightAM()
|
||||
val diff = (this - today).milliseconds
|
||||
|
||||
return diff.toComponents { days, _, _, _, _ ->
|
||||
|
|
@ -129,6 +121,27 @@ fun Long?.toRelativeTimeString(context: Context): String {
|
|||
)
|
||||
|
||||
days.days >= 365.days -> context.getString(R.string.time_in_years, (days / 365).toInt())
|
||||
days.days == (-1).days -> context.getString(R.string.time_yesterday)
|
||||
days.days < (-1).days && days.days > (-7).days -> context.getString(
|
||||
R.string.time_days_ago,
|
||||
-days.toInt()
|
||||
)
|
||||
|
||||
days.days in (-7).days..<(-30).days -> context.getString(
|
||||
R.string.time_weeks_ago,
|
||||
-(days / 7).toInt()
|
||||
)
|
||||
|
||||
days.days in (-30).days..<(-365).days -> context.getString(
|
||||
R.string.time_months_ago,
|
||||
-(days / 30).toInt()
|
||||
)
|
||||
|
||||
days.days <= (-365).days -> context.getString(
|
||||
R.string.time_years_ago,
|
||||
-(days / 365).toInt()
|
||||
)
|
||||
|
||||
else -> context.getString(R.string.time_today)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,6 +124,11 @@
|
|||
<string name="time_in_weeks">%d 周后</string>
|
||||
<string name="time_in_months">%d 个月后</string>
|
||||
<string name="time_in_years">%d 年后</string>
|
||||
<string name="time_yesterday">昨天</string>
|
||||
<string name="time_days_ago">%d 天前</string>
|
||||
<string name="time_weeks_ago">%d 周前</string>
|
||||
<string name="time_months_ago">%d 个月前</string>
|
||||
<string name="time_years_ago">%d 年前</string>
|
||||
<string name="label_due_date">截止日期(可选)</string>
|
||||
<string name="title_all_task">总任务</string>
|
||||
<string name="title_completed_task">已完成</string>
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@
|
|||
<string name="pref_view_on_github_desc">View source code, submit bug reports, and improvement suggestions</string>
|
||||
<string name="tip_discard_changes">After exiting edit mode, you will not be able to retrieve the data you have modified. Are you sure you want to exit editing?</string>
|
||||
<string name="sorting_sequential">Sequential</string>
|
||||
<string name="sorting_category">category</string>
|
||||
<string name="sorting_category">Category</string>
|
||||
<string name="sorting_priority">Priority</string>
|
||||
<string name="sorting_completion">Completion</string>
|
||||
<string name="sorting_alphabetical_ascending">Alphabetical (Ascending)</string>
|
||||
|
|
@ -126,6 +126,11 @@
|
|||
<string name="time_in_weeks">in %d w</string>
|
||||
<string name="time_in_months">in %d mo</string>
|
||||
<string name="time_in_years">in %d y</string>
|
||||
<string name="time_yesterday">Yesterday</string>
|
||||
<string name="time_days_ago">%d d ago</string>
|
||||
<string name="time_weeks_ago">%d w ago</string>
|
||||
<string name="time_months_ago">%d mo ago</string>
|
||||
<string name="time_years_ago">%d y ago</string>
|
||||
<string name="label_due_date">Due Date (Optional)</string>
|
||||
<string name="title_all_task">All</string>
|
||||
<string name="title_completed_task">Completed</string>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
A simple to-do app that follows Material Design 3. You can use it to keep track of your daily school homeworks or as a memo for everyday life. You can set priorities to each task and sort them, helping you stay organized and in control of your life.
|
||||
VerveDo is a concise to-do app that follows Material 3 Expressive. You can use it to keep track of your daily school homeworks or as a memo for everyday life. You can set priorities to each task and sort them, helping you stay organized and in control of your life.
|
||||
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 140 KiB After Width: | Height: | Size: 259 KiB |
|
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 255 KiB |
|
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 317 KiB |
|
Before Width: | Height: | Size: 244 KiB After Width: | Height: | Size: 610 KiB |
|
Before Width: | Height: | Size: 616 KiB After Width: | Height: | Size: 152 KiB |
|
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 184 KiB |
|
After Width: | Height: | Size: 259 KiB |
|
After Width: | Height: | Size: 255 KiB |
|
After Width: | Height: | Size: 317 KiB |
|
After Width: | Height: | Size: 152 KiB |
|
|
@ -1 +1 @@
|
|||
A simple to-do app that follows Material Design 3.
|
||||
A concise to-do app that follows Material 3 Expressive.
|
||||
|
|
@ -1 +1 @@
|
|||
To Do
|
||||
VerveDo
|
||||
|
|
@ -1 +1 @@
|
|||
一个简单的、遵循 Material Design 3 的待办应用。你可以用它来记每日要完成的学校作业,抑或当作日常生活的备忘录。你可以为每项任务设置优先级,并为它们排序,让你的生活有条不紊。
|
||||
VerveDo 是一个简约的、遵循 Material 3 Expressive 的待办应用。你可以用它来记每日要完成的学校作业,抑或当作日常生活的备忘录。你可以为每项任务设置优先级,并为它们排序,让你的生活有条不紊。
|
||||
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 238 KiB |
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 236 KiB |
|
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 288 KiB |
|
Before Width: | Height: | Size: 241 KiB After Width: | Height: | Size: 599 KiB |
|
Before Width: | Height: | Size: 585 KiB After Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 167 KiB |
|
|
@ -1 +1 @@
|
|||
一个简单的、遵循 Material Design 3 的待办应用。
|
||||
一个简约的、遵循 Material 3 Expressive 的待办应用。
|
||||
|
|
@ -1 +1 @@
|
|||
待办
|
||||
VerveDo
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "todo_script",
|
||||
"name": "vervedo_script",
|
||||
"version": "1.0.0",
|
||||
"description": "自动在 build.gradle.kts 写入版本号",
|
||||
"license": "GPL-3.0-only",
|
||||
|
|
|
|||
|
|
@ -20,5 +20,5 @@ dependencyResolutionManagement {
|
|||
}
|
||||
}
|
||||
|
||||
rootProject.name = "ToDo"
|
||||
rootProject.name = "VerveDo"
|
||||
include(":app")
|
||||
|
|
|
|||