fix(content): 추천 섹션 순서를 조정한다

This commit is contained in:
2026-07-09 08:28:23 +09:00
parent 1baf3ac7e0
commit dace1416c5
3 changed files with 64 additions and 22 deletions

View File

@@ -226,28 +226,6 @@
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/ll_content_latest_audio_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_48"
android:orientation="vertical">
<include
android:id="@+id/view_content_latest_audio_title"
layout="@layout/view_section_title" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_content_latest_audios"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_14"
android:clipToPadding="false"
android:orientation="horizontal"
android:paddingHorizontal="@dimen/spacing_14"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_content_new_and_hot_section" android:id="@+id/ll_content_new_and_hot_section"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -270,6 +248,28 @@
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/ll_content_latest_audio_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_48"
android:orientation="vertical">
<include
android:id="@+id/view_content_latest_audio_title"
layout="@layout/view_section_title" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_content_latest_audios"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_14"
android:clipToPadding="false"
android:orientation="horizontal"
android:paddingHorizontal="@dimen/spacing_14"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_content_free_audio_section" android:id="@+id/ll_content_free_audio_section"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -283,6 +283,32 @@ class ContentMainFragmentSourceTest {
assertTrue(audioCardLayout.contains("android:visibility=\"gone\"")) assertTrue(audioCardLayout.contains("android:visibility=\"gone\""))
} }
@Test
fun `content 추천 layout은 요청된 섹션 순서로 배치한다`() {
val fragmentLayout = projectFile("app/src/main/res/layout/fragment_v2_main_content.xml").readText()
val originalSeriesIndex = fragmentLayout.indexOf("@+id/ll_content_original_series_section")
val newAndHotIndex = fragmentLayout.indexOf("@+id/ll_content_new_and_hot_section")
val latestAudioIndex = fragmentLayout.indexOf("@+id/ll_content_latest_audio_section")
val freeAudioIndex = fragmentLayout.indexOf("@+id/ll_content_free_audio_section")
val pointAudioIndex = fragmentLayout.indexOf("@+id/ll_content_point_audio_section")
val commentedAudioIndex = fragmentLayout.indexOf("@+id/ll_content_most_commented_audio_section")
val recommendedAudioIndex = fragmentLayout.indexOf("@+id/ll_content_recommended_audio_section")
assertTrue(originalSeriesIndex >= 0)
assertTrue(newAndHotIndex >= 0)
assertTrue(latestAudioIndex >= 0)
assertTrue(freeAudioIndex >= 0)
assertTrue(pointAudioIndex >= 0)
assertTrue(commentedAudioIndex >= 0)
assertTrue(recommendedAudioIndex >= 0)
assertTrue(originalSeriesIndex < newAndHotIndex)
assertTrue(newAndHotIndex < latestAudioIndex)
assertTrue(latestAudioIndex < freeAudioIndex)
assertTrue(freeAudioIndex < pointAudioIndex)
assertTrue(pointAudioIndex < commentedAudioIndex)
assertTrue(commentedAudioIndex < recommendedAudioIndex)
}
@Test @Test
fun `콘텐츠 추천 섹션 타이틀은 Phase 2 대상에만 chevron을 표시한다`() { fun `콘텐츠 추천 섹션 타이틀은 Phase 2 대상에만 chevron을 표시한다`() {
val source = projectFile( val source = projectFile(

View File

@@ -517,3 +517,19 @@
- 2026-06-23: Phase 4~6 코드 리뷰 및 검증을 재수행했다. 배너/오리지널 시리즈/공통 오디오 카드/New&Hot/최근 댓글 adapter, 실제 API 상태 observer, section visibility, 오디오/시리즈/배너 routing, 제외 섹션 미추가 상태를 확인했고 blocking issue는 발견하지 못했다. `./gradlew :app:testDebugUnitTest --tests "kr.co.vividnext.sodalive.v2.main.content.*"`, `./gradlew :app:mergeDebugResources`, `./gradlew :app:compileDebugKotlin`, `./gradlew :app:ktlintCheck`, `git diff --check` 결과 모두 성공했다. `:app:mergeDebugResources`는 최초 sandbox 실행에서 `~/.gradle` lock 파일 권한으로 실패해 승인 후 재실행했고 성공했다. - 2026-06-23: Phase 4~6 코드 리뷰 및 검증을 재수행했다. 배너/오리지널 시리즈/공통 오디오 카드/New&Hot/최근 댓글 adapter, 실제 API 상태 observer, section visibility, 오디오/시리즈/배너 routing, 제외 섹션 미추가 상태를 확인했고 blocking issue는 발견하지 못했다. `./gradlew :app:testDebugUnitTest --tests "kr.co.vividnext.sodalive.v2.main.content.*"`, `./gradlew :app:mergeDebugResources`, `./gradlew :app:compileDebugKotlin`, `./gradlew :app:ktlintCheck`, `git diff --check` 결과 모두 성공했다. `:app:mergeDebugResources`는 최초 sandbox 실행에서 `~/.gradle` lock 파일 권한으로 실패해 승인 후 재실행했고 성공했다.
- 2026-06-23: Phase 7 통합 검증으로 `./gradlew :app:testDebugUnitTest --tests "kr.co.vividnext.sodalive.v2.main.content.*"`, `./gradlew :app:mergeDebugResources`, `./gradlew :app:compileDebugKotlin`, `./gradlew :app:ktlintCheck`, `git diff --check`를 순차 실행했고 모두 성공했다. 실제 기기 `SM-G960N - Android 10`에 debug APK를 설치해 콘텐츠 탭 진입, title-bar/tab-bar 고정 영역, 제외 섹션 미표시를 확인했다. 다만 실제 API 응답이 빈 상태여서 non-empty 섹션과 item routing은 실기기에서 확인하지 못했고 기존 source/mapper 테스트와 컴파일 검증으로 대체했다. - 2026-06-23: Phase 7 통합 검증으로 `./gradlew :app:testDebugUnitTest --tests "kr.co.vividnext.sodalive.v2.main.content.*"`, `./gradlew :app:mergeDebugResources`, `./gradlew :app:compileDebugKotlin`, `./gradlew :app:ktlintCheck`, `git diff --check`를 순차 실행했고 모두 성공했다. 실제 기기 `SM-G960N - Android 10`에 debug APK를 설치해 콘텐츠 탭 진입, title-bar/tab-bar 고정 영역, 제외 섹션 미표시를 확인했다. 다만 실제 API 응답이 빈 상태여서 non-empty 섹션과 item routing은 실기기에서 확인하지 못했고 기존 source/mapper 테스트와 컴파일 검증으로 대체했다.
- 2026-06-25: 리뷰 지적에 따라 `ContentRecyclerItemLayoutParams`의 grid item offset을 left column 여부 기반 계산에서 `spanCount``columnIndex` 기반 계산으로 수정했다. 기본 2열은 기존처럼 인접 gap `4dp + 4dp`를 유지하고, 전체 탭 3열은 1-2열/2-3열 사이 gap이 모두 `8dp`가 되도록 보정했다. 회귀 방지를 위해 `ContentMainFragmentSourceTest`에 3열 spacing 계약을 추가했고, `./gradlew :app:testDebugUnitTest --tests "kr.co.vividnext.sodalive.v2.main.content.ContentMainFragmentSourceTest"`, `./gradlew :app:compileDebugKotlin`, `./gradlew :app:ktlintCheck`를 실행해 모두 `BUILD SUCCESSFUL`을 확인했다. `ktlintCheck``.editorconfig disabled_rules` deprecation 경고와 Gradle deprecation warning은 기존 경고로 이번 변경과 무관하다. - 2026-06-25: 리뷰 지적에 따라 `ContentRecyclerItemLayoutParams`의 grid item offset을 left column 여부 기반 계산에서 `spanCount``columnIndex` 기반 계산으로 수정했다. 기본 2열은 기존처럼 인접 gap `4dp + 4dp`를 유지하고, 전체 탭 3열은 1-2열/2-3열 사이 gap이 모두 `8dp`가 되도록 보정했다. 회귀 방지를 위해 `ContentMainFragmentSourceTest`에 3열 spacing 계약을 추가했고, `./gradlew :app:testDebugUnitTest --tests "kr.co.vividnext.sodalive.v2.main.content.ContentMainFragmentSourceTest"`, `./gradlew :app:compileDebugKotlin`, `./gradlew :app:ktlintCheck`를 실행해 모두 `BUILD SUCCESSFUL`을 확인했다. `ktlintCheck``.editorconfig disabled_rules` deprecation 경고와 Gradle deprecation warning은 기존 경고로 이번 변경과 무관하다.
### 2026-07-09 후속 변경: 메인 콘텐츠 추천 섹션 순서 변경
- [x] **Task 8.1: 추천 탭 XML 섹션 순서 변경**
- 수정:
- `app/src/main/res/layout/fragment_v2_main_content.xml`
- `app/src/test/java/kr/co/vividnext/sodalive/v2/main/content/ContentMainFragmentSourceTest.kt`
- 작업:
- 추천 탭 섹션 순서를 `오직 보이스온에서만!``New&Hot``새로 올라온 오디오``무료 오디오``포인트 오디오``댓글 많은 오디오``추천 오디오`로 변경한다.
- adapter, ViewModel, routing 로직은 변경하지 않는다.
- 검증:
- `./gradlew :app:testDebugUnitTest --tests "kr.co.vividnext.sodalive.v2.main.content.ContentMainFragmentSourceTest"`
- `./gradlew :app:mergeDebugResources`
- `./gradlew :app:compileDebugKotlin`
- 검증 기록:
- 2026-07-09: 먼저 `ContentMainFragmentSourceTest.content 추천 layout은 요청된 섹션 순서로 배치한다`를 추가하고 기존 XML에서 `newAndHotIndex < latestAudioIndex` 조건 실패를 RED로 확인했다. 이후 `fragment_v2_main_content.xml`에서 `New&Hot` 섹션을 `새로 올라온 오디오` 위로 이동했고, `./gradlew :app:testDebugUnitTest --tests "kr.co.vividnext.sodalive.v2.main.content.ContentMainFragmentSourceTest"`, `./gradlew :app:mergeDebugResources`, `./gradlew :app:compileDebugKotlin`, `git diff --check` 결과 모두 성공했다. Gradle deprecation warning과 Agora namespace warning은 기존 경고로 이번 변경과 무관하다.