From e37d08710bfb40252aba4237106ac9b7414020c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0brahim=20Ethem=20=C5=9Een?= Date: Mon, 24 Jul 2023 14:31:41 +0300 Subject: [PATCH] If we assign null value after assigning value to textDecoration, it will not work as expected. We need to create an instance over the companion object. --- .../architecture/blueprints/todoapp/tasks/TasksScreen.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksScreen.kt b/app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksScreen.kt index 16cf81e86..047ae851f 100644 --- a/app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksScreen.kt +++ b/app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksScreen.kt @@ -165,7 +165,9 @@ private fun TasksContent( TaskItem( task = task, onTaskClick = onTaskClick, - onCheckedChange = { onTaskCheckedChange(task, it) } + onCheckedChange = { + onTaskCheckedChange(task, it) + } ) } } @@ -202,7 +204,7 @@ private fun TaskItem( textDecoration = if (task.isCompleted) { TextDecoration.LineThrough } else { - null + TextDecoration.None } ) }