|
|
@ -16,6 +16,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
package com.google.samples.apps.nowinandroid.core.ui
|
|
|
|
package com.google.samples.apps.nowinandroid.core.ui
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import android.util.Log
|
|
|
|
import androidx.compose.foundation.background
|
|
|
|
import androidx.compose.foundation.background
|
|
|
|
import androidx.compose.foundation.horizontalScroll
|
|
|
|
import androidx.compose.foundation.horizontalScroll
|
|
|
|
import androidx.compose.foundation.layout.Arrangement
|
|
|
|
import androidx.compose.foundation.layout.Arrangement
|
|
|
@ -156,12 +157,17 @@ fun NewsResourceAuthors(
|
|
|
|
authors: List<Author>
|
|
|
|
authors: List<Author>
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
if (authors.isNotEmpty()) {
|
|
|
|
if (authors.isNotEmpty()) {
|
|
|
|
// Only display first author for now
|
|
|
|
// display all authors
|
|
|
|
val author = authors[0]
|
|
|
|
val authorName = StringBuilder()
|
|
|
|
|
|
|
|
authors.forEachIndexed { index, author ->
|
|
|
|
|
|
|
|
authorName
|
|
|
|
|
|
|
|
.append(author.name)
|
|
|
|
|
|
|
|
.append(if (index == authors.lastIndex) "" else ", ")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
val authorNameFormatted = author.name.uppercase(Locale.getDefault())
|
|
|
|
val authorNameFormatted = "$authorName".uppercase(Locale.getDefault())
|
|
|
|
|
|
|
|
|
|
|
|
val authorImageUrl = author.imageUrl
|
|
|
|
val authorImageUrl = authors[0].imageUrl
|
|
|
|
|
|
|
|
|
|
|
|
val authorImageModifier = Modifier
|
|
|
|
val authorImageModifier = Modifier
|
|
|
|
.clip(CircleShape)
|
|
|
|
.clip(CircleShape)
|
|
|
|