Skip to content

Commit

Permalink
Code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
T8RIN committed Jan 8, 2025
1 parent 7b0407c commit 26df816
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ object CustomSliderDefaults {
@Composable
fun Thumb(
interactionSource: MutableInteractionSource,
modifier: Modifier = Modifier.Companion,
modifier: Modifier = Modifier,
colors: CustomSliderColors = colors(),
enabled: Boolean = true,
thumbSize: DpSize = ThumbSize
Expand Down Expand Up @@ -197,7 +197,7 @@ object CustomSliderDefaults {
@ExperimentalMaterial3Api
fun Track(
sliderState: CustomSliderState,
modifier: Modifier = Modifier.Companion,
modifier: Modifier = Modifier,
colors: CustomSliderColors = colors(),
enabled: Boolean = true,
trackHeight: Dp = 32.dp
Expand Down Expand Up @@ -239,7 +239,7 @@ object CustomSliderDefaults {
@Composable
fun Track(
rangeSliderState: CustomRangeSliderState,
modifier: Modifier = Modifier.Companion,
modifier: Modifier = Modifier,
colors: CustomSliderColors = colors(),
enabled: Boolean = true,
trackHeight: Dp = 32.dp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,22 @@ internal fun ColorHarmonies(
},
expandableContent = {
Column(
modifier = Modifier.Companion.padding(
modifier = Modifier.padding(
start = 16.dp,
end = 16.dp,
bottom = 8.dp
),
) {
Row(
horizontalArrangement = Arrangement.spacedBy(4.dp),
modifier = Modifier.Companion.fillMaxWidth()
modifier = Modifier.fillMaxWidth()
) {
HarmonyType.entries.forEach {
EnhancedChip(
selected = it == selectedHarmony,
onClick = { selectedHarmony = it },
selectedColor = MaterialTheme.colorScheme.secondaryContainer,
modifier = Modifier.Companion.weight(1f)
modifier = Modifier.weight(1f)
) {
Icon(
imageVector = it.icon(),
Expand All @@ -119,7 +119,7 @@ internal fun ColorHarmonies(
}
}
}
Spacer(Modifier.Companion.height(8.dp))
Spacer(Modifier.height(8.dp))
AnimatedContent(
targetState = selectedHarmony,
transitionSpec = {
Expand All @@ -128,7 +128,7 @@ internal fun ColorHarmonies(
) {
Text(it.title())
}
Spacer(Modifier.Companion.height(8.dp))
Spacer(Modifier.height(8.dp))
Row(
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
Expand All @@ -142,7 +142,7 @@ internal fun ColorHarmonies(
darkMode = boxColor.luminance() < 0.3f
)
Box(
modifier = Modifier.Companion
modifier = Modifier
.heightIn(min = 120.dp)
.weight(1f)
.clip(RoundedCornerShape(8.dp))
Expand All @@ -165,7 +165,7 @@ internal fun ColorHarmonies(
imageVector = Icons.Rounded.ContentCopy,
contentDescription = stringResource(R.string.copy),
tint = contentColor,
modifier = Modifier.Companion
modifier = Modifier
.align(Alignment.Companion.TopEnd)
.padding(4.dp)
.size(28.dp)
Expand All @@ -181,7 +181,7 @@ internal fun ColorHarmonies(
Text(
text = color.toHex(),
color = contentColor,
modifier = Modifier.Companion
modifier = Modifier
.align(Alignment.Companion.BottomStart)
.padding(4.dp)
.background(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ internal fun ColorHistogram() {
},
expandableContent = {
Column(
modifier = Modifier.Companion.padding(
modifier = Modifier.padding(
start = 16.dp,
end = 16.dp,
bottom = 8.dp
Expand All @@ -76,7 +76,7 @@ internal fun ColorHistogram() {
) {
ImageHistogram(
imageUri = imageUri,
modifier = Modifier.Companion
modifier = Modifier
.padding(top = 16.dp)
.fillMaxWidth()
.height(250.dp),
Expand All @@ -87,7 +87,7 @@ internal fun ColorHistogram() {
)
ImageHistogram(
imageUri = imageUri,
modifier = Modifier.Companion
modifier = Modifier
.fillMaxWidth()
.height(250.dp),
initialType = HistogramType.Brightness,
Expand All @@ -97,7 +97,7 @@ internal fun ColorHistogram() {
)
ImageHistogram(
imageUri = imageUri,
modifier = Modifier.Companion
modifier = Modifier
.fillMaxWidth()
.height(250.dp),
initialType = HistogramType.Camera,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ internal fun ColorInfo(
},
expandableContent = {
Column(
modifier = Modifier.Companion.padding(
modifier = Modifier.padding(
start = 16.dp,
end = 16.dp,
bottom = 8.dp
Expand All @@ -98,7 +98,7 @@ internal fun ColorInfo(
darkMode = boxColor.luminance() < 0.3f
)
Box(
modifier = Modifier.Companion
modifier = Modifier
.heightIn(min = 80.dp)
.fillMaxWidth()
.clip(RoundedCornerShape(16.dp))
Expand All @@ -121,7 +121,7 @@ internal fun ColorInfo(
imageVector = Icons.Rounded.ContentCopy,
contentDescription = stringResource(R.string.copy),
tint = contentColor,
modifier = Modifier.Companion
modifier = Modifier
.align(Alignment.Companion.TopEnd)
.padding(4.dp)
.size(28.dp)
Expand All @@ -135,7 +135,7 @@ internal fun ColorInfo(
Text(
text = selectedColor.toHex(),
color = contentColor,
modifier = Modifier.Companion
modifier = Modifier
.align(Alignment.Companion.BottomStart)
.padding(4.dp)
.background(
Expand All @@ -153,7 +153,7 @@ internal fun ColorInfo(
}
}.value,
color = contentColor,
modifier = Modifier.Companion
modifier = Modifier
.align(Alignment.Companion.BottomEnd)
.padding(4.dp)
.background(
Expand All @@ -164,7 +164,7 @@ internal fun ColorInfo(
fontSize = 12.sp
)
}
Spacer(modifier = Modifier.Companion.height(16.dp))
Spacer(modifier = Modifier.height(16.dp))
var wasNull by rememberSaveable {
mutableStateOf(false)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ internal fun ColorMixing(
},
expandableContent = {
Column(
modifier = Modifier.Companion.padding(
modifier = Modifier.padding(
start = 16.dp,
end = 16.dp,
bottom = 8.dp
Expand All @@ -118,15 +118,15 @@ internal fun ColorMixing(
ColorRowSelector(
value = colorToMix,
onValueChange = { colorToMix = it },
modifier = Modifier.Companion
modifier = Modifier
.fillMaxWidth()
.container(
color = MaterialTheme.colorScheme.surface,
shape = ContainerShapeDefaults.topShape
),
title = stringResource(R.string.color_to_mix)
)
Spacer(modifier = Modifier.Companion.height(4.dp))
Spacer(modifier = Modifier.height(4.dp))
EnhancedSliderItem(
value = mixingVariation,
title = stringResource(R.string.variation),
Expand All @@ -138,9 +138,9 @@ internal fun ColorMixing(
color = MaterialTheme.colorScheme.surface,
steps = 12
)
Spacer(modifier = Modifier.Companion.height(16.dp))
Spacer(modifier = Modifier.height(16.dp))
Column(
modifier = Modifier.Companion.fillMaxWidth(),
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(4.dp),
horizontalAlignment = Alignment.Companion.CenterHorizontally
) {
Expand All @@ -154,7 +154,7 @@ internal fun ColorMixing(
darkMode = boxColor.luminance() < 0.3f
)
Box(
modifier = Modifier.Companion
modifier = Modifier
.heightIn(min = 100.dp)
.fillMaxWidth()
.clip(
Expand Down Expand Up @@ -182,7 +182,7 @@ internal fun ColorMixing(
imageVector = Icons.Rounded.ContentCopy,
contentDescription = stringResource(R.string.copy),
tint = contentColor,
modifier = Modifier.Companion
modifier = Modifier
.align(Alignment.Companion.TopEnd)
.padding(4.dp)
.size(28.dp)
Expand All @@ -196,7 +196,7 @@ internal fun ColorMixing(
Text(
text = color.toHex(),
color = contentColor,
modifier = Modifier.Companion
modifier = Modifier
.align(Alignment.Companion.BottomStart)
.padding(4.dp)
.background(
Expand All @@ -216,7 +216,7 @@ internal fun ColorMixing(
}
}.value,
color = contentColor,
modifier = Modifier.Companion
modifier = Modifier
.align(Alignment.Companion.BottomEnd)
.padding(4.dp)
.background(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ internal fun ColorShading(
},
expandableContent = {
Column(
modifier = Modifier.Companion.padding(
modifier = Modifier.padding(
start = 16.dp,
end = 16.dp,
bottom = 8.dp
Expand All @@ -131,7 +131,7 @@ internal fun ColorShading(
color = MaterialTheme.colorScheme.surface,
steps = 12
)
Spacer(modifier = Modifier.Companion.height(16.dp))
Spacer(modifier = Modifier.height(16.dp))
Row(
horizontalArrangement = Arrangement.spacedBy(4.dp)
) {
Expand All @@ -141,7 +141,7 @@ internal fun ColorShading(
shades to R.string.shades
).forEach { (data, title) ->
Column(
modifier = Modifier.Companion.weight(1f),
modifier = Modifier.weight(1f),
verticalArrangement = Arrangement.spacedBy(4.dp),
horizontalAlignment = Alignment.Companion.CenterHorizontally
) {
Expand All @@ -156,7 +156,7 @@ internal fun ColorShading(
darkMode = boxColor.luminance() < 0.3f
)
Box(
modifier = Modifier.Companion
modifier = Modifier
.heightIn(min = 100.dp)
.fillMaxWidth()
.clip(
Expand Down Expand Up @@ -184,7 +184,7 @@ internal fun ColorShading(
imageVector = Icons.Rounded.ContentCopy,
contentDescription = stringResource(R.string.copy),
tint = contentColor,
modifier = Modifier.Companion
modifier = Modifier
.align(Alignment.Companion.TopEnd)
.padding(4.dp)
.size(28.dp)
Expand All @@ -198,7 +198,7 @@ internal fun ColorShading(
Text(
text = color.toHex(),
color = contentColor,
modifier = Modifier.Companion
modifier = Modifier
.align(Alignment.Companion.BottomStart)
.padding(4.dp)
.background(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ internal fun LoadNetImageUrlTextField(
val essentials = rememberLocalEssentials()

RoundedTextField(
modifier = Modifier.Companion
modifier = Modifier
.container(shape = RoundedCornerShape(24.dp))
.padding(8.dp),
value = component.targetUrl,
Expand All @@ -68,7 +68,7 @@ internal fun LoadNetImageUrlTextField(
onClick = {
component.updateTargetUrl("")
},
modifier = Modifier.Companion.padding(end = 4.dp)
modifier = Modifier.padding(end = 4.dp)
) {
Icon(
imageVector = Icons.Outlined.Cancel,
Expand Down
Loading

0 comments on commit 26df816

Please sign in to comment.