feat(home): FIRST 오디오 전체보기 이동을 연결한다

This commit is contained in:
2026-06-27 09:04:31 +09:00
parent 0d7512fee2
commit 4c7887055d
2 changed files with 33 additions and 3 deletions

View File

@@ -21,6 +21,8 @@ import kr.co.vividnext.sodalive.v2.live.onair.HomeOnAirLiveActivity
import kr.co.vividnext.sodalive.v2.main.chat.dm.DmChatRoomActivity
import kr.co.vividnext.sodalive.v2.main.chat.model.ChatRoomListUiItem
import kr.co.vividnext.sodalive.v2.main.chat.model.ChatRoomType
import kr.co.vividnext.sodalive.v2.main.content.overview.ContentOverviewActivity
import kr.co.vividnext.sodalive.v2.main.content.overview.data.ContentOverviewType
import kr.co.vividnext.sodalive.v2.main.ensureMainV2NavigationAllowed
import kr.co.vividnext.sodalive.v2.main.home.model.HomeFollowingChatSection
import kr.co.vividnext.sodalive.v2.main.home.model.HomeFollowingCreatorSection
@@ -457,6 +459,9 @@ class HomeMainFragment : BaseFragment<FragmentV2MainHomeBinding>(
R.string.home_recommendation_section_first_audio_contents,
showMore = true
)
binding.viewHomeFirstAudioTitle.ivSectionTitleChevron.setOnClickListener {
openFirstAudioOverview()
}
binding.viewHomeAiCharacterTitle.setTitle(
R.string.home_recommendation_section_ai_characters,
showMore = true
@@ -509,6 +514,14 @@ class HomeMainFragment : BaseFragment<FragmentV2MainHomeBinding>(
}
}
private fun openFirstAudioOverview() {
ensureMainV2NavigationAllowed {
startActivity(
ContentOverviewActivity.newIntent(requireContext(), ContentOverviewType.FIRST_AUDIO_CONTENT)
)
}
}
private fun onFollowingSectionMoreClick(section: HomeFollowingSection) = Unit
private fun onFollowingLiveClick(item: HomeFollowingLiveUiItem) = Unit

View File

@@ -13,7 +13,7 @@ import java.io.File
class HomeMainFragmentSourceTest {
@Test
fun `홈 FIRST 오디오 섹션 타이틀 chevron만 표시하고 전체보기 이동은 연결하지 않는다`() {
fun `홈 FIRST 오디오 섹션 타이틀 chevron은 신규 전체보기 이동다`() {
val source = projectFile(
"app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/HomeMainFragment.kt"
).readText()
@@ -27,12 +27,29 @@ class HomeMainFragmentSourceTest {
" showMore = true"
)
)
assertTrue(source.contains("import kr.co.vividnext.sodalive.v2.main.content.overview.ContentOverviewActivity"))
assertTrue(source.contains("import kr.co.vividnext.sodalive.v2.main.content.overview.data.ContentOverviewType"))
assertTrue(source.contains("binding.viewHomeFirstAudioTitle.ivSectionTitleChevron.setOnClickListener"))
val functionSource = source.substringFrom("private fun openFirstAudioOverview()")
assertTrue(functionSource.contains("ensureMainV2NavigationAllowed"))
assertTrue(functionSource.contains("startActivity("))
assertTrue(functionSource.contains("ContentOverviewActivity.newIntent(requireContext(),"))
assertTrue(functionSource.contains("ContentOverviewType.FIRST_AUDIO_CONTENT"))
assertTrue(
"Phase 2 must not connect FIRST audio overview navigation yet.",
!source.contains("binding.viewHomeFirstAudioTitle.ivSectionTitleChevron.setOnClickListener")
functionSource.indexOf("ensureMainV2NavigationAllowed") <
functionSource.indexOf("startActivity(")
)
}
private fun String.substringFrom(marker: String): String {
val startIndex = indexOf(marker)
assertTrue("Missing function: $marker", startIndex >= 0)
val nextFunctionIndex = indexOf("\n private fun ", startIndex + marker.length)
.takeIf { it >= 0 }
?: length
return substring(startIndex, nextFunctionIndex)
}
private fun projectFile(relativePath: String): File {
val candidates = listOf(File(relativePath), File("../$relativePath"))
return candidates.firstOrNull { it.exists() }