android / architecture-samples

A collection of samples to discuss and showcase different architectural tools and patterns for Android apps.
Apache License 2.0
44.38k stars 11.63k forks source link

"Checkbox state does not update Text UI component correctly in TaskItem Composable" #969

Open IacovColisnicenco opened 1 year ago

IacovColisnicenco commented 1 year ago

In the TasksScreen.kt file, the TaskItem Composable exhibits a bug where the text of a task remains strikethrough even after the task is unchecked as complete. This issue is due to the absence of a TextDecoration.None setting in the Text Composable, which is responsible for displaying the task title. The text should update dynamically based on the task.isCompleted boolean value.

What I was fix:

textDecoration = if (task.isCompleted) {
            TextDecoration.LineThrough
        } else {

            //This  give me a bug. Oh man
            //null

            //I add this line of code and bug was fix
            TextDecoration.None
        }
vishtech36 commented 1 year ago

PR Raised https://github.com/android/architecture-samples/pull/972