Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ import com.sdds.compose.uikit.AvatarPlaceholder
import com.sdds.compose.uikit.AvatarStatus
import com.sdds.compose.uikit.AvatarStyle
import com.sdds.compose.uikit.Badge
import com.sdds.compose.uikit.BadgeStyle
import com.sdds.compose.uikit.Counter
import com.sdds.compose.uikit.Icon
import com.sdds.compose.uikit.IconBadge
import com.sdds.compose.uikit.Image
import com.sdds.compose.uikit.fixtures.R
import com.sdds.compose.uikit.graphics.cutout.cutout

/**
* Тест кейсы для Avatar
Expand Down Expand Up @@ -272,3 +275,49 @@ fun AvatarSizeMBadgeBottomStart(style: AvatarStyle) {
},
)
}

/**
* Avatar и IconBadge
*/
@Composable
fun AvatarIconBadge(style: AvatarStyle, iconBadgeStyle: BadgeStyle) {
Avatar(
style = style,
actionEnabled = false,
placeholder = AvatarPlaceholder.Name("Michael Scott"),
extra = {
IconBadge(
modifier = Modifier
.cutout()
.align(Alignment.BottomEnd),
style = iconBadgeStyle,
content = {
Icon(
painterResource(id = com.sdds.icons.R.drawable.ic_mute_fill_24),
contentDescription = "",
)
},
)
},
content = {},
)
}

/**
* Avatar и Image
*/
@Composable
fun AvatarContent(style: AvatarStyle) {
Avatar(
style = style,
status = AvatarStatus.Active,
actionEnabled = false,
placeholder = AvatarPlaceholder.Name("Michael Scott"),
content = {
Image(
painterResource(id = R.drawable.il_avatar_for_test),
contentDescription = "",
)
},
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,42 @@ fun BottomSheetNoHeaderFooterAuto(
}
}

/**
* BottomSheet HalfExpanded
*/
@Composable
fun BottomSheetNoHeaderFooterHalfExpanded(
style: ModalBottomSheetStyle,
buttonStyle: ButtonStyle,
) {
val sheetState = rememberModalBottomSheetState(
initialValue = BottomSheetValue.HalfExpanded,
)
Box(modifier = Modifier.fillMaxSize()) {
val scope = rememberCoroutineScope()
Button(
style = buttonStyle,
label = "Show",
onClick = {
scope.launch { sheetState.show() }
},
)
ModalBottomSheet(
style = style,
sheetState = sheetState,
handlePlacement = BottomSheetHandlePlacement.Inner,
sheetGesturesEnabled = true,
fitContent = false,
header = {},
footer = {},
body = {
BodyText()
},
onDismiss = {},
)
}
}

/**
* Header для BottomSheet
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.sdds.compose.uikit.fixtures.testcases

import androidx.compose.runtime.Composable
import androidx.compose.ui.res.painterResource
import com.sdds.compose.uikit.CircularProgressBar
import com.sdds.compose.uikit.CircularProgressBarStyle
import com.sdds.compose.uikit.Icon

/**
* Тест-кейсы для [CircularProgressBar]
Expand Down Expand Up @@ -39,3 +41,21 @@ fun CircularProgressNoTrack(style: CircularProgressBarStyle) {
trackEnabled = false,
)
}

/**
* Тест-кейсы для [CircularProgressBar]
*/
@Composable
fun CircularProgressWithIcon(style: CircularProgressBarStyle) {
CircularProgressBar(
progress = 0.5f,
style = style,
trackEnabled = false,
valueContent = {
Icon(
painter = painterResource(id = com.sdds.icons.R.drawable.ic_close_16),
contentDescription = "",
)
},
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package com.sdds.compose.uikit.fixtures.testcases

import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.sdds.compose.uikit.Icon
import com.sdds.compose.uikit.LocalTintBrushProducer
import com.sdds.compose.uikit.graphics.brush.asBrush
import com.sdds.compose.uikit.resourceImageSource
import com.sdds.icons.R

/**
* Иконка с цветом
*/
@Composable
fun IconFillColor() {
Icon(
painter = painterResource(R.drawable.ic_plasma_24),
contentDescription = "Icon",
modifier = Modifier.size(48.dp),
brush = {
Color(0xFF27AE60).asBrush()
},
)
}

/**
* Иконка с цветом LocalTintBrushProducer
*/
@Composable
fun IconTint() {
CompositionLocalProvider(
LocalTintBrushProducer provides { Color(0xFF2F80ED).asBrush() },
) {
Icon(
source = resourceImageSource(R.drawable.ic_plasma_24),
contentDescription = "Icon",
modifier = Modifier.size(48.dp),
)
}
}

/**
* Иконка с градиентом
*/
@Composable
fun IconFillBrush() {
Icon(
source = resourceImageSource(R.drawable.ic_plasma_24),
contentDescription = "Icon",
modifier = Modifier.size(48.dp),
brush = {
Brush.linearGradient(
colors = listOf(
Color(0xFF11994A),
Color(0xFFff5757),
),
)
},
)
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
package com.sdds.compose.uikit.fixtures.testcases

import android.graphics.drawable.Icon
import androidx.compose.foundation.focusable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsFocusedAsState
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import com.sdds.compose.uikit.Counter
import com.sdds.compose.uikit.Icon
import com.sdds.compose.uikit.List
import com.sdds.compose.uikit.ListItem
import com.sdds.compose.uikit.ListStyle
Expand Down Expand Up @@ -96,6 +102,63 @@ fun ListAmountTwenty(style: ListStyle) {
}
}

/**
* List icon disclosure
*/
@Composable
fun ListIconDisclosure(style: ListStyle) {
List(style = style) {
items(3) {
val interactionSource = remember { MutableInteractionSource() }
val isFocused = interactionSource.collectIsFocusedAsState()
ListItem(
modifier = Modifier
.focusable(interactionSource = interactionSource)
.focusSelector(
settings = LocalFocusSelectorSettings.current,
) { isFocused.value },
startContent = {
Icon(
painterResource(com.sdds.icons.R.drawable.ic_plasma_36),
contentDescription = "",
)
},
text = "Title",
disclosureEnabled = true,
interactionSource = interactionSource,
)
}
}
}

/**
* List counter disclosure
*/
@Composable
fun ListCounterDisclosure(style: ListStyle) {
List(style = style) {
items(3) {
val interactionSource = remember { MutableInteractionSource() }
val isFocused = interactionSource.collectIsFocusedAsState()
ListItem(
modifier = Modifier
.focusable(interactionSource = interactionSource)
.focusSelector(
settings = LocalFocusSelectorSettings.current,
) { isFocused.value },
startContent = {
Counter(
count = "1",
)
},
text = "Title",
disclosureEnabled = true,
interactionSource = interactionSource,
)
}
}
}

/**
* Preview для меню песочницы
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.sdds.compose.uikit.fixtures.testcases

import androidx.compose.runtime.Composable
import androidx.compose.ui.res.painterResource
import com.sdds.compose.uikit.Icon
import com.sdds.compose.uikit.Loader
import com.sdds.compose.uikit.LoaderStyle
import com.sdds.compose.uikit.LoaderType
Expand Down Expand Up @@ -30,3 +32,22 @@ fun LoaderProgress(style: LoaderStyle) {
loaderType = LoaderType.Progress,
)
}

/**
* Loader with icon
*/
@Composable
fun LoaderProgressWithIcon(style: LoaderStyle) {
Loader(
style = style,
progress = 0.5f,
trackEnabled = true,
valueContent = {
Icon(
painter = painterResource(id = com.sdds.icons.R.drawable.ic_close_16),
contentDescription = "",
)
},
loaderType = LoaderType.Progress,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,58 @@ fun RadioBoxDisabled(style: RadioBoxStyle) {
)
}

/**
* RadioBox не отмеченный
*/
@Composable
fun RadioBoxUnchecked(style: RadioBoxStyle) {
RadioBox(
style = style,
checked = false,
enabled = true,
onClick = {},
)
}

/**
* RadioBox отмеченный
*/
@Composable
fun RadioBoxChecked(style: RadioBoxStyle) {
RadioBox(
style = style,
checked = true,
enabled = true,
onClick = {},
)
}

/**
* RadioBox отмеченный disabled
*/
@Composable
fun RadioBoxCheckedDisabled(style: RadioBoxStyle) {
RadioBox(
style = style,
checked = true,
enabled = false,
onClick = {},
)
}

/**
* RadioBox не отмеченный disabled
*/
@Composable
fun RadioBoxUncheckedDisabled(style: RadioBoxStyle) {
RadioBox(
style = style,
checked = false,
enabled = false,
onClick = {},
)
}

/**
* PLASMA-T1421
*/
Expand Down
Loading
Loading