diff --git a/presentation/src/main/java/com/nto/presentation/MainActivity.kt b/presentation/src/main/java/com/nto/presentation/MainActivity.kt index aa9d469..3406b29 100644 --- a/presentation/src/main/java/com/nto/presentation/MainActivity.kt +++ b/presentation/src/main/java/com/nto/presentation/MainActivity.kt @@ -7,6 +7,8 @@ import androidx.activity.enableEdgeToEdge import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material3.Scaffold import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import com.nto.presentation.theme.NTOTheme import com.nto.presentation.theme.OnomatopoeiafrontTheme import dagger.hilt.android.AndroidEntryPoint @@ -17,9 +19,9 @@ class MainActivity : ComponentActivity() { super.onCreate(savedInstanceState) enableEdgeToEdge() setContent { - OnomatopoeiafrontTheme { + NTOTheme { Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -> - + //TODO } } } diff --git a/presentation/src/main/java/com/nto/presentation/theme/Color.kt b/presentation/src/main/java/com/nto/presentation/theme/Color.kt index e6a8074..3e8a890 100644 --- a/presentation/src/main/java/com/nto/presentation/theme/Color.kt +++ b/presentation/src/main/java/com/nto/presentation/theme/Color.kt @@ -1,11 +1,52 @@ package com.nto.presentation.theme import androidx.compose.ui.graphics.Color +import android.annotation.SuppressLint +import androidx.compose.runtime.Immutable +import androidx.compose.runtime.staticCompositionLocalOf -val Purple80 = Color(0xFFD0BCFF) -val PurpleGrey80 = Color(0xFFCCC2DC) -val Pink80 = Color(0xFFEFB8C8) +val TextGray = Color(0xFFC4BBC7) +val BoxGray = Color(0xFFF8F0FB) +val Green = Color(0xFF738D73) +val GreenDisabled = Color(0xFFCAD5CA) -val Purple40 = Color(0xFF6650a4) -val PurpleGrey40 = Color(0xFF625b71) -val Pink40 = Color(0xFF7D5260) \ No newline at end of file +@Immutable +data class AppColors( + val primaryBackground: Color, + val secondaryBackground: Color, + val inputFieldBackground: Color, + val disabledText: Color, + val primaryText: Color, + val secondaryText: Color, + val button: Color, + val buttonDisabled: Color, + val tint: Color, + + ) + +@SuppressLint("ComposeCompositionLocalUsage") +val LocalAppColors = staticCompositionLocalOf { + AppColors( + primaryBackground = Color.Unspecified, + secondaryBackground = Color.Unspecified, + inputFieldBackground = Color.Unspecified, + disabledText = Color.Unspecified, + primaryText = Color.Unspecified, + secondaryText = Color.Unspecified, + button = Color.Unspecified, + buttonDisabled = Color.Unspecified, + tint = Color.Unspecified + ) +} + +val extendedColor = AppColors( + primaryBackground = Color.White, + secondaryBackground = Color.Black, + inputFieldBackground = BoxGray, + disabledText = TextGray, + primaryText = Color.Black, + secondaryText = Color.White, + button = Green, + buttonDisabled = GreenDisabled, + tint = Color.Black +) \ No newline at end of file diff --git a/presentation/src/main/java/com/nto/presentation/theme/Theme.kt b/presentation/src/main/java/com/nto/presentation/theme/Theme.kt index 91e489a..640f279 100644 --- a/presentation/src/main/java/com/nto/presentation/theme/Theme.kt +++ b/presentation/src/main/java/com/nto/presentation/theme/Theme.kt @@ -1,57 +1,27 @@ package com.nto.presentation.theme -import android.os.Build -import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.darkColorScheme -import androidx.compose.material3.dynamicDarkColorScheme -import androidx.compose.material3.dynamicLightColorScheme -import androidx.compose.material3.lightColorScheme import androidx.compose.runtime.Composable -import androidx.compose.ui.platform.LocalContext - -private val DarkColorScheme = darkColorScheme( - primary = Purple80, - secondary = PurpleGrey80, - tertiary = Pink80 -) - -private val LightColorScheme = lightColorScheme( - primary = Purple40, - secondary = PurpleGrey40, - tertiary = Pink40 - - /* Other default colors to override - background = Color(0xFFFFFBFE), - surface = Color(0xFFFFFBFE), - onPrimary = Color.White, - onSecondary = Color.White, - onTertiary = Color.White, - onBackground = Color(0xFF1C1B1F), - onSurface = Color(0xFF1C1B1F), - */ -) +import androidx.compose.runtime.CompositionLocalProvider @Composable -fun OnomatopoeiafrontTheme( - darkTheme: Boolean = isSystemInDarkTheme(), - // Dynamic color is available on Android 12+ - dynamicColor: Boolean = true, +fun NTOTheme( content: @Composable () -> Unit ) { - val colorScheme = when { - dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { - val context = LocalContext.current - if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) - } - - darkTheme -> DarkColorScheme - else -> LightColorScheme + CompositionLocalProvider( + LocalAppColors provides extendedColor, + LocalAppTypography provides extendedTypography + ) { + MaterialTheme( + content = content + ) } +} - MaterialTheme( - colorScheme = colorScheme, - typography = Typography, - content = content - ) +object NTOTheme { + val colors: AppColors + @Composable get() = LocalAppColors.current + + val typography: AppTypography + @Composable get() = LocalAppTypography.current } \ No newline at end of file diff --git a/presentation/src/main/java/com/nto/presentation/theme/Type.kt b/presentation/src/main/java/com/nto/presentation/theme/Type.kt index 21cfb3c..6d7210d 100644 --- a/presentation/src/main/java/com/nto/presentation/theme/Type.kt +++ b/presentation/src/main/java/com/nto/presentation/theme/Type.kt @@ -1,34 +1,51 @@ package com.nto.presentation.theme -import androidx.compose.material3.Typography +import android.annotation.SuppressLint +import androidx.compose.runtime.Immutable +import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.text.TextStyle +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.unit.sp +import com.nto.presentation.R -// Set of Material typography styles to start with -val Typography = Typography( - bodyLarge = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Normal, - fontSize = 16.sp, - lineHeight = 24.sp, - letterSpacing = 0.5.sp +private val RalewayFontFamily = FontFamily( + Font(R.font.raleway) +) + +private val PlayfairFontFamily = FontFamily( + Font(R.font.playfair) +) + +@Immutable +data class AppTypography( + val titleLarge: TextStyle, + val displaySmall: TextStyle, + val placeholder: TextStyle +) + +@SuppressLint("ComposeCompositionLocalUsage") +val LocalAppTypography = staticCompositionLocalOf { + AppTypography( + titleLarge = TextStyle.Default, + displaySmall = TextStyle.Default, + placeholder = TextStyle.Default ) - /* Other default text styles to override +} + +val extendedTypography = AppTypography( titleLarge = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Normal, - fontSize = 22.sp, - lineHeight = 28.sp, - letterSpacing = 0.sp + fontFamily = PlayfairFontFamily, + fontSize = 48.sp, ), - labelSmall = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Medium, - fontSize = 11.sp, - lineHeight = 16.sp, - letterSpacing = 0.5.sp + displaySmall = TextStyle( + fontFamily = RalewayFontFamily, + fontSize = 16.sp, + ), + placeholder = TextStyle( + fontFamily = RalewayFontFamily, + fontSize = 14.sp, + fontWeight = FontWeight.Bold, ) - */ ) \ No newline at end of file diff --git a/presentation/src/main/res/font/playfair.ttf b/presentation/src/main/res/font/playfair.ttf new file mode 100644 index 0000000..503b7c4 Binary files /dev/null and b/presentation/src/main/res/font/playfair.ttf differ diff --git a/presentation/src/main/res/font/raleway.ttf b/presentation/src/main/res/font/raleway.ttf new file mode 100644 index 0000000..774b382 Binary files /dev/null and b/presentation/src/main/res/font/raleway.ttf differ