-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from SOPT-all/init/theme-res
[init] Theme 기초 세팅
- Loading branch information
Showing
10 changed files
with
583 additions
and
79 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
app/src/main/java/org/android/bbangzip/ui/theme/BbangZipTheme.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.android.bbangzip.ui.theme | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.ReadOnlyComposable | ||
|
||
object BbangZipTheme { | ||
val colors: BbangZipColors | ||
@Composable | ||
@ReadOnlyComposable | ||
get() = LocalBbangZipColors.current | ||
|
||
val typography: BbangZipTypography | ||
@Composable | ||
@ReadOnlyComposable | ||
get() = LocalBbangZipTypography.current | ||
|
||
val opacity: BbangZipOpacity | ||
@Composable | ||
@ReadOnlyComposable | ||
get() = LocalBbangZipOpacity.current | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
app/src/main/java/org/android/bbangzip/ui/theme/ColorScheme.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
package org.android.bbangzip.ui.theme | ||
|
||
import androidx.compose.runtime.Immutable | ||
import androidx.compose.runtime.staticCompositionLocalOf | ||
import androidx.compose.ui.graphics.Color | ||
|
||
@Immutable | ||
data class BbangZipColors( | ||
// Primary | ||
val primaryLight_3D3730: Color, | ||
val primaryNormal_282119: Color, | ||
val primaryStrong_1B1611: Color, | ||
// Secondary | ||
val secondaryNormal_FFCD80: Color, | ||
val secondaryStrong_FFC161: Color, | ||
val secondaryHeavy_FFB84A: Color, | ||
// Label | ||
val labelStrong_000000: Color, | ||
val labelNormal_282119: Color, | ||
val labelNeutral_282119_88: Color, | ||
val labelAlternative_282119_61: Color, | ||
val labelAssistive_282119_28: Color, | ||
val labelDisable_282119_12: Color, | ||
// Background | ||
val backgroundNormal_FFFFFF: Color, | ||
val backgroundAlternative_F5F5F5: Color, | ||
val backgroundAccent_FFDAA0: Color, | ||
// Interaction | ||
val interactionInactive_D4D3D1: Color, | ||
val interactionDisable_F5F5F5: Color, | ||
// Line | ||
val lineNormal_68645E_22: Color, | ||
val lineNeutral_68645E_16: Color, | ||
val lineAlternative_68645E_08: Color, | ||
val lineStrong_68645E_52: Color, | ||
// Status | ||
val statusPositive_3D3730: Color, | ||
val statusCautionary_FFB84A: Color, | ||
val statusDestructive_FF8345: Color, | ||
// Static | ||
val staticWhite_FFFFFF: Color, | ||
val staticBlack_000000: Color, | ||
// Component Fill | ||
val fillNormal_68645E_08: Color, | ||
val fillStrong_68645E_16: Color, | ||
val fillAlternative_68645E_05: Color, | ||
// Material | ||
val materialDimmer_282119_52: Color, | ||
// Social Kakao | ||
val kakaoContainer_FEE500: Color, | ||
val kakaoSymbol_000000: Color, | ||
val kakaoLabel_000000_85: Color, | ||
) | ||
|
||
val defaultBbangZipColors = | ||
BbangZipColors( | ||
// Primary | ||
primaryLight_3D3730 = Neutral40, | ||
primaryNormal_282119 = Neutral30, | ||
primaryStrong_1B1611 = Neutral15, | ||
// Secondary | ||
secondaryNormal_FFCD80 = Yellow70, | ||
secondaryStrong_FFC161 = Yellow60, | ||
secondaryHeavy_FFB84A = Yellow50, | ||
// Label | ||
labelStrong_000000 = Common0, | ||
labelNormal_282119 = Neutral30, | ||
labelNeutral_282119_88 = Neutral30.copy(alpha = 0.88f), | ||
labelAlternative_282119_61 = Neutral30.copy(alpha = 0.61f), | ||
labelAssistive_282119_28 = Neutral30.copy(alpha = 0.28f), | ||
labelDisable_282119_12 = Neutral30.copy(alpha = 0.12f), | ||
// Background | ||
backgroundNormal_FFFFFF = Common100, | ||
backgroundAlternative_F5F5F5 = Neutral99, | ||
backgroundAccent_FFDAA0 = Yellow80, | ||
// Interaction | ||
interactionInactive_D4D3D1 = Neutral90, | ||
interactionDisable_F5F5F5 = Neutral99, | ||
// Line | ||
lineNormal_68645E_22 = Neutral60.copy(alpha = 0.22f), | ||
lineNeutral_68645E_16 = Neutral60.copy(alpha = 0.16f), | ||
lineAlternative_68645E_08 = Neutral60.copy(alpha = 0.08f), | ||
lineStrong_68645E_52 = Neutral60.copy(alpha = 0.52f), | ||
// Status | ||
statusPositive_3D3730 = Neutral40, | ||
statusCautionary_FFB84A = Yellow50, | ||
statusDestructive_FF8345 = Orange60, | ||
// Static | ||
staticWhite_FFFFFF = Common100, | ||
staticBlack_000000 = Common0, | ||
// Component Fill | ||
fillNormal_68645E_08 = Neutral60.copy(alpha = 0.08f), | ||
fillStrong_68645E_16 = Neutral60.copy(alpha = 0.16f), | ||
fillAlternative_68645E_05 = Neutral60.copy(alpha = 0.05f), | ||
// Material | ||
materialDimmer_282119_52 = Neutral30.copy(alpha = 0.52f), | ||
// Social Kakao | ||
kakaoContainer_FEE500 = Yellow55, | ||
kakaoSymbol_000000 = Common0, | ||
kakaoLabel_000000_85 = Common0.copy(alpha = 0.85f), | ||
) | ||
|
||
val LocalBbangZipColors = staticCompositionLocalOf { defaultBbangZipColors } |
44 changes: 44 additions & 0 deletions
44
app/src/main/java/org/android/bbangzip/ui/theme/Opacity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.android.bbangzip.ui.theme | ||
|
||
import androidx.compose.runtime.Immutable | ||
import androidx.compose.runtime.staticCompositionLocalOf | ||
|
||
@Immutable | ||
data class BbangZipOpacity( | ||
val opacity0: Float, | ||
val opacity5: Float, | ||
val opacity8: Float, | ||
val opacity12: Float, | ||
val opacity16: Float, | ||
val opacity22: Float, | ||
val opacity28: Float, | ||
val opacity35: Float, | ||
val opacity43: Float, | ||
val opacity52: Float, | ||
val opacity61: Float, | ||
val opacity74: Float, | ||
val opacity88: Float, | ||
val opacity97: Float, | ||
val opacity100: Float, | ||
) | ||
|
||
val defaultBbangZipOpacity = | ||
BbangZipOpacity( | ||
opacity0 = 0f, | ||
opacity5 = 0.05f, | ||
opacity8 = 0.08f, | ||
opacity12 = 0.12f, | ||
opacity16 = 0.16f, | ||
opacity22 = 0.22f, | ||
opacity28 = 0.28f, | ||
opacity35 = 0.35f, | ||
opacity43 = 0.43f, | ||
opacity52 = 0.52f, | ||
opacity61 = 0.61f, | ||
opacity74 = 0.74f, | ||
opacity88 = 0.88f, | ||
opacity97 = 0.97f, | ||
opacity100 = 1f, | ||
) | ||
|
||
val LocalBbangZipOpacity = staticCompositionLocalOf { defaultBbangZipOpacity } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,25 @@ | ||
package org.android.bbangzip.ui.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 BBANGZIPTheme( | ||
darkTheme: Boolean = isSystemInDarkTheme(), | ||
// Dynamic color is available on Android 12+ | ||
dynamicColor: Boolean = true, | ||
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 | ||
} | ||
|
||
val bbangZipColors = defaultBbangZipColors | ||
val bbangZipTypography = defaultBbangZipTypography | ||
val bbangZipOpacity = defaultBbangZipOpacity | ||
MaterialTheme( | ||
colorScheme = colorScheme, | ||
typography = Typography, | ||
content = content, | ||
content = { | ||
CompositionLocalProvider( | ||
LocalBbangZipColors provides bbangZipColors, | ||
LocalBbangZipTypography provides bbangZipTypography, | ||
LocalBbangZipOpacity provides bbangZipOpacity, | ||
) { | ||
content() | ||
} | ||
}, | ||
) | ||
} |
Oops, something went wrong.