Change Dropcap typography

This commit is contained in:
Thomas Andres Gomez 2023-09-28 15:34:39 +02:00
parent 255ad7aed8
commit d25246f452
4 changed files with 17 additions and 14 deletions

View file

@ -4,6 +4,7 @@ import android.content.res.Configuration.UI_MODE_NIGHT_NO
import android.content.res.Configuration.UI_MODE_NIGHT_YES
import androidx.activity.compose.BackHandler
import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.ContentTransform
import androidx.compose.animation.SizeTransform
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
@ -53,6 +54,7 @@ import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
@ -224,12 +226,7 @@ private fun RollOverlayContent(
.align(Alignment.BottomCenter),
targetState = card.value,
transitionSpec = {
val enter =
fadeIn() + slideInVertically { with(density) { 64.dp.roundToPx() } }
val exit =
fadeOut() + slideOutVertically { with(density) { -64.dp.roundToPx() } }
val transform = SizeTransform(clip = false)
enter togetherWith exit using transform
animation(density = density) using SizeTransform(clip = false)
},
label = "RollOverlayDisplay",
) {
@ -372,6 +369,12 @@ private class RollOverlayPreviewProvider : PreviewParameterProvider<RollOverlayP
)
}
fun animation(density: Density): ContentTransform {
val enter = fadeIn() + slideInVertically { with(density) { 64.dp.roundToPx() } }
val exit = fadeOut() + slideOutVertically { with(density) { -64.dp.roundToPx() } }
return enter togetherWith exit
}
@Stable
interface BlurredRollOverlayHostState : BlurredOverlayHostState {
fun prepareRoll(roll: Roll)

View file

@ -12,8 +12,8 @@ import androidx.compose.ui.unit.sp
import com.pixelized.rplexicon.R
@Stable
val regalFontFamily = FontFamily(
Font(resId = R.font.regal, weight = FontWeight.Normal),
val zallFontFamily = FontFamily(
Font(resId = R.font.zallman_caps, weight = FontWeight.Normal)
)
@Stable
@ -29,14 +29,14 @@ class LexiconTypography(
fontFamily = stampFontFamily,
),
val bodyDropCap: TextStyle = base.displaySmall.copy(
fontFamily = regalFontFamily,
baselineShift = BaselineShift(-0.3f),
letterSpacing = (-6).sp
fontFamily = zallFontFamily,
baselineShift = BaselineShift(-0.1f),
letterSpacing = (-3).sp
),
val titleDropCap: TextStyle = base.displayLarge.copy(
fontFamily = regalFontFamily,
baselineShift = BaselineShift(-0.3f),
letterSpacing = (-8).sp
fontFamily = zallFontFamily,
baselineShift = BaselineShift(-0.1f),
letterSpacing = (-4).sp
),
val bodyDropCapSpan: SpanStyle = bodyDropCap.toSpanStyle(),
val titleDropCapSpan: SpanStyle = titleDropCap.toSpanStyle(),

Binary file not shown.

Binary file not shown.