bugbash2 fixes (#333)
* bugbash2 fixes * updating v2badge activity --------- Co-authored-by: PraveenKumar Yeruva <pyeruva@microsoft.com>
This commit is contained in:
Родитель
7392ce7c59
Коммит
4cc9617675
|
@ -202,36 +202,31 @@ fun createAvatarPersons(mContext: Context): ArrayList<AvatarCarouselItem> {
|
|||
@SuppressLint("UnusedMaterialScaffoldPaddingParameter")
|
||||
@Composable
|
||||
fun CreateAvatarCarouselActivityUI() {
|
||||
val scaffoldState: ScaffoldState = rememberScaffoldState()
|
||||
val mContext = LocalContext.current
|
||||
Scaffold(scaffoldState = scaffoldState) {
|
||||
Column(
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||
modifier = Modifier.padding(top = 8.dp)
|
||||
) {
|
||||
Text(
|
||||
modifier = Modifier.padding(start = 8.dp),
|
||||
text = "Large Avatar Carousel",
|
||||
color = Color(0xFF2886DE)
|
||||
)
|
||||
AvatarCarousel(
|
||||
avatarList = createAvatarPersons(mContext),
|
||||
size = AvatarCarouselSize.Large
|
||||
)
|
||||
|
||||
|
||||
Divider(Modifier.fillMaxWidth())
|
||||
Text(
|
||||
modifier = Modifier.padding(start = 8.dp),
|
||||
text = "Medium Avatar Carousel with Presence indicator",
|
||||
color = Color(0xFF2886DE)
|
||||
)
|
||||
AvatarCarousel(
|
||||
avatarList = createAvatarPersons(mContext),
|
||||
size = AvatarCarouselSize.Medium,
|
||||
enablePresence = true
|
||||
)
|
||||
}
|
||||
Column(
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||
modifier = Modifier.padding(top = 8.dp)
|
||||
) {
|
||||
Text(
|
||||
modifier = Modifier.padding(start = 8.dp),
|
||||
text = "Large Avatar Carousel",
|
||||
color = Color(0xFF2886DE)
|
||||
)
|
||||
AvatarCarousel(
|
||||
avatarList = createAvatarPersons(mContext),
|
||||
size = AvatarCarouselSize.Large
|
||||
)
|
||||
Divider(Modifier.fillMaxWidth())
|
||||
Text(
|
||||
modifier = Modifier.padding(start = 8.dp),
|
||||
text = "Medium Avatar Carousel with Presence indicator",
|
||||
color = Color(0xFF2886DE)
|
||||
)
|
||||
AvatarCarousel(
|
||||
avatarList = createAvatarPersons(mContext),
|
||||
size = AvatarCarouselSize.Medium,
|
||||
enablePresence = true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,10 @@ package com.microsoft.fluentuidemo.demos
|
|||
import android.os.Bundle
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.lazy.LazyRow
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Alignment.Companion.CenterVertically
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.ComposeView
|
||||
|
@ -45,7 +48,7 @@ class V2BadgeActivity : DemoActivity() {
|
|||
modifier = Modifier.padding(8.dp)
|
||||
|
||||
)
|
||||
Row(Modifier.padding(16.dp)) {
|
||||
Row(Modifier.padding(16.dp), verticalAlignment = CenterVertically) {
|
||||
Text(
|
||||
text = resources.getString(R.string.badge_notification_dot),
|
||||
fontWeight = title2Font.weight,
|
||||
|
@ -53,10 +56,10 @@ class V2BadgeActivity : DemoActivity() {
|
|||
lineHeight = title2Font.fontSize.lineHeight,
|
||||
color = FluentTheme.aliasTokens.neutralForegroundColor[AliasTokens.NeutralForegroundColorTokens.Foreground1].value()
|
||||
)
|
||||
Spacer(modifier = Modifier.width(16.dp))
|
||||
Badge()
|
||||
}
|
||||
|
||||
Row(Modifier.padding(16.dp)) {
|
||||
Row(Modifier.padding(16.dp), verticalAlignment = CenterVertically){
|
||||
Text(
|
||||
text = resources.getString(R.string.badge_notification_character),
|
||||
fontWeight = title2Font.weight,
|
||||
|
@ -64,20 +67,37 @@ class V2BadgeActivity : DemoActivity() {
|
|||
lineHeight = title2Font.fontSize.lineHeight,
|
||||
color = FluentTheme.aliasTokens.neutralForegroundColor[AliasTokens.NeutralForegroundColorTokens.Foreground1].value()
|
||||
)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("1", badgeType = BadgeType.Character)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("2", badgeType = BadgeType.Character)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("8", badgeType = BadgeType.Character)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("12", badgeType = BadgeType.Character)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("123", badgeType = BadgeType.Character)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("12345678910", badgeType = BadgeType.Character)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("Badge", badgeType = BadgeType.Character)
|
||||
Spacer(modifier = Modifier.width(16.dp))
|
||||
LazyRow(){
|
||||
item {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("1", badgeType = BadgeType.Character)
|
||||
}
|
||||
item {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("2", badgeType = BadgeType.Character)
|
||||
}
|
||||
item {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("8", badgeType = BadgeType.Character)
|
||||
}
|
||||
item {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("12", badgeType = BadgeType.Character)
|
||||
}
|
||||
item {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("123", badgeType = BadgeType.Character)
|
||||
}
|
||||
item {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("12345678910", badgeType = BadgeType.Character)
|
||||
}
|
||||
item{
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("Badge", badgeType = BadgeType.Character)
|
||||
}
|
||||
}
|
||||
}
|
||||
Row(Modifier.padding(16.dp)) {
|
||||
Text(
|
||||
|
@ -89,20 +109,37 @@ class V2BadgeActivity : DemoActivity() {
|
|||
themeMode = ThemeMode.Auto
|
||||
)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("1", badgeType = BadgeType.List)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("2", badgeType = BadgeType.List)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("8", badgeType = BadgeType.List)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("12", badgeType = BadgeType.List)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("123", badgeType = BadgeType.List)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("12345678910", badgeType = BadgeType.List)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("Badge", badgeType = BadgeType.List)
|
||||
Spacer(modifier = Modifier.width(16.dp))
|
||||
LazyRow(){
|
||||
item {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("1", badgeType = BadgeType.List)
|
||||
}
|
||||
item {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("2", badgeType = BadgeType.List)
|
||||
}
|
||||
item {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("8", badgeType = BadgeType.List)
|
||||
}
|
||||
item {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("12", badgeType = BadgeType.List)
|
||||
}
|
||||
item {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("123", badgeType = BadgeType.List)
|
||||
}
|
||||
item {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("12345678910", badgeType = BadgeType.List)
|
||||
}
|
||||
item {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Badge("Badge", badgeType = BadgeType.List)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,13 +96,11 @@ fun Avatar(
|
|||
Box(modifier = Modifier
|
||||
.semantics(mergeDescendants = true) {
|
||||
contentDescription = "${person.getName()}. " +
|
||||
"${if (enablePresence) "Status, ${person.status}," else ""}. " +
|
||||
"${if (enablePresence && person.isOOO) "Out Of Office," else ""}. " +
|
||||
"${
|
||||
if (enableActivityRings) {
|
||||
if (person.isActive) "Active" else "Inactive"
|
||||
} else ""
|
||||
}."
|
||||
"${if (enablePresence) "Status, ${person.status}," else ""} " +
|
||||
"${if (enablePresence && person.isOOO) "Out Of Office," else ""} " +
|
||||
if (enableActivityRings) {
|
||||
if (person.isActive) "Active" else "Inactive"
|
||||
} else ""
|
||||
}
|
||||
) {
|
||||
Box(
|
||||
|
|
Загрузка…
Ссылка в новой задаче