Merge pull request #386 from android/jv/topic-colors

Tint topic icons to theme's primary color
pull/449/head
Milosz Moczkowski 2 years ago committed by GitHub
commit aa4d930c20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -56,6 +56,7 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.layout.layout
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalView
@ -383,6 +384,7 @@ fun TopicIcon(
placeholder = painterResource(R.drawable.ic_icon_placeholder),
model = imageUrl,
contentDescription = null, // decorative
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.primary),
modifier = modifier
.padding(10.dp)
.size(32.dp)

@ -31,6 +31,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
@ -124,6 +125,7 @@ private fun InterestsIcon(topicImageUrl: String, modifier: Modifier = Modifier)
AsyncImage(
model = topicImageUrl,
contentDescription = null,
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.primary),
modifier = modifier
)
}

@ -39,6 +39,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@ -156,6 +157,7 @@ private fun TopicHeader(name: String, description: String, imageUrl: String) {
AsyncImage(
model = imageUrl,
contentDescription = null,
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.primary),
modifier = Modifier
.align(Alignment.CenterHorizontally)
.size(216.dp)

Loading…
Cancel
Save