Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3: Theme추가및 추가 세팅 #8

Merged
merged 8 commits into from
Jun 27, 2024
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,5 @@ fabric.properties
.DS_Store
/build
/captures
.cxx
.cxx
.kotlin
16 changes: 16 additions & 0 deletions app/src/main/kotlin/com/bff/wespot/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,25 @@ package com.bff.wespot

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.ui.Modifier
import com.bff.wespot.designsystem.theme.WeSpotTheme

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

setContent {
WeSpotTheme {
Surface(
modifier = Modifier.fillMaxSize(),
) {
Text(text = "Hello, World!")
}
}
}
}
}
8 changes: 7 additions & 1 deletion build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
plugins{
plugins {
`kotlin-dsl`
}

Expand All @@ -7,6 +7,12 @@ java {
targetCompatibility = JavaVersion.VERSION_17
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of("17"))
}
}

dependencies {
compileOnly(libs.android.build)
compileOnly(libs.kotlin.gradle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension

class AndroidComposePlugin: Plugin<Project> {
class AndroidComposePlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target){
with(target) {
with(pluginManager) {
apply("org.jetbrains.kotlin.plugin.compose")
apply("com.google.devtools.ksp")
}

dependencies {
"implementation"(platform(libs.findLibrary("androidx-compose-bom").get()))
"implementation"(libs.findBundle("androidx-compose").get())
"ksp"(libs.findLibrary("androidx-compose-destination-compiler").get())
}

extensions.configure<BaseExtension> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import com.bff.wespot.plugin.configure.configureKotlinAndroid
import com.bff.wespot.plugin.configure.configureKtLint
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
import org.gradle.kotlin.dsl.project

class AndroidFeaturePlugin: Plugin<Project>{
override fun apply(target: Project) {
Expand All @@ -19,6 +21,14 @@ class AndroidFeaturePlugin: Plugin<Project>{
val extension = extensions.getByType<LibraryExtension>()
configureKotlinAndroid(extension)
configureKtLint()

dependencies {
"implementation"(project(":domain"))
"implementation"(project(":core:model"))
"implementation"(project(":core:ui"))
"implementation"(project(":designsystem"))
"implementation"(project(":core:common"))
}
}
}
}
7 changes: 7 additions & 0 deletions config/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ comments:
complexity:
active: true

ComplexCondition:
active: true
threshold: 30

LongParameterList:
active: false

coroutines:
active: true

Expand Down
1 change: 0 additions & 1 deletion core/common/src/main/kotlin/com/bff/wespot/common/empty

This file was deleted.

3 changes: 2 additions & 1 deletion core/ui/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
alias(libs.plugins.wespot.android.feature)
alias(libs.plugins.wespot.android.library)
alias(libs.plugins.wespot.android.compose)
}

Expand All @@ -11,4 +11,5 @@ dependencies {
implementation(libs.material)
implementation(project(":designsystem"))
implementation(project(":core:model"))
implementation(project(":core:common"))
}
1 change: 0 additions & 1 deletion core/ui/src/main/kotlin/com/bff/wespot/ui/empty

This file was deleted.

3 changes: 2 additions & 1 deletion designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
alias(libs.plugins.wespot.android.feature)
alias(libs.plugins.wespot.android.library)
alias(libs.plugins.wespot.android.compose)
}

Expand All @@ -8,5 +8,6 @@ android {
}

dependencies {
implementation(project(":core:common"))
implementation(libs.material)
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
package com.bff.wespot.designsystem.theme

import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.graphics.Color

enum class CustomTheme {
LIGHT,
DARK,
}

val Primary100 = Color(0xFFFDFFDC)
val Primary200 = Color(0xFFFBFFB7)
val Primary300 = Color(0xFFF6FE8B)
val Primary400 = Color(0xFFE4E7C1)
val Primary500 = Color(0xFF313229)

val White = Color(0xFFFFFFFF)
val Gray100 = Color(0xFFEAEBEC)
val Gray200 = Color(0xFFEAEBEC)
val Gray300 = Color(0xFFC8C8C8)
val Gray400 = Color(0xFF76777D)
val Gray500 = Color(0xFF5A5C63)
val Gray600 = Color(0xFF323439)
val Gray700 = Color(0xFF2E2F33)
val Gray800 = Color(0xFF212225)
val Gray900 = Color(0xFF1B1C1E)

val Destructive = Color(0xFFFF4D4D)
val Positive = Color(0xFF1ED45A)

@Stable
class CustomColors(
primaryColor: Color,
toastColor: Color,
txtTitleColor: Color,
abledTxtColor: Color,
abledIconColor: Color,
txtSubColor: Color,
disableIcnColor: Color,
disableBtnTxtColor: Color,
secondaryBtnColor: Color,
primaryBtnColor: Color,
disableBtnColor: Color,
badgeColor: Color,
modalColor: Color,
cardBackgroundColor: Color,
tertiaryBtnColor: Color,
naviColor: Color,
backgroundColor: Color,
dangerColor: Color,
alertBadgeColor: Color,
toggleColor: Color,
) {
var primaryColor by mutableStateOf(primaryColor)
private set

var toastColor by mutableStateOf(toastColor)
private set

var txtTitleColor by mutableStateOf(txtTitleColor)
private set

var abledIconColor by mutableStateOf(abledIconColor)
private set

var abledTxtColor by mutableStateOf(abledTxtColor)
private set

var txtSubColor by mutableStateOf(txtSubColor)
private set

var disableIcnColor by mutableStateOf(disableIcnColor)
private set

var disableBtnTxtColor by mutableStateOf(disableBtnTxtColor)
private set

var secondaryBtnColor by mutableStateOf(secondaryBtnColor)
private set

var primaryBtnColor by mutableStateOf(primaryBtnColor)
private set

var disableBtnColor by mutableStateOf(disableBtnColor)
private set

var badgeColor by mutableStateOf(badgeColor)
private set

var modalColor by mutableStateOf(modalColor)
private set

var cardBackgroundColor by mutableStateOf(cardBackgroundColor)
private set

var tertiaryBtnColor by mutableStateOf(tertiaryBtnColor)
private set

var naviColor by mutableStateOf(naviColor)
private set

var backgroundColor by mutableStateOf(backgroundColor)
private set

var dangerColor by mutableStateOf(dangerColor)
private set

var alertBadgeColor by mutableStateOf(alertBadgeColor)
private set

var toggleColor by mutableStateOf(toggleColor)
private set

fun update(colors: CustomColors) {
this.primaryColor = colors.primaryColor
this.toastColor = colors.toastColor
this.txtTitleColor = colors.txtTitleColor
this.abledTxtColor = colors.abledTxtColor
this.abledIconColor = colors.abledIconColor
this.txtSubColor = colors.txtSubColor
this.disableIcnColor = colors.disableIcnColor
this.disableBtnTxtColor = colors.disableBtnTxtColor
this.secondaryBtnColor = colors.secondaryBtnColor
this.primaryBtnColor = colors.primaryBtnColor
this.disableBtnColor = colors.disableBtnColor
this.badgeColor = colors.badgeColor
this.modalColor = colors.modalColor
this.cardBackgroundColor = colors.cardBackgroundColor
this.tertiaryBtnColor = colors.tertiaryBtnColor
this.naviColor = colors.naviColor
this.backgroundColor = colors.backgroundColor
this.dangerColor = colors.dangerColor
this.alertBadgeColor = colors.alertBadgeColor
this.toggleColor = colors.toggleColor
}

fun copy() =
CustomColors(
primaryColor = primaryColor,
toastColor = toastColor,
txtTitleColor = txtTitleColor,
abledTxtColor = abledTxtColor,
abledIconColor = abledIconColor,
txtSubColor = txtSubColor,
disableIcnColor = disableIcnColor,
disableBtnTxtColor = disableBtnTxtColor,
secondaryBtnColor = secondaryBtnColor,
primaryBtnColor = primaryBtnColor,
disableBtnColor = disableBtnColor,
badgeColor = badgeColor,
modalColor = modalColor,
cardBackgroundColor = cardBackgroundColor,
tertiaryBtnColor = tertiaryBtnColor,
naviColor = naviColor,
backgroundColor = backgroundColor,
dangerColor = dangerColor,
alertBadgeColor = alertBadgeColor,
toggleColor = toggleColor,
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.bff.wespot.designsystem.theme

import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Shapes
import androidx.compose.ui.unit.dp

val Shapes =
Shapes(
small = RoundedCornerShape(12.dp),
medium = RoundedCornerShape(16.dp),
large = RoundedCornerShape(4.dp),
)
Loading
Loading