File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1616
1717package com.google.samples.apps.nowinandroid.core.ui
1818
19+ import android.util.Log
1920import androidx.compose.foundation.background
2021import androidx.compose.foundation.horizontalScroll
2122import androidx.compose.foundation.layout.Arrangement
@@ -156,12 +157,17 @@ fun NewsResourceAuthors(
156157 authors : List <Author >
157158) {
158159 if (authors.isNotEmpty()) {
159- // Only display first author for now
160- val author = authors[0 ]
160+ // display all authors
161+ val authorName = StringBuilder ()
162+ authors.forEachIndexed { index, author ->
163+ authorName
164+ .append(author.name)
165+ .append(if (index == authors.lastIndex) " " else " , " )
166+ }
161167
162- val authorNameFormatted = author.name .uppercase(Locale .getDefault())
168+ val authorNameFormatted = " $authorName " .uppercase(Locale .getDefault())
163169
164- val authorImageUrl = author .imageUrl
170+ val authorImageUrl = authors[ 0 ] .imageUrl
165171
166172 val authorImageModifier = Modifier
167173 .clip(CircleShape )
You can’t perform that action at this time.
0 commit comments