diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/appearance/AppearanceSettingsScreenVM.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/appearance/AppearanceSettingsScreenVM.kt index 37689a750..b96076f9f 100644 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/appearance/AppearanceSettingsScreenVM.kt +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/appearance/AppearanceSettingsScreenVM.kt @@ -3,7 +3,6 @@ package de.mm20.launcher2.ui.settings.appearance import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import de.mm20.launcher2.preferences.ColorScheme -import de.mm20.launcher2.preferences.Font import de.mm20.launcher2.preferences.ui.UiSettings import de.mm20.launcher2.themes.ThemeRepository import kotlinx.coroutines.flow.SharingStarted @@ -59,11 +58,4 @@ class AppearanceSettingsScreenVM : ViewModel(), KoinComponent { fun setCompatModeColors(enabled: Boolean) { uiSettings.setCompatModeColors(enabled) } - - val font = uiSettings.font - .stateIn(viewModelScope, SharingStarted.WhileSubscribed(), null) - - fun setFont(font: Font) { - uiSettings.setFont(font) - } } \ No newline at end of file diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/typography/TypographySettingsScreen.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/typography/TypographySettingsScreen.kt index cb3292870..e94b7a91f 100644 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/typography/TypographySettingsScreen.kt +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/typography/TypographySettingsScreen.kt @@ -859,7 +859,8 @@ private fun FontPickerCategory( private fun getFontName(context: Context, fontFamily: ThemeFontFamily?): String { return when (fontFamily) { - is ThemeFontFamily.LauncherDefault -> "Outfit" + is ThemeFontFamily.LauncherDefault -> "Google Sans Flex" + is ThemeFontFamily.LauncherDefaultRound -> "Google Sans Flex (Rounded)" is ThemeFontFamily.DeviceHeadline -> context.getString(R.string.font_name_device_headline) is ThemeFontFamily.DeviceBody -> context.getString(R.string.font_name_device_body) is ThemeFontFamily.System -> fontFamily.name diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/theme/LauncherTheme.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/theme/LauncherTheme.kt index f01d45561..4ab979434 100644 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/theme/LauncherTheme.kt +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/theme/LauncherTheme.kt @@ -1,20 +1,20 @@ package de.mm20.launcher2.ui.theme -import android.content.Context import androidx.compose.foundation.isSystemInDarkTheme -import androidx.compose.material3.* -import androidx.compose.runtime.* -import androidx.compose.ui.platform.LocalContext -import de.mm20.launcher2.preferences.Font +import androidx.compose.material3.MaterialExpressiveTheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember import de.mm20.launcher2.preferences.ui.UiSettings import de.mm20.launcher2.themes.ThemeRepository import de.mm20.launcher2.ui.locals.LocalDarkTheme -import de.mm20.launcher2.ui.theme.colorscheme.* +import de.mm20.launcher2.ui.theme.colorscheme.darkColorSchemeOf +import de.mm20.launcher2.ui.theme.colorscheme.lightColorSchemeOf import de.mm20.launcher2.ui.theme.shapes.shapesOf import de.mm20.launcher2.ui.theme.transparency.LocalTransparencyScheme import de.mm20.launcher2.ui.theme.transparency.transparencySchemeOf -import de.mm20.launcher2.ui.theme.typography.DefaultTypography -import de.mm20.launcher2.ui.theme.typography.getDeviceDefaultTypography import de.mm20.launcher2.ui.theme.typography.typographyOf import kotlinx.coroutines.flow.flatMapLatest import org.koin.compose.koinInject @@ -74,10 +74,6 @@ fun LauncherTheme( val transparencyScheme = transparencySchemeOf(themeTransparencies!!) - val font by remember { uiSettings.font }.collectAsState( - Font.Outfit - ) - CompositionLocalProvider( LocalDarkTheme provides darkTheme, LocalTransparencyScheme provides transparencyScheme, @@ -91,9 +87,3 @@ fun LauncherTheme( } } -fun getTypography(context: Context, font: Font?): Typography { - return when (font) { - Font.System -> getDeviceDefaultTypography(context) - else -> DefaultTypography - } -} \ No newline at end of file diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/Common.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/Common.kt deleted file mode 100644 index e53a9b754..000000000 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/Common.kt +++ /dev/null @@ -1,43 +0,0 @@ -package de.mm20.launcher2.ui.theme.typography - -import androidx.compose.material3.Typography -import androidx.compose.ui.text.font.FontFamily -import androidx.compose.ui.text.font.FontWeight - -fun makeTypography( - headlineFamily: FontFamily? = null, - bodyFamily: FontFamily? = null): Typography { - val baseTypography = Typography() - return Typography( - displayLarge = baseTypography.displayLarge.copy(fontFamily = headlineFamily, fontWeight = FontWeight.Medium), - displayLargeEmphasized = baseTypography.displayLarge.copy(fontFamily = headlineFamily, fontWeight = FontWeight.SemiBold), - displayMedium = baseTypography.displayMedium.copy(fontFamily = headlineFamily, fontWeight = FontWeight.Medium), - displayMediumEmphasized = baseTypography.displayMedium.copy(fontFamily = headlineFamily, fontWeight = FontWeight.SemiBold), - displaySmall = baseTypography.displaySmall.copy(fontFamily = headlineFamily, fontWeight = FontWeight.Medium), - displaySmallEmphasized = baseTypography.displaySmall.copy(fontFamily = headlineFamily, fontWeight = FontWeight.SemiBold), - headlineLarge = baseTypography.headlineLarge.copy(fontFamily = headlineFamily, fontWeight = FontWeight.SemiBold), - headlineLargeEmphasized = baseTypography.headlineLarge.copy(fontFamily = headlineFamily, fontWeight = FontWeight.Bold), - headlineMedium = baseTypography.headlineMedium.copy(fontFamily = headlineFamily, fontWeight = FontWeight.SemiBold), - headlineMediumEmphasized = baseTypography.headlineMedium.copy(fontFamily = headlineFamily, fontWeight = FontWeight.Bold), - headlineSmall = baseTypography.headlineSmall.copy(fontFamily = headlineFamily, fontWeight = FontWeight.SemiBold), - headlineSmallEmphasized = baseTypography.headlineSmall.copy(fontFamily = headlineFamily, fontWeight = FontWeight.Bold), - titleLarge = baseTypography.titleLarge.copy(fontFamily = headlineFamily, fontWeight = FontWeight.SemiBold), - titleLargeEmphasized = baseTypography.titleLargeEmphasized.copy(fontFamily = headlineFamily, fontWeight = FontWeight.Bold), - titleMedium = baseTypography.titleMedium.copy(fontFamily = headlineFamily, fontWeight = FontWeight.SemiBold), - titleMediumEmphasized = baseTypography.titleMediumEmphasized.copy(fontFamily = headlineFamily), - titleSmall = baseTypography.titleSmall.copy(fontFamily = headlineFamily, fontWeight = FontWeight.SemiBold), - titleSmallEmphasized = baseTypography.titleSmallEmphasized.copy(fontFamily = headlineFamily, fontWeight = FontWeight.Bold), - bodyLarge = baseTypography.bodyLarge.copy(fontFamily = bodyFamily), - bodyLargeEmphasized = baseTypography.bodyLargeEmphasized.copy(fontFamily = bodyFamily, fontWeight = FontWeight.Medium), - bodyMedium = baseTypography.bodyMedium.copy(fontFamily = bodyFamily), - bodyMediumEmphasized = baseTypography.bodyMediumEmphasized.copy(fontFamily = bodyFamily, fontWeight = FontWeight.Medium), - bodySmall = baseTypography.bodySmall.copy(fontFamily = bodyFamily), - bodySmallEmphasized = baseTypography.bodySmallEmphasized.copy(fontFamily = bodyFamily, fontWeight = FontWeight.Medium), - labelLarge = baseTypography.labelLarge.copy(fontFamily = headlineFamily, fontWeight = FontWeight.Medium), - labelLargeEmphasized = baseTypography.labelLargeEmphasized.copy(fontFamily = headlineFamily, fontWeight = FontWeight.SemiBold), - labelMedium = baseTypography.labelMedium.copy(fontFamily = headlineFamily, fontWeight = FontWeight.Medium), - labelMediumEmphasized = baseTypography.labelMediumEmphasized.copy(fontFamily = headlineFamily, fontWeight = FontWeight.SemiBold), - labelSmall = baseTypography.labelSmall.copy(fontFamily = headlineFamily, fontWeight = FontWeight.Medium), - labelSmallEmphasized = baseTypography.labelSmallEmphasized.copy(fontFamily = headlineFamily, fontWeight = FontWeight.SemiBold), - ) -} \ No newline at end of file diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/Default.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/Default.kt deleted file mode 100644 index 8f5eb3b29..000000000 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/Default.kt +++ /dev/null @@ -1,5 +0,0 @@ -package de.mm20.launcher2.ui.theme.typography - -import de.mm20.launcher2.ui.theme.typography.fontfamily.Outfit - -val DefaultTypography = makeTypography(headlineFamily = Outfit) \ No newline at end of file diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/SystemDefault.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/SystemDefault.kt deleted file mode 100644 index 2df017cb9..000000000 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/SystemDefault.kt +++ /dev/null @@ -1,10 +0,0 @@ -package de.mm20.launcher2.ui.theme.typography - -import android.content.Context -import androidx.compose.material3.Typography -import androidx.compose.ui.text.font.* -import de.mm20.launcher2.ui.theme.typography.fontfamily.getDeviceHeadlineFontFamily - -fun getDeviceDefaultTypography(context: Context): Typography { - return makeTypography(headlineFamily = getDeviceHeadlineFontFamily(context)) -} \ No newline at end of file diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/Typography.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/Typography.kt index 928676c23..1e7c6dbf2 100644 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/Typography.kt +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/Typography.kt @@ -12,7 +12,8 @@ import androidx.compose.ui.unit.em import androidx.compose.ui.unit.sp import de.mm20.launcher2.themes.typography.DefaultEmphasizedTextStyles import de.mm20.launcher2.themes.typography.DefaultTextStyles -import de.mm20.launcher2.ui.theme.typography.fontfamily.Outfit +import de.mm20.launcher2.ui.theme.typography.fontfamily.GoogleSansFlex +import de.mm20.launcher2.ui.theme.typography.fontfamily.GoogleSansFlexRound import de.mm20.launcher2.ui.theme.typography.fontfamily.getDeviceBodyFontFamily import de.mm20.launcher2.ui.theme.typography.fontfamily.getDeviceHeadlineFontFamily import de.mm20.launcher2.themes.typography.FontFamily as ThemeFontFamily @@ -316,7 +317,8 @@ fun fontFamilyOf( fontFamily: ThemeFontFamily? ): FontFamily { return when (fontFamily) { - is ThemeFontFamily.LauncherDefault -> Outfit + is ThemeFontFamily.LauncherDefault -> GoogleSansFlex + is ThemeFontFamily.LauncherDefaultRound -> GoogleSansFlexRound is ThemeFontFamily.DeviceHeadline -> getDeviceHeadlineFontFamily(context) is ThemeFontFamily.DeviceBody -> getDeviceBodyFontFamily(context) is ThemeFontFamily.SansSerif -> FontFamily.SansSerif diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/fontfamily/GoogleSansFlex.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/fontfamily/GoogleSansFlex.kt new file mode 100644 index 000000000..cfd705b7d --- /dev/null +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/fontfamily/GoogleSansFlex.kt @@ -0,0 +1,16 @@ +package de.mm20.launcher2.ui.theme.typography.fontfamily + +import androidx.compose.ui.text.font.FontVariation +import de.mm20.launcher2.ui.R + + + +val GoogleSansFlex = createVariableFontFamily( + R.font.google_sans_flex, + FontVariation.roundness(0f) +) + +val GoogleSansFlexRound = createVariableFontFamily( + R.font.google_sans_flex, + FontVariation.roundness( 100f) +) \ No newline at end of file diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/fontfamily/Outfit.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/fontfamily/Outfit.kt deleted file mode 100644 index fe2eb32f3..000000000 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/fontfamily/Outfit.kt +++ /dev/null @@ -1,19 +0,0 @@ -package de.mm20.launcher2.ui.theme.typography.fontfamily - -import androidx.compose.ui.text.font.Font -import androidx.compose.ui.text.font.FontFamily -import androidx.compose.ui.text.font.FontStyle -import androidx.compose.ui.text.font.FontWeight -import de.mm20.launcher2.ui.R - -val Outfit = FontFamily( - Font(R.font.outfit_100, weight = FontWeight.Thin, style = FontStyle.Normal), - Font(R.font.outfit_200, weight = FontWeight.ExtraLight, style = FontStyle.Normal), - Font(R.font.outfit_300, weight = FontWeight.Light, style = FontStyle.Normal), - Font(R.font.outfit_400, weight = FontWeight.Normal, style = FontStyle.Normal), - Font(R.font.outfit_500, weight = FontWeight.Medium, style = FontStyle.Normal), - Font(R.font.outfit_600, weight = FontWeight.SemiBold, style = FontStyle.Normal), - Font(R.font.outfit_700, weight = FontWeight.Bold, style = FontStyle.Normal), - Font(R.font.outfit_800, weight = FontWeight.ExtraBold, style = FontStyle.Normal), - Font(R.font.outfit_900, weight = FontWeight.Black, style = FontStyle.Normal), -) \ No newline at end of file diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/fontfamily/VariableFont.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/fontfamily/VariableFont.kt new file mode 100644 index 000000000..df6c2bda4 --- /dev/null +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/theme/typography/fontfamily/VariableFont.kt @@ -0,0 +1,41 @@ +package de.mm20.launcher2.ui.theme.typography.fontfamily + +import androidx.annotation.FontRes +import androidx.compose.ui.text.font.Font +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontStyle +import androidx.compose.ui.text.font.FontVariation +import androidx.compose.ui.text.font.FontWeight + +internal fun FontVariation.roundness(roundness: Float): FontVariation.Setting { + return Setting("ROND", roundness) +} + +internal fun createVariableFontFamily(@FontRes resId: Int, vararg settings: FontVariation.Setting): FontFamily { + val fonts = mutableListOf() + for (weight in 100..900 step 100) { + fonts += Font( + resId = resId, + weight = FontWeight(weight), + style = FontStyle.Normal, + variationSettings = + FontVariation.Settings( + weight = FontWeight(weight), + style = FontStyle.Normal, + *settings + ) + ) + fonts += Font( + resId = resId, + weight = FontWeight(weight), + style = FontStyle.Italic, + variationSettings = + FontVariation.Settings( + weight = FontWeight(weight), + style = FontStyle.Italic, + *settings + ) + ) + } + return FontFamily(fonts) +} \ No newline at end of file diff --git a/core/base/src/main/java/de/mm20/launcher2/licenses/OpenSourceLicenses.kt b/core/base/src/main/java/de/mm20/launcher2/licenses/OpenSourceLicenses.kt index d7471a800..cba47094d 100644 --- a/core/base/src/main/java/de/mm20/launcher2/licenses/OpenSourceLicenses.kt +++ b/core/base/src/main/java/de/mm20/launcher2/licenses/OpenSourceLicenses.kt @@ -121,12 +121,11 @@ val OpenSourceLicenses = arrayOf( url = "https://insert-koin.io/" ), OpenSourceLibrary( - name = "Outfit", + name = "Google Sans Flex", description = "A geometric sans serif typeface", - copyrightNote = "Copyright 2021 The Outfit Project Authors", licenseName = R.string.open_font_license_name, licenseText = R.raw.license_ofl, - url = "https://github.com/Outfitio/Outfit-Fonts" + url = "https://fonts.google.com/specimen/Google+Sans+Flex" ), OpenSourceLibrary( name = "Coil", diff --git a/core/base/src/main/res/font/google_sans_flex.ttf b/core/base/src/main/res/font/google_sans_flex.ttf new file mode 100644 index 000000000..83f272d22 Binary files /dev/null and b/core/base/src/main/res/font/google_sans_flex.ttf differ diff --git a/core/base/src/main/res/font/outfit_100.otf b/core/base/src/main/res/font/outfit_100.otf deleted file mode 100644 index e8ec21f57..000000000 Binary files a/core/base/src/main/res/font/outfit_100.otf and /dev/null differ diff --git a/core/base/src/main/res/font/outfit_200.otf b/core/base/src/main/res/font/outfit_200.otf deleted file mode 100644 index 9f32afda3..000000000 Binary files a/core/base/src/main/res/font/outfit_200.otf and /dev/null differ diff --git a/core/base/src/main/res/font/outfit_300.otf b/core/base/src/main/res/font/outfit_300.otf deleted file mode 100644 index 482e58a97..000000000 Binary files a/core/base/src/main/res/font/outfit_300.otf and /dev/null differ diff --git a/core/base/src/main/res/font/outfit_400.otf b/core/base/src/main/res/font/outfit_400.otf deleted file mode 100644 index eae6444de..000000000 Binary files a/core/base/src/main/res/font/outfit_400.otf and /dev/null differ diff --git a/core/base/src/main/res/font/outfit_500.otf b/core/base/src/main/res/font/outfit_500.otf deleted file mode 100644 index 1ce346f69..000000000 Binary files a/core/base/src/main/res/font/outfit_500.otf and /dev/null differ diff --git a/core/base/src/main/res/font/outfit_600.otf b/core/base/src/main/res/font/outfit_600.otf deleted file mode 100644 index f752cd108..000000000 Binary files a/core/base/src/main/res/font/outfit_600.otf and /dev/null differ diff --git a/core/base/src/main/res/font/outfit_700.otf b/core/base/src/main/res/font/outfit_700.otf deleted file mode 100644 index 5ce457218..000000000 Binary files a/core/base/src/main/res/font/outfit_700.otf and /dev/null differ diff --git a/core/base/src/main/res/font/outfit_800.otf b/core/base/src/main/res/font/outfit_800.otf deleted file mode 100644 index 1af52bb9d..000000000 Binary files a/core/base/src/main/res/font/outfit_800.otf and /dev/null differ diff --git a/core/base/src/main/res/font/outfit_900.otf b/core/base/src/main/res/font/outfit_900.otf deleted file mode 100644 index c2d90455e..000000000 Binary files a/core/base/src/main/res/font/outfit_900.otf and /dev/null differ diff --git a/core/preferences/src/main/java/de/mm20/launcher2/preferences/LauncherSettingsData.kt b/core/preferences/src/main/java/de/mm20/launcher2/preferences/LauncherSettingsData.kt index 342945f61..13e290283 100644 --- a/core/preferences/src/main/java/de/mm20/launcher2/preferences/LauncherSettingsData.kt +++ b/core/preferences/src/main/java/de/mm20/launcher2/preferences/LauncherSettingsData.kt @@ -24,7 +24,6 @@ data class LauncherSettingsData internal constructor( val uiTypographyId: UUID = UUID(0L, 0L), val uiCompatModeColors: Boolean = false, - val uiFont: Font = Font.Outfit, @Deprecated("No longer in use, only used for migration") val uiBaseLayout: BaseLayout = BaseLayout.PullDown, val uiOrientation: ScreenOrientation = ScreenOrientation.Auto, @@ -220,12 +219,6 @@ enum class ColorScheme { System, } -@Serializable -enum class Font { - Outfit, - System, -} - internal enum class ClockWidgetStyleEnum { Digital1, Digital2, diff --git a/core/preferences/src/main/java/de/mm20/launcher2/preferences/ui/UiSettings.kt b/core/preferences/src/main/java/de/mm20/launcher2/preferences/ui/UiSettings.kt index 48c4808af..076b56062 100644 --- a/core/preferences/src/main/java/de/mm20/launcher2/preferences/ui/UiSettings.kt +++ b/core/preferences/src/main/java/de/mm20/launcher2/preferences/ui/UiSettings.kt @@ -1,7 +1,6 @@ package de.mm20.launcher2.preferences.ui import de.mm20.launcher2.preferences.ColorScheme -import de.mm20.launcher2.preferences.Font import de.mm20.launcher2.preferences.IconShape import de.mm20.launcher2.preferences.LauncherDataStore import de.mm20.launcher2.preferences.ScreenOrientation @@ -329,17 +328,6 @@ class UiSettings internal constructor( } } - val font - get() = launcherDataStore.data.map { - it.uiFont - }.distinctUntilChanged() - - fun setFont(font: Font) { - launcherDataStore.update { - it.copy(uiFont = font) - } - } - fun setColorScheme(colorScheme: ColorScheme) { launcherDataStore.update { it.copy(uiColorScheme = colorScheme) diff --git a/data/themes/src/main/java/de/mm20/launcher2/themes/DefaultThemes.kt b/data/themes/src/main/java/de/mm20/launcher2/themes/DefaultThemes.kt index c1e00ac6a..7301777a1 100644 --- a/data/themes/src/main/java/de/mm20/launcher2/themes/DefaultThemes.kt +++ b/data/themes/src/main/java/de/mm20/launcher2/themes/DefaultThemes.kt @@ -16,4 +16,5 @@ val SemiTransparentId = UUID(0L, 1L) val SystemFontId = UUID(0L, 1L) val MonospaceId = UUID(0L, 2L) -val SerifId = UUID(0L, 3L) \ No newline at end of file +val SerifId = UUID(0L, 3L) +val RoundedTypographyId = UUID(0L, 4L) \ No newline at end of file diff --git a/data/themes/src/main/java/de/mm20/launcher2/themes/typography/FontManager.kt b/data/themes/src/main/java/de/mm20/launcher2/themes/typography/FontManager.kt index 6a1d8a845..70a7b28b7 100644 --- a/data/themes/src/main/java/de/mm20/launcher2/themes/typography/FontManager.kt +++ b/data/themes/src/main/java/de/mm20/launcher2/themes/typography/FontManager.kt @@ -29,7 +29,7 @@ class FontManager( val deviceBodyExists = deviceBodyResId != 0 && context.resources.getString(deviceBodyResId).isNotBlank() return FontList( - builtIn = listOf(FontFamily.LauncherDefault), + builtIn = listOf(FontFamily.LauncherDefault, FontFamily.LauncherDefaultRound), generic = listOf( FontFamily.SansSerif, FontFamily.Serif, diff --git a/data/themes/src/main/java/de/mm20/launcher2/themes/typography/Typography.kt b/data/themes/src/main/java/de/mm20/launcher2/themes/typography/Typography.kt index 6ce88f76e..7593e9f9c 100644 --- a/data/themes/src/main/java/de/mm20/launcher2/themes/typography/Typography.kt +++ b/data/themes/src/main/java/de/mm20/launcher2/themes/typography/Typography.kt @@ -185,6 +185,10 @@ sealed interface FontFamily { @SerialName("launcher_default") data object LauncherDefault : FontFamily + @Serializable + @SerialName("launcher_default_round") + data object LauncherDefaultRound : FontFamily + @Serializable @SerialName("device_headline") data object DeviceHeadline : FontFamily diff --git a/data/themes/src/main/java/de/mm20/launcher2/themes/typography/TypographyRepository.kt b/data/themes/src/main/java/de/mm20/launcher2/themes/typography/TypographyRepository.kt index 25b1a3de0..c61a0b2a4 100644 --- a/data/themes/src/main/java/de/mm20/launcher2/themes/typography/TypographyRepository.kt +++ b/data/themes/src/main/java/de/mm20/launcher2/themes/typography/TypographyRepository.kt @@ -5,6 +5,7 @@ import de.mm20.launcher2.database.AppDatabase import de.mm20.launcher2.themes.DefaultThemeId import de.mm20.launcher2.themes.MonospaceId import de.mm20.launcher2.themes.R +import de.mm20.launcher2.themes.RoundedTypographyId import de.mm20.launcher2.themes.SerifId import de.mm20.launcher2.themes.SystemFontId import kotlinx.coroutines.CoroutineScope @@ -30,6 +31,7 @@ class TypographyRepository( fun get(id: UUID): Flow { if (id == DefaultThemeId) return flowOf(default) + if (id == RoundedTypographyId) return flowOf(defaultRound) if (id == SystemFontId) return flowOf(systemFont) if (id == SerifId) return flowOf(serif) if (id == MonospaceId) return flowOf(monospace) @@ -63,6 +65,7 @@ class TypographyRepository( private fun getBuiltIn(): List { return listOf( default, + defaultRound, systemFont, serif, monospace, @@ -73,10 +76,23 @@ class TypographyRepository( get() = Typography( id = DefaultThemeId, builtIn = true, - name = "Outfit", + name = "Google Sans", fonts = mapOf( "brand" to FontFamily.LauncherDefault, - "plain" to null, + "plain" to FontFamily.LauncherDefault, + ), + styles = DefaultTextStyles, + emphasizedStyles = DefaultEmphasizedTextStyles, + ) + + private val defaultRound: Typography + get() = Typography( + id = RoundedTypographyId, + builtIn = true, + name = "Google Sans (Rounded)", + fonts = mapOf( + "brand" to FontFamily.LauncherDefaultRound, + "plain" to FontFamily.LauncherDefaultRound, ), styles = DefaultTextStyles, emphasizedStyles = DefaultEmphasizedTextStyles,