Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature/#841] 마이페이지 compose 리팩토링 #854

Open
wants to merge 24 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b03d14f
feat #841: compose 추가
leeeyubin Sep 12, 2024
07713a9
feat #841: mypage UI 구현
leeeyubin Sep 16, 2024
cdf75aa
[feature/#841] mypage UI 구현
leeeyubin Sep 16, 2024
ee2778b
[feature/#841] mypage LaunchedEffect 구현
leeeyubin Sep 16, 2024
fac5ee1
[feature/#841] SignOut UI
leeeyubin Sep 17, 2024
bf9998e
[feature/#841] make MyPageButton
leeeyubin Sep 17, 2024
7d98a63
[feature/#841] make AdjustSentence UI
leeeyubin Sep 17, 2024
8edbe5a
[feature/#841] make AdjustSentence UI
leeeyubin Sep 17, 2024
4c4f66f
[feature/#841] fix fontStyle
leeeyubin Sep 17, 2024
3e8ba39
[feature/#841] make MyPage Dialog
leeeyubin Sep 17, 2024
e21ca0f
[feature/#841] make Soptamp Dialog
leeeyubin Sep 17, 2024
f008af8
[feature/#841] make MyPageTopBar Component
leeeyubin Sep 17, 2024
b019008
[feature/#841] make logout Dialog
leeeyubin Sep 17, 2024
56e8f78
[feature/#841] delete AlertDialogPositiveNegative.kt
leeeyubin Sep 17, 2024
8133da3
[feature/#841] delete color
leeeyubin Sep 17, 2024
9119127
[feature/#841] make MyPageSection
leeeyubin Sep 17, 2024
afb7488
[feature/#841] make MyPageSection
leeeyubin Sep 17, 2024
e71fcf6
[feature/#841] change Dialog logic
leeeyubin Sep 17, 2024
19794cd
[chore/#841] fix code
leeeyubin Sep 17, 2024
12a0d50
[feature/#841] MIT License
leeeyubin Sep 18, 2024
f13250f
[feature/#841] resolving conflict
leeeyubin Sep 18, 2024
1e3b4b4
[fix/#841] Fix build issues (due to conflicts)
l2hyunwoo Sep 18, 2024
ab0d1d0
[fix/#841] kspplugin 2.0.20-1.0.25 -> 2.0.20-1.0.24
leeeyubin Sep 18, 2024
f20195e
[fix/#841] kspplugin 2.0.20-1.0.24 -> 2.0.20-1.0.25
leeeyubin Sep 18, 2024
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 @@ -152,7 +152,7 @@ class HomeActivity : AppCompatActivity() {
tracker.track(type = EventType.CLICK, name = "mypage", properties = mapOf("view_type" to args?.userStatus?.value))
lifecycleScope.launch {
startActivity(
MyPageActivity.getIntent(this@HomeActivity, MyPageActivity.Argument(viewModel.userActiveState.value))
MyPageActivity.getIntent(this@HomeActivity, MyPageActivity.StartArgs(viewModel.userActiveState.value))
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class NavigatorProviderIntent @Inject constructor(

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

override fun getAttendanceActivityIntent() = AttendanceActivity.newInstance(context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,70 +45,94 @@ import javax.inject.Inject

@AndroidEntryPoint
class SchemeActivity : AppCompatActivity() {
@Inject
lateinit var dataStore: SoptDataStore
private val args by serializableExtra(Argument("", ""))

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
handleDeepLink()
}
@Inject
lateinit var dataStore: SoptDataStore
private val args by serializableExtra(
Argument(
"",
""
)
)

private fun handleDeepLink() {
val link = args?.link
val linkIntent = when (link.isNullOrBlank()) {
true -> NotificationDetailActivity.getIntent(this, args?.notificationId.orEmpty())
false -> checkLinkExpiration(link)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
handleDeepLink()
}

when (!isTaskRoot) {
true -> startActivity(linkIntent)
false -> TaskStackBuilder.create(this).apply {
if (!isIntentToHome(linkIntent)) {
addNextIntentWithParentStack(
DeepLinkType.getHomeIntent(UserStatus.of(dataStore.userStatus))
)
private fun handleDeepLink() {
val link = args?.link
val linkIntent = when (link.isNullOrBlank()) {
true -> NotificationDetailActivity.getIntent(
this,
args?.notificationId.orEmpty()
)

false -> checkLinkExpiration(link)
}

when (!isTaskRoot) {
true -> startActivity(linkIntent)
false -> TaskStackBuilder.create(this).apply {
if (!isIntentToHome()) {
addNextIntentWithParentStack(
DeepLinkType.getHomeIntent(UserStatus.of(dataStore.userStatus))
)
}
addNextIntent(linkIntent)
}.startActivities()
}
addNextIntent(linkIntent)
}.startActivities()
finish()
}
finish()
}

private fun checkLinkExpiration(link: String): Intent {
return try {
val expiredAt = link.extractQueryParameter("expiredAt")
when (expiredAt.isExpiredDate()) {
true -> DeepLinkType.getHomeIntent(
UserStatus.of(dataStore.userStatus), DeepLinkType.EXPIRED
)
private fun checkLinkExpiration(link: String): Intent {
return try {
val expiredAt = link.extractQueryParameter("expiredAt")
when (expiredAt.isExpiredDate()) {
true -> DeepLinkType.getHomeIntent(
UserStatus.of(dataStore.userStatus),
DeepLinkType.EXPIRED
)

else -> when (link.contains("http://") || link.contains("https://")) {
true -> Intent(
Intent.ACTION_VIEW,
Uri.parse(link)
)

else -> when (link.contains("http://") || link.contains("https://")) {
true -> Intent(Intent.ACTION_VIEW, Uri.parse(link))
false -> DeepLinkType.of(link).getIntent(
this, UserStatus.of(dataStore.userStatus), link
)
false -> DeepLinkType.of(link).getIntent(
this,
UserStatus.of(dataStore.userStatus),
link
)
}
}
} catch (exception: Exception) {
Timber.e(exception)
DeepLinkType.getHomeIntent(
UserStatus.of(dataStore.userStatus),
DeepLinkType.UNKNOWN
)
}
}
} catch (exception: Exception) {
Timber.e(exception)
DeepLinkType.getHomeIntent(
UserStatus.of(dataStore.userStatus), DeepLinkType.UNKNOWN
)
}
}

private fun Intent.isIntentToHome(): Boolean =
intent.component?.className == HomeActivity::class.java.name
}
}
private fun isIntentToHome(): Boolean = intent.component?.className == HomeActivity::class.java.name

data class Argument(
val notificationId: String, val link: String
) : Serializable
data class Argument(
val notificationId: String,
val link: String
) : Serializable

companion object {
@JvmStatic
fun getIntent(context: Context, args: Argument) = Intent(context, SchemeActivity::class.java).putExtra("args", args)
}
companion object {
@JvmStatic
fun getIntent(
context: Context,
args: Argument
) = Intent(
context,
SchemeActivity::class.java
).putExtra(
"args",
args
)
}
}
Loading
Loading