Skip to content

Commit

Permalink
Added comparison between read and unread article titles in Compact an…
Browse files Browse the repository at this point in the history
…d Super Compact modes.
  • Loading branch information
bannedbook committed Aug 19, 2024
1 parent fb42d60 commit 9b13cdd
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ import com.nononsenseapps.feeder.ui.compose.utils.PreviewThemes
import com.nononsenseapps.feeder.ui.compose.utils.onKeyEventLikeEscape
import java.net.URL
import java.time.Instant

import androidx.compose.ui.graphics.Color
import androidx.compose.material3.LocalContentColor
@Composable
fun FeedItemCard(
item: FeedListItem,
Expand Down Expand Up @@ -210,6 +211,12 @@ fun RowScope.FeedItemText(
}
}
val closeMenuText = stringResource(id = R.string.close_menu)
// The color of unread items remains unchanged, and the color of read items increases transparency
val titleColor = if (item.unread) {
Color.Unspecified // Use the default color and do not change the color of unread items
} else {
LocalContentColor.current.copy(alpha = 0.74f) //Increase transparency of read item color
}
Column(
verticalArrangement = Arrangement.spacedBy(4.dp),
modifier =
Expand All @@ -219,7 +226,7 @@ fun RowScope.FeedItemText(
WithBidiDeterminedLayoutDirection(paragraph = joinedText.text) {
Text(
text = joinedText,
style = FeedListItemTitleTextStyle(),
style = FeedListItemTitleTextStyle().copy(color = titleColor),
fontWeight = titleFontWeight(item.unread),
overflow = TextOverflow.Ellipsis,
maxLines = maxLines,
Expand Down

0 comments on commit 9b13cdd

Please sign in to comment.