Skip to content

Commit b12075a

Browse files
committed
CHOAR: ktlint 적용
1 parent 2aec2eb commit b12075a

10 files changed

Lines changed: 49 additions & 48 deletions

File tree

presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/MyPageScreen.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ private fun MyPageScreen(
5959
modifier = Modifier
6060
.fillMaxSize()
6161
.background(color = BitnagilTheme.colors.white),
62-
horizontalAlignment = Alignment.CenterHorizontally
62+
horizontalAlignment = Alignment.CenterHorizontally,
6363
) {
6464
Box(
6565
modifier = Modifier
6666
.height(54.dp)
67-
.fillMaxWidth()
67+
.fillMaxWidth(),
6868
) {
6969
Text(
7070
"마이페이지",
@@ -89,13 +89,13 @@ private fun MyPageScreen(
8989
contentDescription = null,
9090
modifier = Modifier
9191
.size(80.dp)
92-
.clip(shape = CircleShape)
92+
.clip(shape = CircleShape),
9393
)
9494

9595
Text(
9696
state.name,
9797
style = BitnagilTheme.typography.title3SemiBold,
98-
modifier = Modifier.padding(top = 12.dp)
98+
modifier = Modifier.padding(top = 12.dp),
9999
)
100100

101101
Spacer(modifier = Modifier.height(28.dp))
@@ -109,7 +109,7 @@ private fun MyPageScreen(
109109
.height(48.dp)
110110
.clickable(onClick = onClickResetOnBoarding)
111111
.padding(start = 16.dp, end = 4.dp),
112-
verticalAlignment = Alignment.CenterVertically
112+
verticalAlignment = Alignment.CenterVertically,
113113
) {
114114
Text(
115115
"내 목표 재설정",
@@ -121,7 +121,7 @@ private fun MyPageScreen(
121121
modifier = Modifier
122122
.padding(end = 10.dp)
123123
.size(36.dp)
124-
.background(BitnagilTheme.colors.black)
124+
.background(BitnagilTheme.colors.black),
125125
)
126126
}
127127

@@ -130,7 +130,7 @@ private fun MyPageScreen(
130130
.height(48.dp)
131131
.clickable(onClick = onClickNotice)
132132
.padding(start = 16.dp, end = 4.dp),
133-
verticalAlignment = Alignment.CenterVertically
133+
verticalAlignment = Alignment.CenterVertically,
134134
) {
135135
Text(
136136
"공지사항",
@@ -142,7 +142,7 @@ private fun MyPageScreen(
142142
modifier = Modifier
143143
.padding(end = 10.dp)
144144
.size(36.dp)
145-
.background(BitnagilTheme.colors.black)
145+
.background(BitnagilTheme.colors.black),
146146
)
147147
}
148148

@@ -151,7 +151,7 @@ private fun MyPageScreen(
151151
.height(48.dp)
152152
.clickable(onClick = onClickQnA)
153153
.padding(start = 16.dp, end = 4.dp),
154-
verticalAlignment = Alignment.CenterVertically
154+
verticalAlignment = Alignment.CenterVertically,
155155
) {
156156
Text(
157157
"자주 묻는 질문",
@@ -163,7 +163,7 @@ private fun MyPageScreen(
163163
modifier = Modifier
164164
.padding(end = 10.dp)
165165
.size(36.dp)
166-
.background(BitnagilTheme.colors.black)
166+
.background(BitnagilTheme.colors.black),
167167
)
168168
}
169169
}

presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/MyPageViewModel.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MyPageViewModel @Inject constructor(
1616
savedStateHandle: SavedStateHandle,
1717
) : MviViewModel<MyPageState, MyPageSideEffect, MyPageIntent>(
1818
MyPageState.Init,
19-
savedStateHandle
19+
savedStateHandle,
2020
) {
2121
init {
2222
loadMyPageInfo()
@@ -30,13 +30,13 @@ class MyPageViewModel @Inject constructor(
3030

3131
override suspend fun SimpleSyntax<MyPageState, MyPageSideEffect>.reduceState(
3232
intent: MyPageIntent,
33-
state: MyPageState
33+
state: MyPageState,
3434
): MyPageState {
35-
when(intent) {
35+
when (intent) {
3636
is MyPageIntent.LoadMyPageSuccess -> {
3737
return state.copy(
3838
name = intent.name,
39-
profileUrl = intent.profileUrl
39+
profileUrl = intent.profileUrl,
4040
)
4141
}
4242
}

presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/model/MyPageIntent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ package com.threegap.bitnagil.presentation.mypage.model
22

33
import com.threegap.bitnagil.presentation.common.mviviewmodel.MviIntent
44

5-
sealed class MyPageIntent: MviIntent {
5+
sealed class MyPageIntent : MviIntent {
66
data class LoadMyPageSuccess(val name: String, val profileUrl: String) : MyPageIntent()
77
}

presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/model/MyPageSideEffect.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ package com.threegap.bitnagil.presentation.mypage.model
22

33
import com.threegap.bitnagil.presentation.common.mviviewmodel.MviSideEffect
44

5-
sealed class MyPageSideEffect: MviSideEffect
5+
sealed class MyPageSideEffect : MviSideEffect

presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingScreen.kt

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ import com.threegap.bitnagil.presentation.setting.model.mvi.SettingState
3333

3434
@Composable
3535
fun SettingScreenContainer(
36-
viewModel: SettingViewModel = hiltViewModel()
36+
viewModel: SettingViewModel = hiltViewModel(),
3737
) {
3838
val state by viewModel.stateFlow.collectAsState()
3939

4040
SettingScreen(
4141
state = state,
4242
toggleServiceAlarm = viewModel::toggleServiceAlarm,
4343
togglePushAlarm = viewModel::togglePushAlarm,
44-
onClickUpdate = {}
44+
onClickUpdate = {},
4545
)
4646
}
4747

@@ -55,12 +55,12 @@ private fun SettingScreen(
5555
Column(
5656
modifier = Modifier
5757
.fillMaxSize()
58-
.background(color = BitnagilTheme.colors.white)
58+
.background(color = BitnagilTheme.colors.white),
5959
) {
6060
Box(
6161
modifier = Modifier
6262
.height(54.dp)
63-
.fillMaxWidth()
63+
.fillMaxWidth(),
6464
) {
6565
Box(
6666
modifier = Modifier
@@ -69,7 +69,6 @@ private fun SettingScreen(
6969
.background(BitnagilTheme.colors.black)
7070
.align(Alignment.CenterStart)
7171
.clickable {
72-
7372
},
7473
)
7574

@@ -78,14 +77,13 @@ private fun SettingScreen(
7877
modifier = Modifier.align(Alignment.Center),
7978
style = BitnagilTheme.typography.title3SemiBold,
8079
)
81-
8280
}
8381

8482
val scrollState = rememberScrollState()
8583
Column(
8684
modifier = Modifier
8785
.weight(1f)
88-
.verticalScroll(scrollState)
86+
.verticalScroll(scrollState),
8987
) {
9088
Spacer(modifier = Modifier.height(32.dp))
9189

@@ -97,7 +95,7 @@ private fun SettingScreen(
9795
.height(48.dp)
9896
.padding(horizontal = 16.dp),
9997
horizontalArrangement = Arrangement.SpaceBetween,
100-
verticalAlignment = Alignment.CenterVertically
98+
verticalAlignment = Alignment.CenterVertically,
10199
) {
102100
Text("서비스 이용 알림", style = BitnagilTheme.typography.body1Regular)
103101
ToggleSwitch(checked = state.useServiceAlarm, onCheckedChange = { toggleServiceAlarm() })
@@ -109,7 +107,7 @@ private fun SettingScreen(
109107
.height(48.dp)
110108
.padding(horizontal = 16.dp),
111109
horizontalArrangement = Arrangement.SpaceBetween,
112-
verticalAlignment = Alignment.CenterVertically
110+
verticalAlignment = Alignment.CenterVertically,
113111
) {
114112
Text("푸시알림", style = BitnagilTheme.typography.body1Regular)
115113
ToggleSwitch(checked = state.usePushAlarm, onCheckedChange = { togglePushAlarm() })
@@ -129,7 +127,7 @@ private fun SettingScreen(
129127
.height(48.dp)
130128
.padding(horizontal = 16.dp),
131129
horizontalArrangement = Arrangement.SpaceBetween,
132-
verticalAlignment = Alignment.CenterVertically
130+
verticalAlignment = Alignment.CenterVertically,
133131
) {
134132
Row {
135133
Text("버전 ", style = BitnagilTheme.typography.body1Regular)
@@ -159,7 +157,6 @@ private fun SettingScreen(
159157
style = BitnagilTheme.typography.button2.copy(color = BitnagilTheme.colors.navy500),
160158
)
161159
}
162-
163160
}
164161

165162
SettingRowButton(text = "서비스 이용약관", onClick = {})
@@ -193,6 +190,6 @@ fun SettingScreenPreview() {
193190
),
194191
toggleServiceAlarm = {},
195192
togglePushAlarm = {},
196-
onClickUpdate = {}
193+
onClickUpdate = {},
197194
)
198195
}

presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class SettingViewModel @Inject constructor(
2525

2626
override suspend fun SimpleSyntax<SettingState, SettingSideEffect>.reduceState(
2727
intent: SettingIntent,
28-
state: SettingState
28+
state: SettingState,
2929
): SettingState {
30-
when(intent) {
30+
when (intent) {
3131
is SettingIntent.LoadSettingSuccess -> {
3232
return state.copy(
3333
useServiceAlarm = intent.useServiceAlarm,
@@ -38,12 +38,12 @@ class SettingViewModel @Inject constructor(
3838
}
3939
SettingIntent.TogglePushAlarm -> {
4040
return state.copy(
41-
usePushAlarm = !state.usePushAlarm
41+
usePushAlarm = !state.usePushAlarm,
4242
)
4343
}
4444
SettingIntent.ToggleServiceAlarm -> {
4545
return state.copy(
46-
useServiceAlarm = !state.useServiceAlarm
46+
useServiceAlarm = !state.useServiceAlarm,
4747
)
4848
}
4949
}
@@ -54,7 +54,6 @@ class SettingViewModel @Inject constructor(
5454
setServiceAlarmJob?.cancel()
5555
setServiceAlarmJob = viewModelScope.launch {
5656
delay(1000L)
57-
5857
}
5958
}
6059

presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/atom/settingtitle/SettingTitle.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ fun SettingTitle(
1515
Text(
1616
title,
1717
modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp, vertical = 3.dp),
18-
style = BitnagilTheme.typography.caption1SemiBold.copy(color = BitnagilTheme.colors.coolGray50)
18+
style = BitnagilTheme.typography.caption1SemiBold.copy(color = BitnagilTheme.colors.coolGray50),
1919
)
2020
}

presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/atom/toggleswitch/Preview.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ fun ManualSwitchPreview() {
2020

2121
Column(
2222
modifier = Modifier.padding(16.dp).width(100.dp),
23-
verticalArrangement = Arrangement.spacedBy(16.dp)
23+
verticalArrangement = Arrangement.spacedBy(16.dp),
2424
) {
2525
// 켜진 상태
26-
ToggleSwitch (
26+
ToggleSwitch(
2727
checked = isChecked,
2828
onCheckedChange = { checked ->
2929
isChecked = checked
30-
}
30+
},
3131
)
3232
}
3333
}

presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/atom/toggleswitch/ToggleSwitch.kt

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ import androidx.compose.animation.core.animateDpAsState
55
import androidx.compose.animation.core.tween
66
import androidx.compose.foundation.background
77
import androidx.compose.foundation.clickable
8-
import androidx.compose.foundation.layout.*
8+
import androidx.compose.foundation.layout.Box
9+
import androidx.compose.foundation.layout.height
10+
import androidx.compose.foundation.layout.offset
11+
import androidx.compose.foundation.layout.size
12+
import androidx.compose.foundation.layout.width
913
import androidx.compose.foundation.shape.CircleShape
10-
import androidx.compose.runtime.*
14+
import androidx.compose.runtime.Composable
15+
import androidx.compose.runtime.getValue
1116
import androidx.compose.ui.Alignment
1217
import androidx.compose.ui.Modifier
1318
import androidx.compose.ui.draw.clip
@@ -18,7 +23,7 @@ import com.threegap.bitnagil.designsystem.BitnagilTheme
1823
@Composable
1924
fun ToggleSwitch(
2025
checked: Boolean,
21-
onCheckedChange: (Boolean) -> Unit
26+
onCheckedChange: (Boolean) -> Unit,
2227
) {
2328
val trackWidth = 44.dp
2429
val trackHeight = 24.dp
@@ -27,12 +32,12 @@ fun ToggleSwitch(
2732

2833
val thumbOffset by animateDpAsState(
2934
targetValue = if (checked) trackWidth - thumbDiameter - padding else padding,
30-
animationSpec = tween(durationMillis = 200)
35+
animationSpec = tween(durationMillis = 200),
3136
)
3237

3338
val trackColor by animateColorAsState(
3439
targetValue = if (checked) BitnagilTheme.colors.navy500 else BitnagilTheme.colors.coolGray95,
35-
animationSpec = tween(durationMillis = 200)
40+
animationSpec = tween(durationMillis = 200),
3641
)
3742

3843
Box(
@@ -41,19 +46,19 @@ fun ToggleSwitch(
4146
.height(trackHeight)
4247
.clip(CircleShape)
4348
.background(trackColor)
44-
.clickable { onCheckedChange(!checked) }
49+
.clickable { onCheckedChange(!checked) },
4550
) {
4651
Box(
4752
modifier = Modifier
48-
.offset{
53+
.offset {
4954
IntOffset(
5055
x = thumbOffset.toPx().toInt(),
51-
y = 0
56+
y = 0,
5257
)
5358
}
5459
.size(thumbDiameter)
5560
.align(Alignment.CenterStart)
56-
.background(BitnagilTheme.colors.white, CircleShape)
61+
.background(BitnagilTheme.colors.white, CircleShape),
5762
)
5863
}
5964
}

presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/block/settingrowbutton/SettingRowButton.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fun SettingRowButton(
2424
.height(48.dp)
2525
.clickable(onClick = onClick)
2626
.padding(start = 16.dp, end = 4.dp),
27-
verticalAlignment = Alignment.CenterVertically
27+
verticalAlignment = Alignment.CenterVertically,
2828
) {
2929
Text(
3030
text,
@@ -36,7 +36,7 @@ fun SettingRowButton(
3636
modifier = Modifier
3737
.padding(end = 10.dp)
3838
.size(36.dp)
39-
.background(BitnagilTheme.colors.black)
39+
.background(BitnagilTheme.colors.black),
4040
)
4141
}
4242
}

0 commit comments

Comments
 (0)