Skip to content
Open
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
12 changes: 9 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ indent_size = 4
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
tab_width = 4
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
ktlint_function_naming_ignore_when_annotated_with=Composable
ktlint_standard_annotation = disabled
ktlint_code_style = intellij_idea
ktlint_function_naming_ignore_when_annotated_with = Composable
ktlint_enum_entry_name_casing = upper_cases
ktlint_standard_class-signature = disabled
ktlint_standard_statement-wrapping = disabled
ktlint_standard_annotation = disabled
ktlint_standard_function-expression-body = disabled
ktlint_standard_function-signature = disabled
ktlint_standard_multiline-if-else = disabled
2 changes: 1 addition & 1 deletion .github/workflows/develop_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ jobs:
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}

- name: Build and Verify
run: ./gradlew ktlintCheck testDebugUnitTest assembleDebug
run: ./gradlew ktlintCheck :build-logic:convention:ktlintCheck testDebugUnitTest assembleDebug --continue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fun HomeNavHost(

composable<HomeRoute.Summary> {
SummaryScreenContainer(
navigateToYouthPolicies = {} // todo - 청년공고 화면 구현 후 연결 필요
navigateToYouthPolicies = {}, // todo - 청년공고 화면 구현 후 연결 필요
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ class PackageManagerVersionNameProvider @Inject constructor(
) : VersionNameProvider {
override fun getVersionName(): String =
context.packageManager.getPackageInfo(context.packageName, 0).versionName.orEmpty()
}
}
13 changes: 13 additions & 0 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
`kotlin-dsl`
alias(libs.plugins.ktlint)
}

group = "com.threegap.bitnagil.convention"
Expand All @@ -14,10 +15,17 @@ kotlin {
jvmToolchain(17)
}

ktlint {
version.set(libs.versions.ktlintEngine.get())
verbose.set(true)
filter { exclude { element -> element.file.path.contains("generated/") } }
}

dependencies {
compileOnly(libs.android.gradle.plugin)
compileOnly(libs.kotlin.gradle.plugin)
compileOnly(libs.compose.compiler.gradle.plugin)
compileOnly(libs.ktlint.gradle.plugin)
}

gradlePlugin {
Expand Down Expand Up @@ -56,5 +64,10 @@ gradlePlugin {
id = "bitnagil.kotlin.parcelize"
implementationClass = "com.threegap.bitnagil.convention.KotlinParcelizePlugin"
}

register("ktlint") {
id = "bitnagil.ktlint"
implementationClass = "com.threegap.bitnagil.convention.KtlintConventionPlugin"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AndroidApplicationPlugin : Plugin<Project> {
pluginManager.apply {
apply("com.android.application")
apply("org.jetbrains.kotlin.plugin.compose")
apply("org.jlleitschuh.gradle.ktlint")
apply("bitnagil.ktlint")
Comment thread
wjdrjs00 marked this conversation as resolved.
}

extensions.configure<ApplicationExtension> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AndroidLibraryPlugin : Plugin<Project> {
override fun apply(target: Project): Unit = with(target) {
pluginManager.apply {
apply("com.android.library")
apply("org.jlleitschuh.gradle.ktlint")
apply("bitnagil.ktlint")
}

extensions.configure<LibraryExtension> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class KotlinJvmPlugin : Plugin<Project> {
pluginManager.apply {
apply("java-library")
apply("org.jetbrains.kotlin.jvm")
apply("org.jlleitschuh.gradle.ktlint")
apply("bitnagil.ktlint")
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.threegap.bitnagil.convention

import com.threegap.bitnagil.convention.extension.libs
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.jlleitschuh.gradle.ktlint.KtlintExtension

class KtlintConventionPlugin : Plugin<Project> {
override fun apply(target: Project): Unit = with(target) {
pluginManager.apply("org.jlleitschuh.gradle.ktlint")

extensions.configure<KtlintExtension> {
version.set(libs.findVersion("ktlintEngine").get().requiredVersion)
verbose.set(true)
filter { exclude { element -> element.file.path.contains("generated/") } }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ internal fun Project.configureComposeAndroid(commonExtension: CommonExtension) {
"implementation"(libs.findBundle("compose.lifecycle").get())
"debugImplementation"(libs.findBundle("compose.debug").get())
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ internal fun Project.configureKotlinAndroid(commonExtension: CommonExtension) {
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies

internal fun Project.configureKotlinCoroutine() {

dependencies {
"implementation"(libs.findBundle("coroutine").get())
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.threegap.bitnagil.convention.extension

import java.util.Properties
import org.gradle.api.GradleException
import org.gradle.api.Project
import java.util.Properties

private const val LOCAL_PROPERTIES_FILE_NAME = "local.properties"
private const val LOCAL_PROPERTIES_EXTRA_KEY = "bitnagilLocalProperties"
Expand Down
1 change: 1 addition & 0 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
versionCatalogs {
create("libs") {
Expand Down
8 changes: 7 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@ plugins {
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.ktlint) apply false
alias(libs.plugins.ktlint)
}

ktlint {
version.set(libs.versions.ktlintEngine.get())
verbose.set(true)
filter { exclude { element -> element.file.path.contains("generated/") } }
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class BitnagilToastState {
private var _icon by mutableIntStateOf(0)
private var _isVisible by mutableStateOf(false)
private var _toastId by mutableIntStateOf(0)
private var _lastShowTime = 0L
private var lastShowTime = 0L

val text: String get() = _text
val icon: Int get() = _icon
Expand All @@ -116,14 +116,14 @@ class BitnagilToastState {

private fun shouldPreventDuplicateShow(text: String, icon: Int?): Boolean {
val currentTime = System.currentTimeMillis()
return _text == text && _icon == icon && currentTime - _lastShowTime < 500L
return _text == text && _icon == icon && currentTime - lastShowTime < 500L
}

private fun showToast(text: String, icon: Int) {
_text = text
_icon = icon
_isVisible = true
_lastShowTime = System.currentTimeMillis()
lastShowTime = System.currentTimeMillis()
_toastId += 1
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.dp
import com.threegap.bitnagil.designsystem.font.cafe24SsurroundAir as cafe24SsurroundAirFamily
import com.threegap.bitnagil.designsystem.font.pretendard
import com.threegap.bitnagil.designsystem.font.cafe24SsurroundAir as cafe24SsurroundAirFamily

@Immutable
class BitnagilTypography internal constructor(private val density: Density) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ enum class UserRole {
ONBOARDING,
WITHDRAWN,
UNKNOWN,
;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ enum class RecommendCategory {
GROW,
OUTING_REPORT,
UNKNOWN,
;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ enum class RecommendLevel {
LEVEL1,
LEVEL2,
LEVEL3,
;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ enum class ReportCategory {
LIGHTING,
WATERFACILITY,
AMENITY,
;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ enum class ReportStatus {
PENDING,
IN_PROGRESS,
COMPLETED,
;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ enum class DayOfWeek {
FRIDAY,
SATURDAY,
SUNDAY,
;
}
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ versionPatch = "0"
androidGradlePlugin = "9.1.0"

# Formatting Plugin
ktlint = "11.3.2"
ktlint = "14.2.0"
ktlintEngine = "1.5.0"

# AndroidX
androidxCore = "1.18.0"
Expand Down Expand Up @@ -142,6 +143,7 @@ lottie-compose = { group = "com.airbnb.android", name = "lottie-compose", versio
accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist" }
play-services-location = { group = "com.google.android.gms", name = "play-services-location", version.ref = "playServicesLocation" }
facebook-core = { group = "com.facebook.android", name = "facebook-core", version.ref = "facebookSdk" }
ktlint-gradle-plugin = { group = "org.jlleitschuh.gradle", name = "ktlint-gradle", version.ref = "ktlint" }


[bundles]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fun EmotionScreenContainer(
}

when (state.step) {
EmotionScreenStep.Emotion -> BoxWithConstraints(modifier = Modifier.fillMaxWidth()) {
EmotionScreenStep.EMOTION -> BoxWithConstraints(modifier = Modifier.fillMaxWidth()) {
val height = constraints.maxHeight.pxToDp()

if (height >= 700.dp) {
Expand All @@ -59,7 +59,7 @@ fun EmotionScreenContainer(
)
}
}
EmotionScreenStep.RecommendRoutines -> EmotionRecommendRoutineScreen(
EmotionScreenStep.RECOMMEND_ROUTINES -> EmotionRecommendRoutineScreen(
state = state,
onClickRoutine = viewModel::selectRecommendRoutine,
onClickRegisterRecommendRoutines = viewModel::registerRecommendRoutines,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class EmotionViewModel @Inject constructor(
reduce {
state.copy(
recommendRoutines = recommendRoutines,
step = EmotionScreenStep.RecommendRoutines,
step = EmotionScreenStep.RECOMMEND_ROUTINES,
isLoading = false,
showLoadingView = false,
)
Expand Down Expand Up @@ -101,11 +101,11 @@ class EmotionViewModel @Inject constructor(
fun moveToPrev() =
intent {
when (state.step) {
EmotionScreenStep.Emotion -> postSideEffect(EmotionSideEffect.NavigateToBack)
EmotionScreenStep.RecommendRoutines -> reduce {
EmotionScreenStep.EMOTION -> postSideEffect(EmotionSideEffect.NavigateToBack)
EmotionScreenStep.RECOMMEND_ROUTINES -> reduce {
state.copy(
recommendRoutines = listOf(),
step = EmotionScreenStep.Emotion,
step = EmotionScreenStep.EMOTION,
isLoading = false,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private fun Preview() {
),
),
isLoading = false,
step = EmotionScreenStep.RecommendRoutines,
step = EmotionScreenStep.RECOMMEND_ROUTINES,
recommendRoutines = listOf(
EmotionRecommendRoutineUiModel(
id = "1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private fun Preview() {
),
),
isLoading = false,
step = EmotionScreenStep.Emotion,
step = EmotionScreenStep.EMOTION,
recommendRoutines = listOf(),
showLoadingView = false,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ private fun Preview() {
),
),
isLoading = false,
step = EmotionScreenStep.Emotion,
step = EmotionScreenStep.EMOTION,
recommendRoutines = listOf(),
showLoadingView = false,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ data class EmotionState(
emotionTypeUiModels = emptyList(),
isLoading = true,
recommendRoutines = emptyList(),
step = EmotionScreenStep.Emotion,
step = EmotionScreenStep.EMOTION,
showLoadingView = false,
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.threegap.bitnagil.presentation.screen.emotion.model

enum class EmotionScreenStep {
Emotion, RecommendRoutines,
;
EMOTION,
RECOMMEND_ROUTINES,
Comment thread
wjdrjs00 marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.threegap.bitnagil.presentation.screen.home.component.template

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand All @@ -14,7 +15,6 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.LineHeightStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.foundation.Image
import coil3.compose.AsyncImage
import com.threegap.bitnagil.designsystem.BitnagilTheme
import com.threegap.bitnagil.designsystem.R
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.threegap.bitnagil.presentation.screen.onboarding.model.navarg

enum class OnBoardingScreenArg {
NEW, RESET,
;
NEW,
RESET,
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ import kotlinx.parcelize.Parcelize

@Parcelize
enum class RepeatType : Parcelable {
DAILY, DAY
DAILY,
DAY,
}
Loading
Loading