Change Dropcap typography
This commit is contained in:
parent
255ad7aed8
commit
d25246f452
4 changed files with 17 additions and 14 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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.
BIN
app/src/main/res/font/zallman_caps.ttf
Normal file
BIN
app/src/main/res/font/zallman_caps.ttf
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue