Skip to content

Commit

Permalink
웰컴 배지 시 버튼 텍스트 및 경로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
haeti-dev committed May 29, 2024
1 parent 14f6425 commit f2cb9bd
Showing 1 changed file with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import com.sopt.smeem.databinding.DialogBadgeBinding
import com.sopt.smeem.event.AmplitudeEventType
import com.sopt.smeem.presentation.EventVM
import com.sopt.smeem.presentation.mypage.MyPageActivity
import com.sopt.smeem.presentation.write.natiive.NativeWriteStep1Activity
import com.sopt.smeem.util.setOnSingleClickListener
import dagger.hilt.android.AndroidEntryPoint

Expand Down Expand Up @@ -43,6 +44,12 @@ class BadgeDialogFragment : DialogFragment() {

initDataBinding()
initBadgeData(name, imageUrl, isFirstBadge)

if (name == getString(R.string.welcome_badge)) {
binding.btnBadgeMore.text = getString(R.string.navigate_first_diary)
} else {
binding.btnBadgeMore.text = getString(R.string.view_all_badge)
}
}

private fun addListeners() {
Expand All @@ -54,16 +61,26 @@ class BadgeDialogFragment : DialogFragment() {
}
binding.btnBadgeMore.setOnSingleClickListener {
eventVm.sendEvent(AmplitudeEventType.BADGE_MORE_CLICK)
val name = arguments?.getString(BADGE_NAME) as String

if (arguments?.getBoolean(IS_FIRST_BADGE) == true) {
if (name == getString(R.string.welcome_badge)) {
eventVm.sendEvent(AmplitudeEventType.WELCOME_MORE_CLICK)

Intent(requireContext(), NativeWriteStep1Activity::class.java)
.apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
}
.run(::startActivity)
} else {
Intent(requireContext(), MyPageActivity::class.java)
.apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
}
.run(::startActivity)
}

dismiss()
Intent(requireContext(), MyPageActivity::class.java)
.apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
}
.run(::startActivity)

}
}

Expand Down

0 comments on commit f2cb9bd

Please sign in to comment.