Skip to content

Commit

Permalink
[Feature/#877] 오늘의 솝마디 콕찌르기 기능 구현 (#895)
Browse files Browse the repository at this point in the history
* feat: TodayFortuneBox 구현

* feat: 오늘의 운세(TodayFortuneDashboard) UI 구현

* feat: FortuneDetailRoute, FortuneDetailScreen 파일 분리

* refactor: 패키지 네이밍 수정

* feat: fortune 데이터레이어 구현

- di 모듈 추가
- network api 구현

* feat: fortune 도메인레이어 구현, internal 키워드 일괄 적용

- mapper 구현
- 레포지토리 인터페이스 생성 및 적용
- 힐트모듈 수정

* refactor: internal 키워드 삭제

* refactor: 함수 네이밍 수정

* feat: 레이어 의존성 추가

* refactor: 네트워크 path 수정

* feat: 네트워크 통신 구현 및 state 적용

* feat: 오늘의 솝마디 관련 유즈케이스 생성

* refactor: TodayFortuneBox 패딩값 추가

* refactor: 타입 및 네이밍 수정

* refactor: internal 추가

* test: FortuneDetailScreenTest 구현

* feat: 콕 찌르기 대시보드 UI 구현

* feat: 콕 찌르기 유저 추천 API 연결

* refactor: UI State 수정 및 적용

* refactor: SimpleDataFormatter로 리팩터링

* refactor: Timber 적용

* build: 의존성 수정

* refactor: break strategy 적용

* refactor: 뷰모델 수정

* feature #875: delete paddingValue

* feature #875: connect TodayFortuneCard api

* feature #875: connect TodayFortuneCard data

* feature #875: delete paddingValue

* feat: 오늘 부적 받기 버튼 구현

* feature #875: change function name

* feature #875: apply typealias

* feature #875: apply slot for amuletDescription

* feat: 콕 찌르기 바텀시트 UI 구현

* refactor: 클릭 리스너 구현

* feature #875: connect navigation

* feat: 콕 찌르기 서버통신 구현

* feature #875: connect navigator with DeepLink

* feature #875: apply finishActivity

* feature #875: apply FortuneButton component

* feature #875: add contentDescription

* feature #875: apply design

* refactor: 프로필 사진 사이즈 수정

* refactor: 배경색 수정

* feat: 프로필 클릭 시 플레이그라운드로 이동

* feat: 프로필 기본 이미지 구현

* refactor: 자잘한 개행 및 import

* test: 기본 생성 파일 삭제

* refactor: 추천인 이름 글자수 제한 설정

* test: 테스트 코드 수정

* refactor: uimodel의 isEmpty 프로퍼티 제거

* refactor: paddingValues 제거

* refactor: 변수명 변경 및 bottomsheet 관리 코루틴 로직 수정

* refactor: immutableListOf 적용

* refactor: 유저 프로필 사진 crop 버그 수정

* refactor: 콕찌르기 버튼 리플 반영

* refactor: 익명 체크 아이콘 기본값 수정

* feat: 외부 영역 터치 및 하단 스크롤 시 bottomsheet hide 기능 구현

* refactor: 포매팅 정리

* feat: snackbar 구현

* refactor: Icon으로 수정

* refactor: topAppBar Dim처리 및 snackBar 이동

* feature #875: change naming

* feature #875: add preview

* refactor: custom breaking word 로직 구현

* refactor: 매직넘버 상수화

* build: baseline-prof & spotless

---------

Co-authored-by: Dongmin <[email protected]>
  • Loading branch information
s9hn and chattymin authored Oct 13, 2024
1 parent 9072bd6 commit 88c9628
Show file tree
Hide file tree
Showing 33 changed files with 981 additions and 287 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import org.sopt.official.common.navigator.DeepLinkType
import org.sopt.official.common.navigator.NavigatorProvider
import org.sopt.official.feature.attendance.AttendanceActivity
import org.sopt.official.feature.auth.AuthActivity
import org.sopt.official.feature.fortune.FortuneActivity
import org.sopt.official.feature.home.HomeActivity
import org.sopt.official.feature.mypage.mypage.MyPageActivity
import org.sopt.official.feature.notification.SchemeActivity
Expand All @@ -43,48 +44,50 @@ import org.sopt.official.stamp.SoptampActivity
import javax.inject.Inject

class NavigatorProviderIntent @Inject constructor(
@ApplicationContext private val context: Context
@ApplicationContext private val context: Context,
) : NavigatorProvider {
override fun getAuthActivityIntent(): Intent = AuthActivity.newInstance(context)
override fun getNotificationActivityIntent() = NotificationActivity.newInstance(context)
override fun getNotificationDetailActivityIntent(notificationId: String) = NotificationDetailActivity.getIntent(
context,
notificationId
)
override fun getAuthActivityIntent(): Intent = AuthActivity.newInstance(context)
override fun getNotificationActivityIntent() = NotificationActivity.newInstance(context)
override fun getNotificationDetailActivityIntent(notificationId: String) = NotificationDetailActivity.getIntent(
context,
notificationId
)

override fun getMyPageActivityIntent(name: String) = MyPageActivity.getIntent(
context,
MyPageActivity.StartArgs(UserActiveState.valueOf(name))
)

override fun getMyPageActivityIntent(name: String) = MyPageActivity.getIntent(
context,
MyPageActivity.StartArgs(UserActiveState.valueOf(name))
)
override fun getAttendanceActivityIntent() = AttendanceActivity.newInstance(context)

override fun getAttendanceActivityIntent() = AttendanceActivity.newInstance(context)
override fun getSoptampActivityIntent() = SoptampActivity.getIntent(context)

override fun getSoptampActivityIntent() = SoptampActivity.getIntent(context)
override fun getPokeNotificationActivityIntent(name: String) = PokeNotificationActivity.getIntent(
context,
PokeNotificationActivity.Argument(name)
)

override fun getPokeNotificationActivityIntent(name: String) = PokeNotificationActivity.getIntent(
context,
PokeNotificationActivity.Argument(name)
)
override fun getFortuneActivityIntent(): Intent = FortuneActivity.getIntent(context)

override fun getSchemeActivityIntent(
notificationId: String,
link: String
) = SchemeActivity.getIntent(
context,
SchemeActivity.Argument(
notificationId,
link
override fun getSchemeActivityIntent(
notificationId: String,
link: String,
) = SchemeActivity.getIntent(
context,
SchemeActivity.Argument(
notificationId,
link
)
)
)

override fun getHomeActivityIntent(
userStatus: UserStatus,
deepLinkType: DeepLinkType?
) = HomeActivity.getIntent(
context,
HomeActivity.StartArgs(
userStatus,
deepLinkType
override fun getHomeActivityIntent(
userStatus: UserStatus,
deepLinkType: DeepLinkType?,
) = HomeActivity.getIntent(
context,
HomeActivity.StartArgs(
userStatus,
deepLinkType
)
)
)
}
61 changes: 27 additions & 34 deletions app/src/release/generated/baselineProfiles/baseline-prof.txt

Large diffs are not rendered by default.

61 changes: 27 additions & 34 deletions app/src/release/generated/baselineProfiles/startup-prof.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -33,72 +33,85 @@ import org.sopt.official.common.util.extractQueryParameter
import timber.log.Timber

internal val navigator by lazy {
EntryPointAccessors.fromApplication(appContext, NavigatorEntryPoint::class.java).navigatorProvider()
EntryPointAccessors.fromApplication(appContext, NavigatorEntryPoint::class.java).navigatorProvider()
}

enum class DeepLinkType(
val link: String
val link: String,
) {
HOME("home") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) = getHomeIntent(userStatus)
},
NOTIFICATION_LIST("home/notification") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) = userStatus.setIntent(navigator.getNotificationActivityIntent())
},
NOTIFICATION_DETAIL("home/notification/detail") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String): Intent {
val notificationId = deepLink.extractQueryParameter("id")
return userStatus.setIntent(navigator.getNotificationDetailActivityIntent(notificationId))
}
},
MY_PAGE("home/mypage") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) = userStatus.setIntent(navigator.getMyPageActivityIntent(userStatus.name))
},
ATTENDANCE("home/attendance") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) = userStatus.setIntent(navigator.getAttendanceActivityIntent())
},
ATTENDANCE_MODAL("home/attendance/attendance-modal") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) = userStatus.setIntent(navigator.getAttendanceActivityIntent())
},
SOPTAMP("home/soptamp") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) = userStatus.setIntent(navigator.getSoptampActivityIntent())
},
SOPTAMP_ENTIRE_RANKING("home/soptamp/entire-ranking") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) = userStatus.setIntent(navigator.getSoptampActivityIntent())
},
SOPTAMP_CURRENT_GENERATION_RANKING("home/soptamp/current-generation-ranking") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) = userStatus.setIntent(navigator.getSoptampActivityIntent())
},
POKE_NOTIFICATION_LIST("home/poke/notification-list") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) = userStatus.setIntent(navigator.getPokeNotificationActivityIntent(userStatus.name))
},
UNKNOWN("unknown-deep-link") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) = getHomeIntent(userStatus, UNKNOWN)
},
EXPIRED("expired") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) = getHomeIntent(userStatus, EXPIRED)
};
HOME("home") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) = getHomeIntent(userStatus)
},
NOTIFICATION_LIST("home/notification") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) =
userStatus.setIntent(navigator.getNotificationActivityIntent())
},
NOTIFICATION_DETAIL("home/notification/detail") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String): Intent {
val notificationId = deepLink.extractQueryParameter("id")
return userStatus.setIntent(navigator.getNotificationDetailActivityIntent(notificationId))
}
},
MY_PAGE("home/mypage") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) =
userStatus.setIntent(navigator.getMyPageActivityIntent(userStatus.name))
},
ATTENDANCE("home/attendance") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) =
userStatus.setIntent(navigator.getAttendanceActivityIntent())
},
ATTENDANCE_MODAL("home/attendance/attendance-modal") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) =
userStatus.setIntent(navigator.getAttendanceActivityIntent())
},
SOPTAMP("home/soptamp") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) =
userStatus.setIntent(navigator.getSoptampActivityIntent())
},
SOPTAMP_ENTIRE_RANKING("home/soptamp/entire-ranking") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) =
userStatus.setIntent(navigator.getSoptampActivityIntent())
},
SOPTAMP_CURRENT_GENERATION_RANKING("home/soptamp/current-generation-ranking") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) =
userStatus.setIntent(navigator.getSoptampActivityIntent())
},
POKE_NOTIFICATION_LIST("home/poke/notification-list") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) =
userStatus.setIntent(navigator.getPokeNotificationActivityIntent(userStatus.name))
},
FORTUNE("home/fortune") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) =
userStatus.setIntent(navigator.getFortuneActivityIntent())
},
UNKNOWN("unknown-deep-link") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) = getHomeIntent(userStatus, UNKNOWN)
},
EXPIRED("expired") {
override fun getIntent(context: Context, userStatus: UserStatus, deepLink: String) = getHomeIntent(userStatus, EXPIRED)
};

abstract fun getIntent(context: Context, userStatus: UserStatus, deepLink: String): Intent
abstract fun getIntent(context: Context, userStatus: UserStatus, deepLink: String): Intent

companion object {
private fun UserStatus.setIntent(intent: Intent): Intent {
return when (this == UserStatus.UNAUTHENTICATED) {
true -> navigator.getAuthActivityIntent()
false -> intent
}
}
companion object {
private fun UserStatus.setIntent(intent: Intent): Intent {
return when (this == UserStatus.UNAUTHENTICATED) {
true -> navigator.getAuthActivityIntent()
false -> intent
}
}

fun getHomeIntent(userStatus: UserStatus, deepLinkType: DeepLinkType? = null) = userStatus.setIntent(navigator.getHomeActivityIntent(userStatus, deepLinkType))
fun getHomeIntent(userStatus: UserStatus, deepLinkType: DeepLinkType? = null) =
userStatus.setIntent(navigator.getHomeActivityIntent(userStatus, deepLinkType))

fun of(deepLink: String): DeepLinkType {
return try {
val link = deepLink.split("?")[0]
entries.find { it.link == link } ?: UNKNOWN
} catch (exception: Exception) {
Timber.e(exception)
UNKNOWN
}
fun of(deepLink: String): DeepLinkType {
return try {
val link = deepLink.split("?")[0]
entries.find { it.link == link } ?: UNKNOWN
} catch (exception: Exception) {
Timber.e(exception)
UNKNOWN
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,27 @@ import dagger.hilt.components.SingletonComponent
import org.sopt.official.auth.model.UserStatus

interface NavigatorProvider {
fun getAuthActivityIntent(): Intent
fun getNotificationActivityIntent(): Intent
fun getNotificationDetailActivityIntent(notificationId: String): Intent
fun getMyPageActivityIntent(name: String): Intent
fun getAttendanceActivityIntent(): Intent
fun getSoptampActivityIntent(): Intent
fun getPokeNotificationActivityIntent(name: String): Intent
fun getHomeActivityIntent(
userStatus: UserStatus,
deepLinkType: DeepLinkType?
): Intent
fun getAuthActivityIntent(): Intent
fun getNotificationActivityIntent(): Intent
fun getNotificationDetailActivityIntent(notificationId: String): Intent
fun getMyPageActivityIntent(name: String): Intent
fun getAttendanceActivityIntent(): Intent
fun getSoptampActivityIntent(): Intent
fun getPokeNotificationActivityIntent(name: String): Intent
fun getFortuneActivityIntent(): Intent
fun getHomeActivityIntent(
userStatus: UserStatus,
deepLinkType: DeepLinkType?,
): Intent

fun getSchemeActivityIntent(
notificationId: String,
link: String
): Intent
fun getSchemeActivityIntent(
notificationId: String,
link: String,
): Intent
}

@InstallIn(SingletonComponent::class)
@EntryPoint
interface NavigatorEntryPoint {
fun navigatorProvider(): NavigatorProvider
fun navigatorProvider(): NavigatorProvider
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* MIT License
* Copyright 2024 SOPT - Shout Our Passion Together
* Copyright 2023-2024 SOPT - Shout Our Passion Together
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* MIT License
* Copyright 2023 SOPT - Shout Our Passion Together
* Copyright 2023-2024 SOPT - Shout Our Passion Together
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* MIT License
* Copyright 2023 SOPT - Shout Our Passion Together
* Copyright 2023-2024 SOPT - Shout Our Passion Together
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* MIT License
* Copyright 2023 SOPT - Shout Our Passion Together
* Copyright 2023-2024 SOPT - Shout Our Passion Together
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/
package org.sopt.official.feature.fortune.fortuneDetail

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.ui.semantics.SemanticsProperties
import androidx.compose.ui.semantics.getOrNull
import androidx.compose.ui.test.assertIsDisplayed
Expand Down Expand Up @@ -55,7 +54,6 @@ internal class FortuneDetailScreenTest {
composeRule.setContent {
SoptTheme {
FortuneDetailScreen(
paddingValue = PaddingValues(),
date = date,
onFortuneAmuletClick = { },
onPokeClick = { },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class FortuneActivity : AppCompatActivity() {
setContent {
SoptTheme {
FoundationScreen(
navigateToNotification = {
onClickLeadingIcon = {
startActivity(navigator.getNotificationActivityIntent())
},
navigateToHome = {
Expand Down
Loading

0 comments on commit 88c9628

Please sign in to comment.