Fix button shape

This commit is contained in:
Andrew 2024-06-18 22:21:04 +09:30
parent a3ff911920
commit 68a3f9d6f7
3 changed files with 8 additions and 8 deletions

View File

@ -16,14 +16,12 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.pager.PagerState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Card
import androidx.compose.material.ContentAlpha
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.LocalContentAlpha
import androidx.compose.material.LocalContentColor
import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
@ -47,7 +45,7 @@ import kotlin.math.sign
@Composable
fun BoxScope.HorizontalPagerIndicator(pagerState: PagerState) {
if (pagerState.pageCount >= 2) Card(
shape = MaterialTheme.shapes.large,
shape = pillShape,
backgroundColor = Color.Black.copy(alpha = 0.4f),
modifier = Modifier
.align(Alignment.BottomCenter)

View File

@ -80,10 +80,12 @@ private fun Colors.toMaterialColors() = androidx.compose.material.Colors(
@Composable private fun Context.colors() = AppTextSecurePreferences(this).colors()
val pillShape = RoundedCornerShape(percent = 50)
val buttonShape = pillShape
val sessionShapes = Shapes(
small = RoundedCornerShape(12.dp),
medium = RoundedCornerShape(16.dp),
large = RoundedCornerShape(50.dp)
medium = RoundedCornerShape(16.dp)
)
/**

View File

@ -16,7 +16,6 @@ import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.material.ButtonColors
import androidx.compose.material.ButtonDefaults
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material.TextButton
import androidx.compose.runtime.Composable
@ -43,6 +42,7 @@ import org.thoughtcrime.securesms.ui.LaunchedEffectAsync
import org.thoughtcrime.securesms.ui.PreviewTheme
import org.thoughtcrime.securesms.ui.SessionColorsParameterProvider
import org.thoughtcrime.securesms.ui.baseBold
import org.thoughtcrime.securesms.ui.buttonShape
import org.thoughtcrime.securesms.ui.color.Colors
import org.thoughtcrime.securesms.ui.color.LocalColors
import org.thoughtcrime.securesms.ui.contentDescription
@ -61,7 +61,7 @@ fun Button(
modifier: Modifier = Modifier,
enabled: Boolean = true,
style: ButtonStyle = ButtonStyle.Large,
shape: Shape = MaterialTheme.shapes.large,
shape: Shape = buttonShape,
border: BorderStroke? = type.border(color, enabled),
colors: ButtonColors = type.buttonColors(color),
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
@ -98,7 +98,7 @@ fun Button(
modifier: Modifier = Modifier,
enabled: Boolean = true,
size: ButtonStyle = ButtonStyle.Large,
shape: Shape = MaterialTheme.shapes.large,
shape: Shape = buttonShape,
border: BorderStroke? = type.border(color, enabled),
colors: ButtonColors = type.buttonColors(color),
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },