Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d801c48
Refactor#137 : 출석내역 API 에러 수정
TaeseongYun Apr 24, 2025
1f0d6a9
chore#137 : 활동내역 패키징 수정
TaeseongYun Apr 24, 2025
993a495
chore#137 : 프로필 기본 이미지 추가
TaeseongYun Apr 24, 2025
943831f
feature#137 : 회원탈퇴 기능 연결 작업
TaeseongYun Apr 25, 2025
267584e
feature#137 : 이전기수 활동 내역 작업 완료
TaeseongYun Apr 25, 2025
5a2765c
chore/#137 : 라우트 내비게이션 네이밍 통일
TaeseongYun Apr 27, 2025
cf74976
refactor/#137 : 슬롯 타입 코드리뷰 반영
TaeseongYun Apr 27, 2025
3f75e63
refactor#137 : 스크린 컨벤션 맞게 수정
TaeseongYun Apr 27, 2025
ec900e2
chore#137 : 프로필 인텐트 데이터 기존 네이밍 컨벤션에 맞게 수정
TaeseongYun Apr 27, 2025
e407fa5
fix#137 : 마이페이지 스크린 디자인과 일치하지 않은 현상 수정
TaeseongYun Apr 27, 2025
bc4feea
refactor#137 : 프로필 화면 사이드 이펙트 repeatOnLifecycle 적용
TaeseongYun Apr 27, 2025
aa39fc6
fix#137 : 이전 활동내역 아이템 디자인과 다른 현상 수정
TaeseongYun Apr 27, 2025
a644235
chore/#137 : 불필요한 이전 활동내역 유즈케이스 클래스 제거
TaeseongYun Apr 27, 2025
cb8e5bf
refactor/#137 : 불필요한 유즈케이스 제거로 인한 레포지토리 인터페이스 사용 변경
TaeseongYun Apr 27, 2025
677201e
chore/#137 : 리베이스 이슈로 인한 코드 수정
TaeseongYun Apr 27, 2025
1e0b260
chore/#137 : 히스토리 내비게이션 파일 네이밍 잘못처리 된 현상 수정
TaeseongYun Apr 28, 2025
5fa2468
fix/#137 : 출석내역 디자인과 다르게 정의되어있는 현상 수정
TaeseongYun Apr 28, 2025
8234428
feat/#137 : 출석내역 퍼센트 및 점수 하단 절반 백그라운드 적용 되어있지 않은 UI 추가
TaeseongYun Apr 28, 2025
dbdb1c5
chore/#137 : 리베이스 후 적용 되어있지 않은 클래스 수정
TaeseongYun Apr 28, 2025
c3a484d
fix/#137 : 세팅 버튼 클릭 시 로그아웃 호출이 아닌 세팅 인텐트 호출하도록 변경
TaeseongYun Apr 30, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.navigation.compose.NavHost
import com.yapp.app.official.ui.NavigatorState
import com.yapp.app.official.ui.clearBackStackNavOptions
import com.yapp.feature.history.navigation.attendanceHistoryNavGraph
import com.yapp.feature.history.navigation.previousHistoryNavGraph
import com.yapp.feature.home.navigation.homeNavGraph
import com.yapp.feature.home.navigation.settingNavGraph
import com.yapp.feature.login.navigation.loginNavGraph
Expand Down Expand Up @@ -81,11 +82,14 @@ fun YappNavHost(
profileNavGraph(
onNavigateToSetting = { navigator.navigateSettingScreen() },
onNavigateToLogin = { navigator.navigateLoginScreen(clearBackStackNavOptions) },
onNavigateToPreviousHistory = {},
onNavigateToPreviousHistory = { navigator.navigateToPreviousHistory() },
onNavigateToAttendHistory = { navigator.navigateToAttendance() }
)
attendanceHistoryNavGraph(
navigateToBack = { navigator.popBackStack() }
)
previousHistoryNavGraph(
navigateToBack = { navigator.popBackStack() }
)
}
}
5 changes: 5 additions & 0 deletions app/src/main/java/com/yapp/app/official/ui/Navigator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.navigation.compose.rememberNavController
import androidx.navigation.navOptions
import com.yapp.app.official.navigation.TopLevelDestination
import com.yapp.feature.history.navigation.navigateToAttendance
import com.yapp.feature.history.navigation.navigateToPreviousHistory
import com.yapp.feature.home.navigation.navigateToHome
import com.yapp.feature.home.navigation.navigateToSetting
import com.yapp.feature.login.navigation.LoginRoute
Expand Down Expand Up @@ -86,6 +87,10 @@ class NavigatorState(
navController.navigateToAttendance()
}

fun navigateToPreviousHistory() {
navController.navigateToPreviousHistory()
}

fun popBackStack() {
navController.popBackStack()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.yapp.dataapi

import com.yapp.model.ActivityHistory
import com.yapp.model.UserInfo
import kotlinx.coroutines.flow.Flow

interface UserRepository {
suspend fun getUserAccessToken() : Flow<String>
suspend fun deleteAccount()
suspend fun getUserProfile(): Flow<UserInfo>
fun getUserActivityHistories(): Flow<ActivityHistory>
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal class ScheduleRepositoryImpl @Inject constructor(
private val scheduleApi: ScheduleApi
): ScheduleRepository{
override fun getSessions() = flow {
emit(scheduleApi.getSessions().map { result ->
emit(scheduleApi.getSessions().sessions.map { result ->
Sessions(
id = result.id,
name = result.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.yapp.core.data.data.repository
import com.yapp.core.data.local.SecurityPreferences
import com.yapp.core.data.remote.api.UserApi
import com.yapp.dataapi.UserRepository
import com.yapp.model.ActivityHistory
import com.yapp.model.UserInfo
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
Expand All @@ -22,4 +23,7 @@ internal class UserRepositoryImpl @Inject constructor(
}

override suspend fun getUserProfile() = flow<UserInfo> { emit(userApi.getUserProfile().toModel())}
}
override fun getUserActivityHistories() = flow {
emit(userApi.getUserActivityHistories().toModel())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import retrofit2.http.Query

interface ScheduleApi {
@GET("v1/sessions")
suspend fun getSessions(): List<SessionResponse>
suspend fun getSessions(): SessionResponse

@GET("v1/schedules")
suspend fun getSchedules(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.yapp.core.data.remote.api

import com.yapp.core.data.remote.model.response.UserActivityHistoryResponse
import com.yapp.core.data.remote.model.response.UserProfileResponse
import retrofit2.http.DELETE
import retrofit2.http.GET
Expand All @@ -10,4 +11,7 @@ interface UserApi {

@DELETE("v1/auth/user")
suspend fun deleteUser()

@GET("v1/users/activity-histories")
suspend fun getUserActivityHistories(): UserActivityHistoryResponse
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ import kotlinx.serialization.Serializable

@Serializable
data class SessionResponse(
val id: String,
val name: String,
val place: String?,
val date: String,
val endDate: String?,
val time: String?,
val type: String,
val progressPhase: String
)
val sessions: List<Session>
) {
@Serializable
data class Session(
val id: String,
val name: String,
val place: String?,
val date: String,
val endDate: String?,
val time: String?,
val type: String,
val progressPhase: String
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.yapp.core.data.remote.model.response

import com.yapp.model.ActivityHistory
import kotlinx.serialization.Serializable

@Serializable
data class UserActivityHistoryResponse(
val activityUnits: List<Unit>
) {
@Serializable
data class Unit(
val generation: Int,
val position: String,
val activityStartDate: String?,
val activityEndDate: String?
)

fun toModel(): ActivityHistory {
return ActivityHistory(
activityUnits = activityUnits.map {
ActivityHistory.Unit(
generation = it.generation,
position = it.position,
activityStartDate = it.activityStartDate,
activityEndDate = it.activityEndDate
)
}
)
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions core/model/src/main/java/com/yapp/model/ActivityHistory.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.yapp.model

data class ActivityHistory(
val activityUnits: List<Unit>
) {
data class Unit(
val generation: Int,
val position: String,
val activityStartDate: String?,
val activityEndDate: String?
)
}
2 changes: 1 addition & 1 deletion core/model/src/main/java/com/yapp/model/Sessions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ data class Sessions(
val progressPhase: String
) {
enum class AttendType {

OFFLINE, TEAM
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.yapp.feature.history
package com.yapp.feature.history.attend

import com.yapp.model.Sessions

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.yapp.feature.history
package com.yapp.feature.history.attend

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
Expand All @@ -18,13 +18,14 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.yapp.core.designsystem.component.header.YappHeaderActionbar
import com.yapp.core.designsystem.theme.YappTheme
import com.yapp.feature.history.components.AttendanceStatusSection
import com.yapp.feature.history.components.StatusItem
import com.yapp.feature.history.R
import com.yapp.feature.history.attend.components.AttendanceStatusSection
import com.yapp.feature.history.attend.components.StatusItem
import com.yapp.model.Sessions
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import com.yapp.feature.history.AttendHistoryIntent as Intent
import com.yapp.feature.history.AttendHistorySideEffect as SideEffect
import com.yapp.feature.history.attend.AttendHistoryIntent as Intent
import com.yapp.feature.history.attend.AttendHistorySideEffect as SideEffect
import com.yapp.core.designsystem.R as coreDesignR

@Composable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.yapp.feature.history
package com.yapp.feature.history.attend

import com.yapp.dataapi.AttendanceRepository
import com.yapp.dataapi.SessionRepository
import com.yapp.dataapi.ScheduleRepository
import kotlinx.coroutines.flow.combine
import javax.inject.Inject

internal class AttendHistoryUseCase @Inject constructor(
private val attendanceRepository: AttendanceRepository,
private val sessionRepository: SessionRepository
private val scheduleRepository: ScheduleRepository
){
operator fun invoke() = combine(
attendanceRepository.getAttendanceStatistics(),
sessionRepository.getSessions()
scheduleRepository.getSessions()
) { attendStatistics, sessions ->
attendStatistics to sessions
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.yapp.feature.history
package com.yapp.feature.history.attend

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.yapp.feature.history.components
package com.yapp.feature.history.attend.components

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
Expand All @@ -17,6 +20,9 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.yapp.core.designsystem.theme.YappTheme
Expand All @@ -32,13 +38,14 @@ internal fun AttendanceStatusSection(
Card(
modifier = modifier.fillMaxWidth(),
shape = RoundedCornerShape(8.dp),
colors = CardDefaults.cardColors(containerColor = YappTheme.colorScheme.backgroundNormalAlternative)
colors = CardDefaults.cardColors(containerColor = YappTheme.colorScheme.staticWhite),
border = BorderStroke(width = 1.dp, color = YappTheme.colorScheme.lineSolidAlternative)
) {
Column {
Row(
modifier = Modifier
.fillMaxWidth()
.background(YappTheme.colorScheme.labelDisable)
.background(YappTheme.colorScheme.backgroundElevatedAlternative)
.padding(horizontal = 16.dp, vertical = 10.dp),
horizontalArrangement = Arrangement.SpaceEvenly,
verticalAlignment = Alignment.CenterVertically
Expand All @@ -50,11 +57,28 @@ internal fun AttendanceStatusSection(
)
Text(style = YappTheme.typography.label2Medium, text = subTitle)
Spacer(modifier = Modifier.width(8.dp))
Text(
style = YappTheme.typography.body2NormalBold,
text = totalRate,
color = YappTheme.colorScheme.primaryNormal
)
Box(
contentAlignment = Alignment.Center,
) {
Canvas(modifier = Modifier
.matchParentSize()
) {
val canvasHeight = size.height
val canvasWidth = size.width

drawRect(
color = Color(0xFFFA6027).copy(alpha = 0.1f),
topLeft = Offset(0f, canvasHeight / 2f),
size = Size(canvasWidth, canvasHeight / 2f)
)
}

Text(
text = totalRate,
style = YappTheme.typography.body2NormalBold,
color = YappTheme.colorScheme.primaryNormal
)
}
}
Row(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.yapp.feature.history.components
package com.yapp.feature.history.attend.components

import androidx.compose.runtime.Composable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.yapp.feature.history.components
package com.yapp.feature.history.attend.components

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,36 @@ package com.yapp.feature.history.navigation
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import com.yapp.feature.history.AttendHistoryRoute
import com.yapp.feature.history.attend.AttendHistoryRoute
import com.yapp.feature.history.previous.PreviousHistoryRoute
import kotlinx.serialization.Serializable

@Serializable
data object AttendanceHistory

@Serializable
data object PreviousHistory

fun NavController.navigateToAttendance() {
navigate(AttendanceHistory)
}

fun NavController.navigateToPreviousHistory() {
navigate(PreviousHistory)
}

fun NavGraphBuilder.attendanceHistoryNavGraph(
navigateToBack: () -> Unit
) {
composable<AttendanceHistory> {
AttendHistoryRoute(navigateToBack = navigateToBack)
}
}

fun NavGraphBuilder.previousHistoryNavGraph(
navigateToBack: () -> Unit
) {
composable<PreviousHistory> {
PreviousHistoryRoute(navigateToBack = navigateToBack)
}
}
Loading