mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-18 16:25:27 +02:00
Remove brand font (temporarily)
This commit is contained in:
parent
4938958cad
commit
3c52eb49c0
@ -49,7 +49,6 @@ import com.sadellie.unitto.core.ui.pushDynamicShortcut
|
||||
import com.sadellie.unitto.core.ui.theme.DarkThemeColors
|
||||
import com.sadellie.unitto.core.ui.theme.LightThemeColors
|
||||
import com.sadellie.unitto.core.ui.theme.TypographySystem
|
||||
import com.sadellie.unitto.core.ui.theme.TypographyUnitto
|
||||
import com.sadellie.unitto.data.userprefs.AppPreferences
|
||||
import io.github.sadellie.themmo.Themmo
|
||||
import io.github.sadellie.themmo.ThemmoController
|
||||
@ -91,7 +90,7 @@ internal fun UnittoApp(prefs: AppPreferences?) {
|
||||
|
||||
Themmo(
|
||||
themmoController = themmoController,
|
||||
typography = if (prefs.systemFont) TypographySystem else TypographyUnitto,
|
||||
typography = TypographySystem,
|
||||
animationSpec = tween(250)
|
||||
) {
|
||||
val backgroundColor = MaterialTheme.colorScheme.background
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -32,7 +32,6 @@ import androidx.compose.ui.text.font.Font
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.em
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.sadellie.unitto.core.base.R
|
||||
|
||||
@ -41,165 +40,31 @@ data class NumberTypography(
|
||||
val displayLarge: TextStyle,
|
||||
val displayMedium: TextStyle,
|
||||
val displaySmall: TextStyle,
|
||||
val headlineMedium: TextStyle,
|
||||
val headlineSmall: TextStyle,
|
||||
val bodyLarge: TextStyle,
|
||||
)
|
||||
|
||||
val TypographyUnitto by lazy {
|
||||
Typography(
|
||||
displayLarge = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 57.sp,
|
||||
lineHeight = 64.sp,
|
||||
letterSpacing = (-0.25).sp,
|
||||
),
|
||||
displayMedium = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 45.sp,
|
||||
lineHeight = 52.sp,
|
||||
letterSpacing = 0.sp,
|
||||
),
|
||||
displaySmall = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 36.sp,
|
||||
lineHeight = 44.sp,
|
||||
letterSpacing = 0.sp,
|
||||
),
|
||||
headlineLarge = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 32.sp,
|
||||
lineHeight = 40.sp,
|
||||
letterSpacing = 0.sp,
|
||||
),
|
||||
headlineMedium = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 28.sp,
|
||||
lineHeight = 36.sp,
|
||||
letterSpacing = 0.sp,
|
||||
),
|
||||
headlineSmall = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 24.sp,
|
||||
lineHeight = 32.sp,
|
||||
letterSpacing = 0.sp,
|
||||
),
|
||||
titleLarge = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 22.sp,
|
||||
lineHeight = 28.sp,
|
||||
letterSpacing = 0.sp,
|
||||
),
|
||||
titleMedium = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 18.sp,
|
||||
lineHeight = 24.sp,
|
||||
letterSpacing = 0.1.sp,
|
||||
),
|
||||
titleSmall = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 14.sp,
|
||||
lineHeight = 20.sp,
|
||||
letterSpacing = 0.1.sp,
|
||||
),
|
||||
bodyLarge = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 24.sp,
|
||||
letterSpacing = 0.5.sp,
|
||||
),
|
||||
bodyMedium = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 14.sp,
|
||||
lineHeight = 20.sp,
|
||||
letterSpacing = 0.25.sp,
|
||||
),
|
||||
bodySmall = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 16.sp,
|
||||
letterSpacing = 0.4.sp,
|
||||
),
|
||||
labelLarge = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 14.sp,
|
||||
lineHeight = 20.sp,
|
||||
letterSpacing = (-0.4).sp,
|
||||
),
|
||||
labelMedium = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 16.sp,
|
||||
letterSpacing = (-0.3).sp,
|
||||
),
|
||||
labelSmall = TextStyle(
|
||||
fontFamily = montserratFamily,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 10.sp,
|
||||
lineHeight = 16.sp,
|
||||
letterSpacing = (-0.3).sp,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
val NumberTypographyUnitto by lazy {
|
||||
NumberTypography(
|
||||
displayLarge = TextStyle(
|
||||
fontFamily = latoFamily,
|
||||
fontFamily = FontFamily.lato,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 57.sp,
|
||||
lineHeight = (1.25).em,
|
||||
letterSpacing = (-0.25).sp,
|
||||
lineHeight = 64.0.sp,
|
||||
letterSpacing = (-0.2).sp,
|
||||
),
|
||||
displayMedium = TextStyle(
|
||||
fontFamily = latoFamily,
|
||||
fontFamily = FontFamily.lato,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 38.sp,
|
||||
lineHeight = 42.sp,
|
||||
letterSpacing = (-0.25).sp,
|
||||
fontSize = 45.sp,
|
||||
lineHeight = 52.0.sp,
|
||||
letterSpacing = 0.0.sp,
|
||||
),
|
||||
displaySmall = TextStyle(
|
||||
fontFamily = latoFamily,
|
||||
fontFamily = FontFamily.lato,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 36.sp,
|
||||
lineHeight = 44.sp,
|
||||
letterSpacing = 0.sp,
|
||||
lineHeight = 44.0.sp,
|
||||
letterSpacing = 0.0.sp,
|
||||
),
|
||||
headlineMedium = TextStyle(
|
||||
fontFamily = latoFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 28.sp,
|
||||
lineHeight = 1.25.em,
|
||||
letterSpacing = 0.sp,
|
||||
),
|
||||
headlineSmall = TextStyle(
|
||||
fontFamily = latoFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 24.sp,
|
||||
lineHeight = 1.25.em,
|
||||
letterSpacing = 0.sp,
|
||||
),
|
||||
bodyLarge = TextStyle(
|
||||
fontFamily = latoFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 1.5.em,
|
||||
letterSpacing = 0.5.sp,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@ -210,32 +75,21 @@ val NumberTypographySystem by lazy {
|
||||
displayLarge = TypographySystem.displayLarge,
|
||||
displayMedium = TypographySystem.displayMedium,
|
||||
displaySmall = TypographySystem.displaySmall,
|
||||
headlineMedium = TypographySystem.headlineMedium,
|
||||
headlineSmall = TypographySystem.headlineSmall,
|
||||
bodyLarge = TypographySystem.bodyLarge
|
||||
)
|
||||
}
|
||||
|
||||
val LocalNumberTypography = staticCompositionLocalOf { NumberTypographySystem }
|
||||
|
||||
private val montserratFamily by lazy {
|
||||
FontFamily(
|
||||
Font(R.font.montserrat_light, weight = FontWeight.Light),
|
||||
Font(R.font.montserrat_regular, weight = FontWeight.Normal),
|
||||
Font(R.font.montserrat_medium, weight = FontWeight.Medium),
|
||||
Font(R.font.montserrat_semibold, weight = FontWeight.SemiBold),
|
||||
private val FontFamily.Companion.lato: FontFamily
|
||||
get() = FontFamily(
|
||||
Font(R.font.lato_regular, weight = FontWeight.Normal)
|
||||
)
|
||||
}
|
||||
|
||||
private val latoFamily by lazy {
|
||||
FontFamily(Font(R.font.lato_regular))
|
||||
}
|
||||
|
||||
@Preview(widthDp = 480)
|
||||
@Composable
|
||||
private fun PreviewTypography() {
|
||||
MaterialTheme(
|
||||
typography = TypographyUnitto
|
||||
typography = TypographySystem
|
||||
) {
|
||||
val textStyles = mapOf(
|
||||
"displayLarge" to MaterialTheme.typography.displayLarge,
|
||||
|
@ -48,7 +48,6 @@ import com.sadellie.unitto.core.ui.datetime.formatDateWeekDayMonthYear
|
||||
import com.sadellie.unitto.core.ui.datetime.formatTime
|
||||
import com.sadellie.unitto.core.ui.datetime.formatTime12Short
|
||||
import com.sadellie.unitto.core.ui.datetime.formatTimeAmPm
|
||||
import com.sadellie.unitto.core.ui.theme.LocalNumberTypography
|
||||
import java.time.ZonedDateTime
|
||||
|
||||
@Composable
|
||||
@ -94,7 +93,7 @@ internal fun DateTimeSelectorBlock(
|
||||
onClick = onTimeClick
|
||||
),
|
||||
text = time.formatTime(locale, true),
|
||||
style = LocalNumberTypography.current.displaySmall,
|
||||
style = MaterialTheme.typography.displaySmall,
|
||||
maxLines = 1
|
||||
)
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ import androidx.compose.animation.Crossfade
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TopAppBarDefaults
|
||||
@ -49,7 +50,6 @@ import com.sadellie.unitto.core.ui.common.UnittoEmptyScreen
|
||||
import com.sadellie.unitto.core.ui.common.UnittoListItem
|
||||
import com.sadellie.unitto.core.ui.common.UnittoSearchBar
|
||||
import com.sadellie.unitto.core.ui.datetime.formatTime
|
||||
import com.sadellie.unitto.core.ui.theme.LocalNumberTypography
|
||||
import com.sadellie.unitto.data.common.displayName
|
||||
import com.sadellie.unitto.data.common.offset
|
||||
import com.sadellie.unitto.data.common.regionName
|
||||
@ -123,7 +123,7 @@ fun AddTimeZoneScreen(
|
||||
text = it.timeZone
|
||||
.offset(userTime)
|
||||
.formatTime(locale, is24Hour),
|
||||
style = LocalNumberTypography.current.headlineSmall
|
||||
style = MaterialTheme.typography.headlineSmall
|
||||
)
|
||||
}
|
||||
)
|
||||
|
@ -69,7 +69,6 @@ import com.sadellie.unitto.core.base.R
|
||||
import com.sadellie.unitto.core.ui.LocalLocale
|
||||
import com.sadellie.unitto.core.ui.datetime.formatOffset
|
||||
import com.sadellie.unitto.core.ui.datetime.formatTime
|
||||
import com.sadellie.unitto.core.ui.theme.LocalNumberTypography
|
||||
import com.sadellie.unitto.data.common.offset
|
||||
import com.sadellie.unitto.data.common.regionName
|
||||
import com.sadellie.unitto.data.model.timezone.FavoriteZone
|
||||
@ -160,7 +159,7 @@ internal fun FavoriteTimeZoneItem(
|
||||
// TODO Add AM PM as dots (apply to 12 and 24 hour systems)
|
||||
Text(
|
||||
text = time,
|
||||
style = LocalNumberTypography.current.headlineMedium,
|
||||
style = MaterialTheme.typography.headlineMedium,
|
||||
color = MaterialTheme.colorScheme.onSurface
|
||||
)
|
||||
}
|
||||
|
@ -55,7 +55,6 @@ import com.sadellie.unitto.core.ui.datetime.formatDateDayMonthYear
|
||||
import com.sadellie.unitto.core.ui.datetime.formatTimeHours
|
||||
import com.sadellie.unitto.core.ui.datetime.formatTimeMinutes
|
||||
import com.sadellie.unitto.core.ui.datetime.formatZone
|
||||
import com.sadellie.unitto.core.ui.theme.LocalNumberTypography
|
||||
import java.time.ZonedDateTime
|
||||
|
||||
@Composable
|
||||
@ -83,7 +82,7 @@ internal fun UserTimeZone(
|
||||
Column(Modifier.weight(1f)) {
|
||||
Text(
|
||||
text = userTime.formatZone(locale),
|
||||
style = LocalNumberTypography.current.bodyLarge,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.onTertiaryContainer
|
||||
)
|
||||
|
||||
@ -120,7 +119,7 @@ internal fun UserTimeZone(
|
||||
@Composable
|
||||
private fun SlidingText(
|
||||
text: String,
|
||||
style: TextStyle = LocalNumberTypography.current.displayLarge
|
||||
style: TextStyle = MaterialTheme.typography.displayLarge
|
||||
) {
|
||||
AnimatedContent(
|
||||
targetState = text,
|
||||
@ -144,7 +143,7 @@ private fun SlidingText(
|
||||
@Composable
|
||||
private fun TimeSeparator(
|
||||
text: String = ":",
|
||||
style: TextStyle = LocalNumberTypography.current.displayLarge
|
||||
style: TextStyle = MaterialTheme.typography.displayLarge
|
||||
) {
|
||||
Text(
|
||||
text = text,
|
||||
|
Loading…
x
Reference in New Issue
Block a user