Skip to content

Commit

Permalink
make dog happy
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
westnordost and github-actions[bot] authored Jan 16, 2025
1 parent e06a94c commit e00afdf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,23 @@ import androidx.compose.ui.BiasAlignment
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.LayoutDirection

private val Alignment.horizontalBias: Float get() {
val align = align(IntSize.Zero, IntSize(10_000_000, 1), LayoutDirection.Ltr)
return align.x / 5_000_000f - 1f
}
private val Alignment.horizontalBias: Float
get() {
val align = align(IntSize.Zero, IntSize(10_000_000, 1), LayoutDirection.Ltr)
return align.x / 5_000_000f - 1f
}

internal val Alignment.horizontal: Alignment.Horizontal get() =
BiasAlignment.Horizontal(horizontalBias)
internal val Alignment.horizontal: Alignment.Horizontal
get() = BiasAlignment.Horizontal(horizontalBias)

private val Alignment.verticalBias: Float get() {
val align = align(IntSize.Zero, IntSize(1, 10_000_000), LayoutDirection.Ltr)
return align.y / 5_000_000f - 1f
}
private val Alignment.verticalBias: Float
get() {
val align = align(IntSize.Zero, IntSize(1, 10_000_000), LayoutDirection.Ltr)
return align.y / 5_000_000f - 1f
}

internal val Alignment.vertical: Alignment.Vertical get() =
BiasAlignment.Vertical(verticalBias)
internal val Alignment.vertical: Alignment.Vertical
get() = BiasAlignment.Vertical(verticalBias)

internal fun Alignment.Horizontal.toArrangement(): Arrangement.Horizontal {
val align = align(0, 2, LayoutDirection.Ltr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,20 @@ public fun AttributionButton(

CompositionLocalProvider(
LocalContentColor provides contentColor,
LocalLayoutDirection provides rowLayoutDirection
LocalLayoutDirection provides rowLayoutDirection,
) {
Box(modifier = modifier, contentAlignment = Alignment.CenterStart) {

AnimatedVisibility(expanded, modifier = Modifier.matchParentSize()) {
Box(
Modifier.matchParentSize()
.padding(4.dp)
.background(surfaceColor, RoundedCornerShape(cornerSize))
.padding(4.dp)
.background(surfaceColor, RoundedCornerShape(cornerSize))
)
}

Row(
horizontalArrangement = Arrangement.Start,
verticalAlignment = Alignment.CenterVertically
verticalAlignment = Alignment.CenterVertically,
) {
InfoIconButton(
onClick = { expanded = !expanded },
Expand Down Expand Up @@ -163,14 +162,13 @@ private fun AttributionTexts(
modifier: Modifier = Modifier,
) {
ProvideTextStyle(textStyle) {
FlowRow(
modifier = modifier,
horizontalArrangement = Arrangement.spacedBy(4.dp),
) {
FlowRow(modifier = modifier, horizontalArrangement = Arrangement.spacedBy(4.dp)) {
attributions.forEach {
Text(buildAnnotatedString {
withLink(LinkAnnotation.Url(url = it.url, styles = textLinkStyles)) { append(it.title) }
})
Text(
buildAnnotatedString {
withLink(LinkAnnotation.Url(url = it.url, styles = textLinkStyles)) { append(it.title) }
}
)
}
}
}
Expand Down

0 comments on commit e00afdf

Please sign in to comment.