Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
858ed0d
feat: My(마이) 피처 모듈 추가 및 내비게이션 연결
moondev03 Apr 13, 2026
23a6b31
refactor: 바텀 내비게이션 ProfileScreen -> MyScreen으로 변경
moondev03 Apr 13, 2026
caeb228
refactor: PrezelTextField 내부 정렬 보정
moondev03 Apr 16, 2026
546a9ff
refactor: PrezelAvatar 기본 스타일 수정
moondev03 Apr 16, 2026
3edddff
닉네임 검증 도메인 계층 추가
moondev03 Apr 16, 2026
946bd56
프로필 생성 화면과 로그인 흐름 연결
moondev03 Apr 16, 2026
91256ff
마이 모듈 프로가드 파일 추가
moondev03 Apr 16, 2026
5c290b3
chore: core/model 및 core/domain 테스트 디렉토리 보존을 위한 .gitkeep 추가
moondev03 Apr 16, 2026
762c5cb
feat: User 프로필 관련 데이터 모델 추가
moondev03 Apr 16, 2026
e283823
feat: AdvancedImePadding 커스텀 Modifier 추가
moondev03 Apr 16, 2026
57dd5de
build: kotlinx-serialization 플러그인 추가
moondev03 Apr 16, 2026
75f374c
chore: MainActivity 소프트 키보드 처리 방식 수정
moondev03 Apr 16, 2026
a871dd4
feat: 프로필 이미지 변경 기능 구현
moondev03 Apr 16, 2026
1583300
refactor: User 모델의 nickname 타입을 String으로 변경
moondev03 Apr 16, 2026
16d519c
refactor: ValidateNicknameUseCase 파일 위치 변경
moondev03 Apr 16, 2026
c733cbf
refactor: PrezelAsyncImage 에러 로깅 추가 및 Timber 의존성 추가
moondev03 Apr 16, 2026
6707481
build: AndroidFeatureImplConventionPlugin에 Timber 의존성 추가
moondev03 Apr 16, 2026
781c63a
feat: FetchUserInfoUseCase 구현 및 UserRepository 개선
moondev03 Apr 16, 2026
c6192ac
feat: 프로필 정보 조회 기능 구현 및 화면 진입 로직 개선
moondev03 Apr 16, 2026
5c7bfb8
refactor: 프로필 제출 로직 개선 및 UI Effect 추가
moondev03 Apr 16, 2026
1568e5c
refactor: UserRepositoryImpl 내 테스트용 유저 데이터 수정
moondev03 Apr 16, 2026
2a49c0c
refactor: ProfileScreen UI 컴포넌트 분리 및 구조 개선
moondev03 Apr 16, 2026
fb91880
chore: `UserRepositoryImpl` 내 TODO 주석의 대소문자 수정
moondev03 Apr 16, 2026
af5d6d2
refactor: ProfileViewModel 닉네임 변경 로직 개선 및 공백 처리 위치 변경
moondev03 Apr 16, 2026
ea4174d
refactor: ProfileUiState의 사진 선택 가능 여부 로직 및 상속 구조 개선
moondev03 Apr 16, 2026
6a4bf13
refactor: ProfileViewModel 닉네임 검증 로직 개선
moondev03 Apr 16, 2026
b83b02d
refactor: AdvancedImePadding 위치 계산 로직 개선
moondev03 Apr 16, 2026
700cb82
refactor: ProfileUiState 내 제출 버튼 활성화 조건 수정
moondev03 Apr 16, 2026
e4167ff
fix: ProfileViewModel 내 닉네임 유효성 검사 결과 업데이트 로직 개선
moondev03 Apr 16, 2026
c539b69
refactor: 프로필 설정(ProfileUiState) 구조 개선 및 데이터 모델 정리
moondev03 Apr 16, 2026
0f8d5dc
refactor: Profile 유저 정보 조회 실패 처리 및 Effect 네이밍 개선
moondev03 Apr 16, 2026
ce9adb3
refactor: Nickname 생성 메서드 호출 방식 수정
moondev03 Apr 16, 2026
46bb5a7
style: 닉네임 입력란 플레이스홀더 텍스트 및 주석 수정
moondev03 Apr 16, 2026
7b8ddcd
Merge branch 'develop' into feat/#99-프로필-생성-화면-구현
moondev03 Apr 20, 2026
52041d9
refactor: ProfileUiIntent 명칭 변경 및 관련 로직 수정
moondev03 Apr 20, 2026
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 Prezel/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ dependencies {
implementation(projects.featureHomeImpl)
implementation(projects.featureHistoryApi)
implementation(projects.featureHistoryImpl)
implementation(projects.featureProfileApi)
implementation(projects.featureMyApi)
implementation(projects.featureMyImpl)
implementation(projects.featureProfileImpl)

implementation(libs.androidx.core.ktx)
Expand Down
3 changes: 2 additions & 1 deletion Prezel/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
android:theme="@style/Theme.PrezelSplashScreen">
<activity
android:name=".MainActivity"
android:exported="true">
android:exported="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.team.prezel.core.designsystem.icon.PrezelIcons
import com.team.prezel.feature.history.api.HistoryNavKey
import com.team.prezel.feature.home.api.HomeNavKey
import com.team.prezel.feature.login.api.LoginNavKey
import com.team.prezel.feature.profile.api.ProfileNavKey
import com.team.prezel.feature.my.api.MyNavKey
import com.team.prezel.feature.splash.api.SplashNavKey
import kotlinx.collections.immutable.ImmutableSet
import kotlinx.collections.immutable.persistentMapOf
Expand All @@ -29,15 +29,15 @@ private val HISTORY = TopLevelNavItem(
titleTextId = R.string.bottom_nav_history,
)

private val PROFILE = TopLevelNavItem(
private val MY = TopLevelNavItem(
iconRes = PrezelIcons.Profile,
titleTextId = R.string.bottom_nav_profile,
)

internal val MAIN_NAV_ITEMS = persistentMapOf(
HomeNavKey to HOME,
HistoryNavKey to HISTORY,
ProfileNavKey to PROFILE,
MyNavKey to MY,
)

internal val MAIN_NAV_KEYS: ImmutableSet<NavKey> = MAIN_NAV_ITEMS.keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class AndroidFeatureImplConventionPlugin : Plugin<Project> {
"implementation"(project(":core-navigation"))
"implementation"(libs.findLibrary("androidx.navigation3.ui").get())
"implementation"(libs.findLibrary("androidx.hilt.lifecycle.viewmodel.compose").get())
"implementation"(libs.findLibrary("timber").get())
Comment thread
moondev03 marked this conversation as resolved.
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions Prezel/core/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ android {

dependencies {
implementation(projects.coreNetwork)
implementation(projects.coreModel)
implementation(projects.coreDomain)

implementation(libs.kotlinx.coroutines.core)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.team.prezel.core.data.di

import com.team.prezel.core.data.repository.UserRepositoryImpl
import com.team.prezel.core.domain.repository.profile.UserRepository
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
internal abstract class RepositoryModule {
@Binds
@Singleton
abstract fun bindUserRepository(impl: UserRepositoryImpl): UserRepository
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.team.prezel.core.data.repository

import com.team.prezel.core.domain.repository.profile.UserRepository
import com.team.prezel.core.model.profile.Nickname
import com.team.prezel.core.model.profile.User
import kotlinx.coroutines.delay
import javax.inject.Inject

internal class UserRepositoryImpl @Inject constructor() : UserRepository {
private var cachedUserInfo: User? = null

override suspend fun fetchUserInfo(isRefresh: Boolean): Result<User> =
runCatching {
if (!isRefresh && cachedUserInfo != null) return Result.success(cachedUserInfo!!)

User(
id = 1,
email = "test@gmail.com",
nickname = "",
profileImage = User.ProfileImage(url = "https://picsum.photos/200", isDefault = true),
isRegistered = false,
)
}.onSuccess { user ->
cachedUserInfo = user
}

override suspend fun checkNicknameDuplication(nickname: Nickname): Result<Boolean> {
// todo: 실제 API 연동 후 서버 중복 검사 결과를 반환하도록 교체
delay(200)
return Result.success(false)
}
}
1 change: 1 addition & 0 deletions Prezel/core/designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ dependencies {
implementation(libs.kotlinx.collections.immutable)
implementation(libs.coil.kt.compose)
implementation(libs.kotlinx.datetime)
implementation(libs.timber)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.ColorPainter
import androidx.compose.ui.layout.ContentScale
import coil.compose.AsyncImage
import timber.log.Timber

@Composable
fun PrezelAsyncImage(
Expand All @@ -22,7 +23,10 @@ fun PrezelAsyncImage(
modifier = modifier,
placeholder = ColorPainter(Color.Transparent),
onSuccess = { onSuccess() },
onError = { onError(it.result.throwable) },
onError = { error ->
onError(error.result.throwable)
Timber.e(t = error.result.throwable)
},
contentScale = contentScale,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fun PrezelAvatar(
imageUrl: String?,
contentDescription: String,
modifier: Modifier = Modifier,
size: PrezelAvatarSize = PrezelAvatarSize.SMALL,
size: PrezelAvatarSize = PrezelAvatarSize.REGULAR,
) {
var isError by remember(imageUrl) { mutableStateOf(false) }
val shape = PrezelTheme.shapes.V1000
Expand All @@ -47,8 +47,7 @@ fun PrezelAvatar(
),
contentAlignment = Alignment.Center,
) {
val shouldShowDefault =
imageUrl.isNullOrBlank() || isError
val shouldShowDefault = imageUrl.isNullOrBlank() || isError

if (shouldShowDefault) {
DefaultAvatarIcon(
Expand Down Expand Up @@ -103,7 +102,7 @@ private fun DefaultAvatarIcon(
painter = painterResource(R.drawable.core_designsystem_ic_person),
contentDescription = contentDescription,
modifier = Modifier.size(prezelAvatarIconSize(size)),
tint = PrezelTheme.colors.iconDisabled,
tint = PrezelTheme.colors.iconRegular,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ private fun PrezelTextFieldDecorationBox(
.padding(PrezelTheme.spacing.V12),
verticalAlignment = Alignment.CenterVertically,
) {
Box(modifier = Modifier.weight(1f)) {
Box(
modifier = Modifier.weight(1f),
contentAlignment = Alignment.CenterStart,
) {
innerTextField()
if (showPlaceholder) PrezelTextFieldPlaceholder(placeholder = placeholder)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ internal fun rememberPrezelTextFieldInteraction(
value: String,
enabled: Boolean,
focused: Boolean,
idleMillis: Long = 800L,
idleMillis: Long = 500L,
): PrezelTextFieldInteraction {
var isIdle by remember { mutableStateOf(false) }
val latestValue by rememberUpdatedState(value)
Expand Down
1 change: 1 addition & 0 deletions Prezel/core/domain/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
9 changes: 9 additions & 0 deletions Prezel/core/domain/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
alias(libs.plugins.prezel.jvm.library)
}

dependencies {
implementation(projects.coreModel)
implementation(libs.javax.inject)
implementation(libs.kotlinx.coroutines.core)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.team.prezel.core.domain.repository.profile

import com.team.prezel.core.model.profile.Nickname
import com.team.prezel.core.model.profile.User

interface UserRepository {
suspend fun fetchUserInfo(isRefresh: Boolean): Result<User>

suspend fun checkNicknameDuplication(nickname: Nickname): Result<Boolean>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.team.prezel.core.domain.usecase.user

import com.team.prezel.core.domain.repository.profile.UserRepository
import com.team.prezel.core.model.profile.User
import javax.inject.Inject

/**
* 유저 데이터를 조회하는 UseCase.
*/
class FetchUserInfoUseCase @Inject constructor(
private val userRepository: UserRepository,
) {
suspend operator fun invoke(isRefresh: Boolean = false): Result<User> = userRepository.fetchUserInfo(isRefresh = isRefresh)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.team.prezel.core.domain.usecase.user

import com.team.prezel.core.domain.repository.profile.UserRepository
import com.team.prezel.core.model.profile.Nickname
import javax.inject.Inject

/**
* 닉네임 유효성 및 중복 여부를 검증하는 UseCase.
*
* ### 동작 흐름
* 1. 입력된 문자열을 기반으로 [com.team.prezel.core.model.profile.Nickname.Companion.create]를 호출하여 도메인 규칙에 맞는 닉네임인지 검증합니다.
* 2. 닉네임 생성에 성공한 경우, [com.team.prezel.core.domain.repository.profile.UserRepository.checkNicknameDuplication]을 통해 서버에 중복 여부를 확인합니다.
* 3. 각 단계의 결과에 따라 [Result]를 반환합니다.
*
*/
class ValidateNicknameUseCase @Inject constructor(
private val userRepository: UserRepository,
) {
suspend operator fun invoke(nickname: String): Result =
when (val creationResult = Nickname.create(nickname)) {
is Nickname.CreationResult.Success -> {
userRepository.checkNicknameDuplication(creationResult.nickname).fold(
onSuccess = { isDuplicated ->
if (isDuplicated) Result.Invalid.Duplicated else Result.Available(creationResult.nickname)
},
onFailure = { throwable ->
Result.Error(throwable)
},
)
}

is Nickname.CreationResult.Failure -> Result.Invalid.Format(reason = creationResult.reason)
}

sealed interface Result {
data class Available(
val nickname: Nickname,
) : Result

sealed interface Invalid : Result {
data class Format(
val reason: Nickname.InvalidReason,
) : Invalid

data object Duplicated : Invalid
}

data class Error(
val throwable: Throwable,
) : Result
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.team.prezel.core.model.profile

@JvmInline
value class Nickname private constructor(
val value: String,
) {
sealed interface CreationResult {
data class Success(
val nickname: Nickname,
) : CreationResult

data class Failure(
val reason: InvalidReason,
) : CreationResult
}

enum class InvalidReason {
TOO_SHORT,
TOO_LONG,
INVALID_CHARACTER,
}

companion object {
const val MAX_LENGTH = 10
private const val MIN_LENGTH = 2
private const val LATIN_UPPERCASE_START = 'A'.code
private const val LATIN_UPPERCASE_END = 'Z'.code
private const val LATIN_LOWERCASE_START = 'a'.code
private const val LATIN_LOWERCASE_END = 'z'.code

fun create(value: String): CreationResult =
when (val reason = invalidReasonOf(value)) {
null -> CreationResult.Success(Nickname(value))
else -> CreationResult.Failure(reason)
}

private fun invalidReasonOf(value: String): InvalidReason? {
val length = value.codePointCount(0, value.length)

return when {
length < MIN_LENGTH -> InvalidReason.TOO_SHORT
length > MAX_LENGTH -> InvalidReason.TOO_LONG
!value.codePoints().allMatch(::isAllowedCodePoint) -> InvalidReason.INVALID_CHARACTER
else -> null
}
}

private fun isAllowedCodePoint(codePoint: Int): Boolean =
codePoint in LATIN_UPPERCASE_START..LATIN_UPPERCASE_END ||
codePoint in LATIN_LOWERCASE_START..LATIN_LOWERCASE_END ||
Character.UnicodeScript.of(codePoint) == Character.UnicodeScript.HANGUL
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.team.prezel.core.model.profile

data class User(
val id: Long,
val email: String,
val nickname: String,
val profileImage: ProfileImage,
val isRegistered: Boolean,
) {
data class ProfileImage(
val url: String,
val isDefault: Boolean,
)
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.team.prezel.core.ui

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.imePadding
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.layout.findRootCoordinates
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.layout.positionInRoot
import androidx.compose.ui.platform.LocalDensity
import kotlin.math.roundToInt

fun Modifier.advancedImePadding() =
composed {
var consumePadding by remember { mutableIntStateOf(0) }
onGloballyPositioned { coordinates ->
consumePadding = coordinates.findRootCoordinates().size.height -
(coordinates.positionInRoot().y + coordinates.size.height).roundToInt()
}.consumeWindowInsets(
PaddingValues(bottom = with(LocalDensity.current) { consumePadding.toDp() }),
).imePadding()
}
2 changes: 2 additions & 0 deletions Prezel/feature/login/impl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import com.team.prezel.buildlogic.convention.external.localProperty

plugins {
alias(libs.plugins.prezel.android.feature.impl)
alias(libs.plugins.kotlinx.serialization)
}

android {
Expand All @@ -20,5 +21,6 @@ android {
dependencies {
implementation(projects.coreAuth)
implementation(projects.featureLoginApi)
implementation(projects.featureProfileApi)
implementation(projects.featureHomeApi)
}
Loading