Skip to content

Commit 530c4b7

Browse files
authored
Merge pull request #1531 from BCSDLab/feature/#1496-move-profile-to-external-module
[Refactor] profile 외부 모듈로 분리 및 파일 오류 수정
2 parents d7cb11a + 27dc7ba commit 530c4b7

26 files changed

Lines changed: 185 additions & 63 deletions

feature/home/src/main/java/in/koreatech/koin/feature/home/profile/Constant.kt

Lines changed: 0 additions & 2 deletions
This file was deleted.

feature/profile/build.gradle.kts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
plugins {
2+
alias(libs.plugins.koin.feature)
3+
alias(libs.plugins.koin.hilt)
4+
alias(libs.plugins.koin.library.orbit)
5+
}
6+
7+
android {
8+
namespace = "in.koreatech.koin.feature.profile"
9+
}
10+
11+
dependencies {
12+
implementation(projects.core)
13+
implementation(projects.domain)
14+
implementation(projects.core.onboarding)
15+
implementation(projects.core.designsystem)
16+
implementation(projects.core.analytics)
17+
implementation(projects.core.navigation)
18+
19+
implementation(libs.androidx.core.ktx)
20+
implementation(libs.androidx.appcompat)
21+
implementation(libs.material)
22+
implementation(libs.kotlinx.collections.immutable)
23+
implementation(libs.coil.compose)
24+
implementation(libs.timber)
25+
26+
testImplementation(libs.kotlinx.coroutines.test)
27+
}

feature/profile/consumer-rules.pro

Whitespace-only changes.

feature/profile/lint-baseline.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<issues format="6" by="lint 8.13.0" type="baseline" client="gradle" dependencies="false" name="AGP (8.13.0)" variant="all" version="8.13.0">
3+
4+
</issues>

feature/profile/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<application>
5+
</application>
6+
7+
</manifest>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package `in`.koreatech.koin.feature.profile
2+
internal const val DEEPLINK_MAIN_PROFILE = "koin://main/navigation"

feature/home/src/main/java/in/koreatech/koin/feature/home/profile/ProfileScreen.kt renamed to feature/profile/src/main/java/in/koreatech/koin/feature/profile/ProfileScreen.kt

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
package `in`.koreatech.koin.feature.home.profile
1+
package `in`.koreatech.koin.feature.profile
22

33
import androidx.compose.foundation.Image
44
import androidx.compose.foundation.background
55
import androidx.compose.foundation.border
6+
import androidx.compose.foundation.layout.Arrangement
67
import androidx.compose.foundation.layout.Column
78
import androidx.compose.foundation.layout.Row
89
import androidx.compose.foundation.layout.Spacer
@@ -34,11 +35,9 @@ import `in`.koreatech.koin.core.analytics.EventLogger
3435
import `in`.koreatech.koin.core.designsystem.noRippleClickable
3536
import `in`.koreatech.koin.core.designsystem.theme.RebrandKoinTheme
3637
import `in`.koreatech.koin.core.navigation.utils.rememberNavigator
37-
import `in`.koreatech.koin.feature.home.R
38-
import `in`.koreatech.koin.feature.home.component.HomeSection
39-
import `in`.koreatech.koin.feature.home.profile.component.ProfileCard
40-
import `in`.koreatech.koin.feature.home.profile.component.ProfileTimetable
41-
import `in`.koreatech.koin.feature.home.profile.model.ProfileTimetableLecture
38+
import `in`.koreatech.koin.feature.profile.component.ProfileCard
39+
import `in`.koreatech.koin.feature.profile.component.ProfileTimetable
40+
import `in`.koreatech.koin.feature.profile.model.ProfileTimetableLecture
4241
import kotlinx.collections.immutable.ImmutableList
4342
import org.orbitmvi.orbit.compose.collectAsState
4443
import org.orbitmvi.orbit.compose.collectSideEffect
@@ -79,10 +78,12 @@ fun ProfileScreen(
7978
}
8079
},
8180
onSettingClick = {
82-
if (!uiState.isLoggedIn) {
81+
if (uiState.isLoggedIn) {
82+
onNavigateToSetting()
83+
} else {
8384
EventLogger.logCampusClickEvent(AnalyticsConstant.Label.LOGIN_PROMPT, "설정(비로그인)")
85+
navigator.navigateToSignIn(context, DEEPLINK_MAIN_PROFILE).let { context.startActivity(it) }
8486
}
85-
onNavigateToSetting()
8687
},
8788
onNotificationClick = {
8889
EventLogger.logCampusClickEvent(AnalyticsConstant.Label.NOTIFICATION, "알림 아이콘")
@@ -137,17 +138,22 @@ private fun HeaderSection(
137138
) {
138139
Image(
139140
imageVector = ImageVector.vectorResource(R.drawable.ic_bcsd_symbol),
140-
contentDescription = ""
141+
contentDescription = null
142+
)
143+
144+
Image(
145+
imageVector = ImageVector.vectorResource(R.drawable.ic_koin_text),
146+
contentDescription = null
141147
)
142148

143149
Spacer(modifier = Modifier.weight(1f))
144150

145151
Image(
146152
modifier = Modifier.noRippleClickable { onNotificationClick() },
147153
imageVector = if (isNewNotificationReceived) {
148-
ImageVector.vectorResource(R.drawable.ic_home_notification_dot)
154+
ImageVector.vectorResource(R.drawable.ic_profile_notification_dot)
149155
} else {
150-
ImageVector.vectorResource(R.drawable.ic_home_notification)
156+
ImageVector.vectorResource(R.drawable.ic_profile_notification)
151157
},
152158
contentDescription = null
153159
)
@@ -159,23 +165,23 @@ private fun TimetableSection(
159165
lectures: ImmutableList<ProfileTimetableLecture>,
160166
modifier: Modifier = Modifier
161167
) {
162-
HomeSection(
163-
modifier = modifier.fillMaxWidth(),
164-
text = {
165-
Text(
166-
text = stringResource(R.string.profile_timetable_section),
167-
style = RebrandKoinTheme.typography.medium18
168-
)
169-
},
170-
more = {}
168+
Column(
169+
modifier = modifier
170+
.fillMaxWidth()
171+
.padding(top = 16.dp, start = 24.dp, end = 24.dp),
172+
verticalArrangement = Arrangement.spacedBy(12.dp)
171173
) {
174+
Text(
175+
text = stringResource(R.string.profile_timetable_section),
176+
style = RebrandKoinTheme.typography.bold18
177+
)
172178
Column(
173179
modifier = Modifier
174180
.fillMaxWidth()
175181
.border(0.5.dp, Color(0xFFE6E6E6), RoundedCornerShape(16.dp))
176182
.clip(RoundedCornerShape(16.dp))
177183
.background(RebrandKoinTheme.colors.neutral0)
178-
.padding(vertical = 16.dp, horizontal = 16.dp)
184+
.padding(16.dp)
179185
) {
180186
ProfileTimetable(lectures = lectures)
181187
}

feature/home/src/main/java/in/koreatech/koin/feature/home/profile/ProfileSideEffect.kt renamed to feature/profile/src/main/java/in/koreatech/koin/feature/profile/ProfileSideEffect.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package `in`.koreatech.koin.feature.home.profile
1+
package `in`.koreatech.koin.feature.profile
22

33
sealed class ProfileSideEffect {
44
data object LogoutSuccess : ProfileSideEffect()

feature/home/src/main/java/in/koreatech/koin/feature/home/profile/ProfileState.kt renamed to feature/profile/src/main/java/in/koreatech/koin/feature/profile/ProfileState.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package `in`.koreatech.koin.feature.home.profile
1+
package `in`.koreatech.koin.feature.profile
22

3-
import `in`.koreatech.koin.feature.home.profile.model.ProfileTimetableLecture
3+
import `in`.koreatech.koin.feature.profile.model.ProfileTimetableLecture
44
import kotlinx.collections.immutable.ImmutableList
55
import kotlinx.collections.immutable.persistentListOf
66

@@ -9,6 +9,5 @@ data class ProfileState(
99
val name: String = "",
1010
val studentNumber: String = "",
1111
val timetable: ImmutableList<ProfileTimetableLecture> = persistentListOf(),
12-
val isNewNotificationReceived: Boolean = false,
13-
val showLogoutDialog: Boolean = false
12+
val isNewNotificationReceived: Boolean = false
1413
)

0 commit comments

Comments
 (0)