Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 106 additions & 6 deletions app/src/main/java/com/hsLink/hslink/core/designsystem/theme/Color.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,111 @@
package com.hsLink.hslink.core.designsystem.theme

import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.graphics.Color

val Purple80 = Color(0xFFD0BCFF)
val PurpleGrey80 = Color(0xFFCCC2DC)
val Pink80 = Color(0xFFEFB8C8)

val Purple40 = Color(0xFF6650a4)
val PurpleGrey40 = Color(0xFF625b71)
val Pink40 = Color(0xFF7D5260)
val Common = Color(0xFFFFFFFF)

val Transparent = Color(0xFF2D2D2D)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

"Transparent" is opaque (#2D2D2D); make it truly transparent.

Use 0x00000000 (or Color.Transparent) to avoid unexpected opaque backgrounds.

-val Transparent = Color(0xFF2D2D2D)
+val Transparent = Color(0x00000000) // or: Color.Transparent
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
val Transparent = Color(0xFF2D2D2D)
val Transparent = Color(0x00000000) // or: Color.Transparent
🤖 Prompt for AI Agents
In app/src/main/java/com/hsLink/hslink/core/designsystem/theme/Color.kt around
line 10, the val Transparent is defined as an opaque color (0xFF2D2D2D) instead
of being transparent; replace that value with a true transparent color (e.g.,
0x00000000) or use Color.Transparent so the variable name matches its behavior
and avoids unexpected opaque backgrounds.


val SkyBlue100 = Color(0xFFEFF8FC)
val SkyBlue200 = Color(0xFFD7EEFB)
val SkyBlue300 = Color(0xFFA4D4F0)
val SkyBlue400 = Color(0xFF7DC2E9)
val SkyBlue500 = Color(0xFF62B5E5)
val SkyBlue600 = Color(0xFF457FA0)
val SkyBlue700 = Color(0xFF225370)

val DeepBlue100 = Color(0xFFE6EDF8)
val DeepBlue200 = Color(0xFFB2CEFA)
val DeepBlue300 = Color(0xFF6B94D8)
val DeepBlue400 = Color(0xFF2B66C7)
val DeepBlue500 = Color(0xFF0047BB)
val DeepBlue600 = Color(0xFF003283)
val DeepBlue700 = Color(0xFF071F46)

val Grey100 = Color(0xFFEEEEEF)
val Grey200 = Color(0xFFD1D2D4)
val Grey300 = Color(0xFF9C9D9F)
val Grey400 = Color(0xFF717376)
val Grey500 = Color(0xFF54565A)
val Grey600 = Color(0xFF3B3C3F)
val Grey700 = Color(0xFF2D2D30)

val Red100 = Color(0xFFFCEBEB)
val Red200 = Color(0xFFFFC9C8)
val Red300 = Color(0xFFF08C8A)
val Red400 = Color(0xFFE95B57)
val Red500 = Color(0xFFE53935)
val Red600 = Color(0xFFA02825)
val Red700 = Color(0xFF651513)

@Immutable
data class HsLinkColor(
val Common: Color,
val Transparent: Color,
val SkyBlue100: Color,
val SkyBlue200: Color,
val SkyBlue300: Color,
val SkyBlue400: Color,
val SkyBlue500: Color,
val SkyBlue600: Color,
val SkyBlue700: Color,
val DeepBlue100: Color,
val DeepBlue200: Color,
val DeepBlue300: Color,
val DeepBlue400: Color,
val DeepBlue500: Color,
val DeepBlue600: Color,
val DeepBlue700: Color,
val Grey100: Color,
val Grey200: Color,
val Grey300: Color,
val Grey400: Color,
val Grey500: Color,
val Grey600: Color,
val Grey700: Color,
val Red100: Color,
val Red200: Color,
val Red300: Color,
val Red400: Color,
val Red500: Color,
val Red600: Color,
val Red700: Color,
)

val defaultHsLinkColor = HsLinkColor(
Common = Common,
Transparent = Transparent,
SkyBlue100 = SkyBlue100,
SkyBlue200 = SkyBlue200,
SkyBlue300 = SkyBlue300,
SkyBlue400 = SkyBlue400,
SkyBlue500 = SkyBlue500,
SkyBlue600 = SkyBlue600,
SkyBlue700 = SkyBlue700,
DeepBlue100 = DeepBlue100,
DeepBlue200 = DeepBlue200,
DeepBlue300 = DeepBlue300,
DeepBlue400 = DeepBlue400,
DeepBlue500 = DeepBlue500,
DeepBlue600 = DeepBlue600,
DeepBlue700 = DeepBlue700,
Grey100 = Grey100,
Grey200 = Grey200,
Grey300 = Grey300,
Grey400 = Grey400,
Grey500 = Grey500,
Grey600 = Grey600,
Grey700 = Grey700,
Red100 = Red100,
Red200 = Red200,
Red300 = Red300,
Red400 = Red400,
Red500 = Red500,
Red600 = Red600,
Red700 = Red700
)

val LocalHsLinkColors = staticCompositionLocalOf { defaultHsLinkColor }
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
package com.hsLink.hslink.core.designsystem.theme

import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import android.app.Activity
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
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.runtime.SideEffect
import androidx.compose.ui.platform.LocalView
import androidx.core.view.WindowCompat

private val DarkColorScheme = darkColorScheme(
primary = Purple80,
secondary = PurpleGrey80,
tertiary = Pink80
)
object HsLinkTheme {
val colors: HsLinkColor
@Composable
@ReadOnlyComposable
get() = LocalHsLinkColors.current

private val LightColorScheme = lightColorScheme(
primary = Purple40,
secondary = PurpleGrey40,
tertiary = Pink40
val typography: HsLinkTypography
@Composable
@ReadOnlyComposable
get() = LocalHsLinkTypography.current
}

/* 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),
*/
)
@Composable
fun ProvideHsLinkColorsAndTypography(
colors: HsLinkColor,
typography: HsLinkTypography,
content: @Composable () -> Unit,
) {
CompositionLocalProvider(
LocalHsLinkColors provides colors,
LocalHsLinkTypography provides typography,
content = content
)
}

@Composable
fun HsLinkTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
// Dynamic color is available on Android 12+
dynamicColor: Boolean = true,
content: @Composable () -> Unit
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)
ProvideHsLinkColorsAndTypography(
colors = defaultHsLinkColor,
typography = defaultHsLinkTypography
) {
val view = LocalView.current
if (!view.isInEditMode) {
SideEffect {
(view.context as Activity).window.run {
WindowCompat.getInsetsController(this, view).isAppearanceLightStatusBars = false
}
}
Comment on lines +45 to +51
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Status bar icon contrast is inverted for a light UI.

Setting isAppearanceLightStatusBars = false forces light icons; on a light background they become unreadable. Default to dark icons on light backgrounds, or compute dynamically.

-                    WindowCompat.getInsetsController(this, view).isAppearanceLightStatusBars = false
+                    // For light background (e.g., white), use dark icons:
+                    WindowCompat.getInsetsController(this, view).isAppearanceLightStatusBars = true
🤖 Prompt for AI Agents
In app/src/main/java/com/hsLink/hslink/core/designsystem/theme/Theme.kt around
lines 45–51, the code unconditionally sets isAppearanceLightStatusBars = false
which forces light status bar icons (poor contrast on light backgrounds); change
it to compute the correct value from the current theme (e.g., use
isSystemInDarkTheme() or MaterialTheme.colors.isLight) and set
isAppearanceLightStatusBars to true when the UI is light (so dark icons are
used), otherwise set it to false; implement this conditional assignment inside
the existing SideEffect block and keep casting/view access unchanged.

}

darkTheme -> DarkColorScheme
else -> LightColorScheme
MaterialTheme(
content = content
)
}

MaterialTheme(
colorScheme = colorScheme,
typography = Typography,
content = content
)
}
136 changes: 115 additions & 21 deletions app/src/main/java/com/hsLink/hslink/core/designsystem/theme/Type.kt
Original file line number Diff line number Diff line change
@@ -1,34 +1,128 @@
package com.hsLink.hslink.core.designsystem.theme

import androidx.compose.material3.Typography
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.em
import androidx.compose.ui.unit.sp
import com.hsLink.hslink.R

// Set of Material typography styles to start with
val Typography = Typography(
bodyLarge = TextStyle(
fontFamily = FontFamily.Default,
val HsLinkSemiBoldFont = FontFamily(Font(R.font.pretendard_semibold))
val HsLinkRegularFont = FontFamily(Font(R.font.pretendard_regular))
val HsLinkMediumFont = FontFamily(Font(R.font.pretendard_medium))
Comment on lines +13 to +15
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify font resources exist (pretendard_*).

Ensure res/font/pretendard_{semibold,regular,medium}.* are present to avoid build errors.


🏁 Script executed:

#!/bin/bash
# List expected font files and confirm references.
fd -a -t f 'res/font/pretendard_*' || true
rg -nP 'R\.font\.pretendard_(semibold|regular|medium)' -g '!**/build/**' -S

Length of output: 416


Missing font resource files will cause build failures.

The code references R.font.pretendard_semibold, R.font.pretendard_regular, and R.font.pretendard_medium at lines 13-15, but these font resource files do not exist in res/font/. Add the three font files:

  • res/font/pretendard_semibold.ttf (or .otf)
  • res/font/pretendard_regular.ttf (or .otf)
  • res/font/pretendard_medium.ttf (or .otf)
🤖 Prompt for AI Agents
In app/src/main/java/com/hsLink/hslink/core/designsystem/theme/Type.kt around
lines 13 to 15 the code references R.font.pretendard_semibold,
R.font.pretendard_regular, and R.font.pretendard_medium which are missing and
will break the build; add the corresponding font resource files into res/font
(e.g., pretendard_semibold.ttf or .otf, pretendard_regular.ttf or .otf,
pretendard_medium.ttf or .otf), ensure their filenames match the R identifiers
(lowercase, underscores), and sync/clean the project so the resources are
recognized.


@Immutable
data class HsLinkTypography(
val title_24Strong: TextStyle,
val title_20Strong: TextStyle,
val title_16Strong: TextStyle,
val title_14Strong: TextStyle,

val body_16Strong: TextStyle,
val body_16Normal: TextStyle,
val body_14Normal: TextStyle,

val caption_14Normal: TextStyle,
val caption_12Normal: TextStyle,

val btm_L: TextStyle,
val btm_M: TextStyle,
val btm_S: TextStyle,
)

val defaultHsLinkTypography = HsLinkTypography(

title_24Strong = TextStyle(
fontFamily = HsLinkSemiBoldFont,
fontWeight = FontWeight.SemiBold,
fontSize = 24.sp,
lineHeight = 34.sp,
letterSpacing = (-0.03).em
),
title_20Strong = TextStyle(
fontFamily = HsLinkSemiBoldFont,
fontWeight = FontWeight.SemiBold,
fontSize = 20.sp,
lineHeight = 28.sp,
letterSpacing = (-0.03).em
),

title_16Strong = TextStyle(
fontFamily = HsLinkSemiBoldFont,
fontWeight = FontWeight.SemiBold,
fontSize = 16.sp,
lineHeight = 22.sp,
letterSpacing = (-0.02).em
),
title_14Strong = TextStyle(
fontFamily = HsLinkMediumFont,
fontWeight = FontWeight.Medium,
fontSize = 14.sp,
lineHeight = 20.sp,
letterSpacing = (-0.02).em
),

body_16Strong = TextStyle(
fontFamily = HsLinkMediumFont,
fontWeight = FontWeight.Medium,
fontSize = 16.sp,
lineHeight = 22.sp,
letterSpacing = (-0.02).em
),
body_16Normal = TextStyle(
fontFamily = HsLinkRegularFont,
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.5.sp
)
/* Other default text styles to override
titleLarge = TextStyle(
fontFamily = FontFamily.Default,
lineHeight = 22.sp,
letterSpacing = (-0.02).em
),
body_14Normal = TextStyle(
fontFamily = HsLinkRegularFont,
fontWeight = FontWeight.Normal,
fontSize = 22.sp,
lineHeight = 28.sp,
letterSpacing = 0.sp
fontSize = 14.sp,
lineHeight = 20.sp,
letterSpacing = (-0.02).em
),
labelSmall = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Medium,
fontSize = 11.sp,

caption_14Normal = TextStyle(
fontFamily = HsLinkRegularFont,
fontWeight = FontWeight.Normal,
fontSize = 14.sp,
lineHeight = 20.sp,
letterSpacing = (-0.02).em
),
caption_12Normal = TextStyle(
fontFamily = HsLinkRegularFont,
fontWeight = FontWeight.Normal,
fontSize = 12.sp,
lineHeight = 16.sp,
letterSpacing = 0.5.sp
letterSpacing = (-0.02).em
),

btm_L = TextStyle(
fontFamily = HsLinkSemiBoldFont,
fontWeight = FontWeight.SemiBold,
fontSize = 18.sp,
lineHeight = 24.sp,
letterSpacing = (-0.02).em
),
btm_M = TextStyle(
fontFamily = HsLinkSemiBoldFont,
fontWeight = FontWeight.SemiBold,
fontSize = 16.sp,
lineHeight = 22.sp,
letterSpacing = (-0.02).em
),
btm_S = TextStyle(
fontFamily = HsLinkSemiBoldFont,
fontWeight = FontWeight.SemiBold,
fontSize = 12.sp,
lineHeight = 16.sp,
letterSpacing = (-0.02).em
)
*/
)
)

val LocalHsLinkTypography = staticCompositionLocalOf { defaultHsLinkTypography }
Loading