Merge pull request #731 from microsoft/joyapal/cutoutImageColor
[Fluent v2] Add support for customizing cutout icon color
This commit is contained in:
Коммит
4ed4e181e0
|
@ -5,6 +5,7 @@ import androidx.compose.foundation.BorderStroke
|
|||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.graphics.Brush
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.ColorFilter
|
||||
import androidx.compose.ui.graphics.SolidColor
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
|
@ -694,6 +695,11 @@ open class AvatarTokens(private val activityRingToken: ActivityRingsToken = Acti
|
|||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
open fun cutoutColorFilter(avatarInfo: AvatarInfo): ColorFilter? {
|
||||
return null
|
||||
}
|
||||
|
||||
@Composable
|
||||
open fun cutoutCornerRadius(avatarInfo: AvatarInfo): Dp {
|
||||
return when (avatarInfo.cutoutStyle) {
|
||||
|
|
|
@ -172,7 +172,8 @@ fun Avatar(
|
|||
)
|
||||
.padding(4.dp)
|
||||
.size(cutoutIconSize),
|
||||
contentDescription = cutoutContentDescription
|
||||
contentDescription = cutoutContentDescription,
|
||||
colorFilter = token.cutoutColorFilter(avatarInfo = avatarInfo)
|
||||
)
|
||||
} else if (cutoutIconImageVector != null) {
|
||||
Image(
|
||||
|
@ -185,7 +186,8 @@ fun Avatar(
|
|||
)
|
||||
.padding(4.dp)
|
||||
.size(cutoutIconSize),
|
||||
contentDescription = cutoutContentDescription
|
||||
contentDescription = cutoutContentDescription,
|
||||
colorFilter = token.cutoutColorFilter(avatarInfo = avatarInfo)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче