android / android/architecture-samples

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

Open
#969 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
45.8k
Forks
11.9k
PR merge metrics
No merged PRs in 30d

Description

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
}

Contributor guide

Open the contributing guide

Research direction

Open TasksScreen.kt and inspect the TaskItem Composable, especially the Text displaying the task title and its task.isCompleted handling. Confirm the title uses the completed and unchecked decoration states dynamically, then verify that checking and unchecking a task updates the rendered text correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.