@@ -16,6 +16,7 @@ import androidx.compose.foundation.layout.size
1616import androidx.compose.foundation.layout.width
1717import androidx.compose.foundation.shape.RoundedCornerShape
1818import androidx.compose.material.icons.Icons
19+ import androidx.compose.material.icons.rounded.PlayArrow
1920import androidx.compose.material.icons.rounded.Star
2021import androidx.compose.material3.Icon
2122import androidx.compose.material3.ListItem
@@ -59,6 +60,7 @@ import com.capyreader.app.ui.fixtures.PreviewKoinApplication
5960import com.capyreader.app.ui.theme.CapyTheme
6061import com.capyreader.app.ui.theme.LocalAppTheme
6162import com.jocmp.capy.Article
63+ import com.jocmp.capy.EnclosureType
6264import com.jocmp.capy.MarkRead
6365import com.jocmp.capy.articles.relativeTime
6466import java.net.URL
@@ -126,35 +128,50 @@ fun ArticleRow(
126128 .fillMaxWidth()
127129 .padding(bottom = 2 .dp)
128130 ) {
131+
129132 if (options.showFeedName) {
130133 Text (
131134 text = article.feedName,
132135 color = feedNameColor,
133136 maxLines = 1 ,
134137 overflow = TextOverflow .Ellipsis ,
135- modifier = Modifier .weight(1f ),
136138 fontWeight = if (deEmphasizeFontWeight) FontWeight .Light else null ,
139+ modifier = Modifier .weight(1f )
137140 )
138141 Spacer (Modifier .width(16 .dp))
139142 }
140- if (article.starred) {
141- Icon (
142- Icons .Rounded .Star ,
143- contentDescription = null ,
144- tint = feedNameColor,
145- modifier = Modifier
146- .width(12 .dp.relative(options.fontScale))
147- .padding(end = 2 .dp)
143+ Row (
144+ horizontalArrangement = Arrangement .spacedBy(2 .dp),
145+ verticalAlignment = Alignment .CenterVertically ,
146+ ) {
147+ if (article.starred) {
148+ Icon (
149+ Icons .Rounded .Star ,
150+ contentDescription = null ,
151+ tint = feedNameColor,
152+ modifier = Modifier
153+ .width(12 .dp.relative(options.fontScale))
154+ )
155+ }
156+ if (article.enclosureType == EnclosureType .AUDIO ) {
157+ Icon (
158+ Icons .Rounded .PlayArrow ,
159+ contentDescription = null ,
160+ tint = feedNameColor,
161+ modifier = Modifier
162+ .width(16 .dp.relative(options.fontScale))
163+ .padding(end = 2 .dp)
164+ )
165+ }
166+ Text (
167+ text = relativeTime(
168+ time = article.publishedAt,
169+ currentTime = currentTime,
170+ ),
171+ color = feedNameColor,
172+ maxLines = 1 ,
148173 )
149174 }
150- Text (
151- text = relativeTime(
152- time = article.publishedAt,
153- currentTime = currentTime,
154- ),
155- color = feedNameColor,
156- maxLines = 1 ,
157- )
158175 }
159176 },
160177 supportingContent = {
@@ -168,7 +185,7 @@ fun ArticleRow(
168185 maxLines = 2 ,
169186 overflow = TextOverflow .Ellipsis ,
170187 fontWeight = if (deEmphasizeFontWeight) FontWeight .Light else null ,
171- )
188+ )
172189 }
173190 if (imageURL != null && options.imagePreview == ImagePreview .LARGE ) {
174191 ArticleImage (imageURL = imageURL, imagePreview = options.imagePreview)
@@ -365,6 +382,7 @@ fun ArticleRowPreview_Selected_DarkMode() {
365382 publishedAt = ZonedDateTime .of(2024 , 2 , 11 , 8 , 33 , 0 , 0 , ZoneOffset .UTC ),
366383 read = true ,
367384 starred = false ,
385+ enclosureType = EnclosureType .AUDIO ,
368386 feedName = " 9to5Google - Google news, Pixel, Android, Home, Chrome OS, more"
369387 )
370388
@@ -432,7 +450,11 @@ fun ArticleRowPreview_Medium(@PreviewParameter(ArticleSample::class) article: Ar
432450 PreviewKoinApplication {
433451 CapyTheme {
434452 ArticleRow (
435- article = article.copy(imageURL = " http://example.com" ),
453+ article = article.copy(
454+ imageURL = " http://example.com" ,
455+ starred = true ,
456+ enclosureType = EnclosureType .AUDIO
457+ ),
436458 index = 0 ,
437459 selected = true ,
438460 onSelect = {},
0 commit comments