diff --git a/LICENSE b/LICENSE index a1391a1d..d21a455a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Zcash +Copyright (c) 2021-2023 Zcash Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/docs/Third party licenses.md b/docs/Third party licenses.md index d391ec35..9da8e566 100644 --- a/docs/Third party licenses.md +++ b/docs/Third party licenses.md @@ -1,9 +1,11 @@ # Third Party Licenses -The majority of the contents of this Git repository are covered under the [LICENSE](../LICENSE). However certain items, as described below, are under different license. +The majority of the contents of this Git repository are covered under the [LICENSE](../LICENSE). However certain +items, as described below, are under different license. -## Electric Coin Company copyrights trademarks +## Fonts +We use these fonts from Google Fonts: +- [Inter](https://fonts.google.com/specimen/Inter) font family +- [Archivo](https://fonts.google.com/specimen/Archivo) font family - -## Inter Font -We use fonts from Inter font family. The fonts are downloaded from [Google Fonts](https://fonts.google.com/specimen/Inter) and are licensed under the [Open Font License](https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL). +Both are licensed under the [Open Font License](https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL). diff --git a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/component/Chip.kt b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/component/Chip.kt index 9ee190f1..6b9813e0 100644 --- a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/component/Chip.kt +++ b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/component/Chip.kt @@ -45,7 +45,7 @@ fun Chip( ) { Text( text = (index.value + 1).toString(), - style = ZcashTheme.typography.chipIndex, + style = ZcashTheme.extendedTypography.chipIndex, color = ZcashTheme.colors.chipIndex ) Text( diff --git a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/component/Text.kt b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/component/Text.kt index 2d69f2ff..c254ac8c 100644 --- a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/component/Text.kt +++ b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/component/Text.kt @@ -74,7 +74,7 @@ fun ListItem( ) { Text( text = text, - style = ZcashTheme.typography.listItem, + style = ZcashTheme.extendedTypography.listItem, color = MaterialTheme.colorScheme.onBackground, modifier = modifier ) @@ -87,7 +87,7 @@ fun ListHeader( ) { Text( text = text, - style = ZcashTheme.typography.listItem, + style = ZcashTheme.extendedTypography.listItem, color = ZcashTheme.colors.onBackgroundHeader, modifier = modifier ) @@ -124,7 +124,7 @@ fun HeaderWithZecIcon( ) { Text( text = stringResource(R.string.amount_with_zec_currency_symbol, amount), - style = ZcashTheme.typography.zecBalance, + style = ZcashTheme.extendedTypography.zecBalance, color = MaterialTheme.colorScheme.onBackground, modifier = modifier ) diff --git a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ZcashTheme.kt b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ZcashTheme.kt index 7d1039a2..de989657 100644 --- a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ZcashTheme.kt +++ b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ZcashTheme.kt @@ -11,6 +11,8 @@ import co.electriccoin.zcash.ui.design.theme.internal.LightColorPalette import co.electriccoin.zcash.ui.design.theme.internal.LightExtendedColorPalette import co.electriccoin.zcash.ui.design.theme.internal.LocalExtendedColors import co.electriccoin.zcash.ui.design.theme.internal.LocalExtendedTypography +import co.electriccoin.zcash.ui.design.theme.internal.LocalTypographies +import co.electriccoin.zcash.ui.design.theme.internal.PrimaryTypography import co.electriccoin.zcash.ui.design.theme.internal.Typography @Composable @@ -34,7 +36,7 @@ fun ZcashTheme( ProvideDimens { MaterialTheme( colorScheme = baseColors, - typography = Typography, + typography = PrimaryTypography, content = content ) } @@ -47,7 +49,11 @@ object ZcashTheme { @Composable get() = LocalExtendedColors.current - val typography: ExtendedTypography + val typography: Typography + @Composable + get() = LocalTypographies.current + + val extendedTypography: ExtendedTypography @Composable get() = LocalExtendedTypography.current diff --git a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/internal/Typography.kt b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/internal/Typography.kt index f717d6e5..efb135f6 100644 --- a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/internal/Typography.kt +++ b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/internal/Typography.kt @@ -22,6 +22,7 @@ private val provider = GoogleFont.Provider( // We use bestEffort here to be able to get the closest font weight, if accidentally use // an unspecified font weight and not the default one. private val InterFont = GoogleFont(name = "Inter", bestEffort = true) +private val ArchivoFont = GoogleFont(name = "Archivo", bestEffort = true) private val InterFontFamily = FontFamily( Font(googleFont = InterFont, fontProvider = provider, weight = FontWeight.Normal), // W400 @@ -29,6 +30,12 @@ private val InterFontFamily = FontFamily( Font(googleFont = InterFont, fontProvider = provider, weight = FontWeight.SemiBold), // W600 Font(googleFont = InterFont, fontProvider = provider, weight = FontWeight.Bold) // W700 ) +private val ArchivoFontFamily = FontFamily( + Font(googleFont = ArchivoFont, fontProvider = provider, weight = FontWeight.Normal), // W400 + Font(googleFont = ArchivoFont, fontProvider = provider, weight = FontWeight.Medium), // W500 + Font(googleFont = ArchivoFont, fontProvider = provider, weight = FontWeight.SemiBold), // W600 + Font(googleFont = ArchivoFont, fontProvider = provider, weight = FontWeight.Bold) // W700 +) private val Zboto = FontFamily( Font(R.font.zboto, FontWeight.Normal) @@ -36,7 +43,7 @@ private val Zboto = FontFamily( // If you change this definition of our Typography, don't forget to check if you use only // the defined font weights above, otherwise the closest one will be used. -internal val Typography = Typography( +internal val PrimaryTypography = Typography( headlineLarge = TextStyle( fontFamily = InterFontFamily, fontWeight = FontWeight.SemiBold, @@ -59,6 +66,35 @@ internal val Typography = Typography( ) ) +internal val SecondaryTypography = Typography( + headlineLarge = TextStyle( + fontFamily = ArchivoFontFamily, + fontWeight = FontWeight.SemiBold, + fontSize = 30.sp + ), + bodyLarge = TextStyle( + fontFamily = ArchivoFontFamily, + fontWeight = FontWeight.Normal, + fontSize = 16.sp + ), + bodySmall = TextStyle( + fontFamily = ArchivoFontFamily, + fontWeight = FontWeight.Medium, + fontSize = 16.sp + ), + labelLarge = TextStyle( + fontFamily = ArchivoFontFamily, + fontWeight = FontWeight.Normal, + fontSize = 16.sp + ) +) + +@Immutable +data class Typography( + val primary: Typography, + val secondary: Typography +) + @Immutable data class ExtendedTypography( val chipIndex: TextStyle, @@ -66,15 +102,23 @@ data class ExtendedTypography( val zecBalance: TextStyle ) +@Suppress("CompositionLocalAllowlist") +val LocalTypographies = staticCompositionLocalOf { + Typography( + primary = PrimaryTypography, + secondary = SecondaryTypography + ) +} + @Suppress("CompositionLocalAllowlist") val LocalExtendedTypography = staticCompositionLocalOf { ExtendedTypography( - chipIndex = Typography.bodyLarge.copy( + chipIndex = PrimaryTypography.bodyLarge.copy( fontSize = 10.sp, baselineShift = BaselineShift.Superscript, fontWeight = FontWeight.Bold ), - listItem = Typography.bodyLarge.copy( + listItem = PrimaryTypography.bodyLarge.copy( fontSize = 24.sp ), zecBalance = TextStyle( diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/backup/view/ChipDropDown.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/backup/view/ChipDropDown.kt index e8379a93..960f667f 100644 --- a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/backup/view/ChipDropDown.kt +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/backup/view/ChipDropDown.kt @@ -68,7 +68,7 @@ fun ChipDropDown( ) { Text( text = (chipIndex.value + 1).toString(), - style = ZcashTheme.typography.chipIndex, + style = ZcashTheme.extendedTypography.chipIndex, color = ZcashTheme.colors.chipIndex ) Spacer(modifier = Modifier.padding(horizontal = 2.dp, vertical = 0.dp))