From 4c7887055de7067e202b66115f97d0e951ac9e97 Mon Sep 17 00:00:00 2001 From: klaus Date: Sat, 27 Jun 2026 09:04:31 +0900 Subject: [PATCH] =?UTF-8?q?feat(home):=20FIRST=20=EC=98=A4=EB=94=94?= =?UTF-8?q?=EC=98=A4=20=EC=A0=84=EC=B2=B4=EB=B3=B4=EA=B8=B0=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=EC=9D=84=20=EC=97=B0=EA=B2=B0=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sodalive/v2/main/home/HomeMainFragment.kt | 13 +++++++++++ .../main/home/HomeMainFragmentSourceTest.kt | 23 ++++++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/HomeMainFragment.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/HomeMainFragment.kt index f188bfd7..f4a9f3bb 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/HomeMainFragment.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/HomeMainFragment.kt @@ -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( 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( } } + private fun openFirstAudioOverview() { + ensureMainV2NavigationAllowed { + startActivity( + ContentOverviewActivity.newIntent(requireContext(), ContentOverviewType.FIRST_AUDIO_CONTENT) + ) + } + } + private fun onFollowingSectionMoreClick(section: HomeFollowingSection) = Unit private fun onFollowingLiveClick(item: HomeFollowingLiveUiItem) = Unit diff --git a/app/src/test/java/kr/co/vividnext/sodalive/v2/main/home/HomeMainFragmentSourceTest.kt b/app/src/test/java/kr/co/vividnext/sodalive/v2/main/home/HomeMainFragmentSourceTest.kt index 2876692e..d1bb18c0 100644 --- a/app/src/test/java/kr/co/vividnext/sodalive/v2/main/home/HomeMainFragmentSourceTest.kt +++ b/app/src/test/java/kr/co/vividnext/sodalive/v2/main/home/HomeMainFragmentSourceTest.kt @@ -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() }