fix: 分类标准标题错误 & 未修改待办旋转屏幕后提示已修改
This commit is contained in:
parent
2959966552
commit
3be46b8a55
3 changed files with 4 additions and 3 deletions
|
|
@ -38,7 +38,7 @@ android {
|
|||
applicationId = "cn.super12138.todo"
|
||||
minSdk = 24
|
||||
targetSdk = 36
|
||||
versionCode = 992
|
||||
versionCode = 995
|
||||
versionName = "2.3.3"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ enum class SortingMethod(
|
|||
// 按字母降序
|
||||
AlphabeticalDescending(id = 6, nameRes = R.string.sorting_alphabetical_descending),
|
||||
|
||||
DueDate(id = 7, nameRes = R.string.sorting_alphabetical_descending);
|
||||
DueDate(id = 7, nameRes = R.string.sorting_due_date);
|
||||
|
||||
companion object {
|
||||
fun fromId(id: Int) = entries.find { it.id == id } ?: Sequential
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ class EditorState(val initialTodo: TodoEntity? = null) {
|
|||
* 检查待办是否被编辑修改
|
||||
*/
|
||||
fun isModified(): Boolean {
|
||||
// Log.d("EditorState", "Initial: content='${initialTodo?.content ?: ""}', category='${initialTodo?.category ?: ""}', priority=${initialTodo?.priority ?: 0f}, isCompleted=${initialTodo?.isCompleted == true}, dueDate=${initialTodo?.dueDate} ; Now: content='$toDoContent', category='$categoryContent', priority=$priorityState, isCompleted=$isCompleted, dueDate=$dueDateState")
|
||||
var isModified = false
|
||||
if ((initialTodo?.content ?: "") != toDoContent) isModified = true
|
||||
if ((initialTodo?.category ?: "") != categoryContent) isModified = true
|
||||
|
|
@ -76,7 +77,7 @@ 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?.id ?: 0,
|
||||
value.initialTodo,
|
||||
value.toDoContent,
|
||||
value.isErrorContent,
|
||||
value.selectedCategoryIndex,
|
||||
|
|
|
|||
Loading…
Reference in a new issue