feat(content): 추천 섹션 chevron 표시를 적용한다
This commit is contained in:
@@ -507,18 +507,36 @@ class ContentMainFragment : BaseFragment<FragmentV2MainContentBinding>(
|
||||
}
|
||||
|
||||
private fun setUpSectionTitles() {
|
||||
binding.viewContentOriginalSeriesTitle.setTitle(R.string.content_recommendation_section_original_series)
|
||||
binding.viewContentLatestAudioTitle.setTitle(R.string.content_recommendation_section_latest_audio)
|
||||
binding.viewContentNewAndHotTitle.setTitle(R.string.content_recommendation_section_new_and_hot)
|
||||
binding.viewContentFreeAudioTitle.setTitle(R.string.content_recommendation_section_free_audio)
|
||||
binding.viewContentPointAudioTitle.setTitle(R.string.content_recommendation_section_point_audio)
|
||||
binding.viewContentOriginalSeriesTitle.setTitle(
|
||||
R.string.content_recommendation_section_original_series,
|
||||
showMore = true
|
||||
)
|
||||
binding.viewContentLatestAudioTitle.setTitle(
|
||||
R.string.content_recommendation_section_latest_audio,
|
||||
showMore = true
|
||||
)
|
||||
binding.viewContentNewAndHotTitle.setTitle(
|
||||
R.string.content_recommendation_section_new_and_hot,
|
||||
showMore = true
|
||||
)
|
||||
binding.viewContentFreeAudioTitle.setTitle(
|
||||
R.string.content_recommendation_section_free_audio,
|
||||
showMore = true
|
||||
)
|
||||
binding.viewContentPointAudioTitle.setTitle(
|
||||
R.string.content_recommendation_section_point_audio,
|
||||
showMore = true
|
||||
)
|
||||
binding.viewContentMostCommentedAudioTitle.setTitle(R.string.content_recommendation_section_most_commented_audio)
|
||||
binding.viewContentRecommendedAudioTitle.setTitle(R.string.content_recommendation_section_recommended_audio)
|
||||
}
|
||||
|
||||
private fun ViewSectionTitleBinding.setTitle(titleResId: Int) {
|
||||
private fun ViewSectionTitleBinding.setTitle(
|
||||
titleResId: Int,
|
||||
showMore: Boolean = false
|
||||
) {
|
||||
tvSectionTitle.setText(titleResId)
|
||||
ivSectionTitleChevron.visibility = View.GONE
|
||||
ivSectionTitleChevron.visibility = if (showMore) View.VISIBLE else View.GONE
|
||||
}
|
||||
|
||||
private fun onBannerClick(item: ContentBannerUiModel) {
|
||||
|
||||
@@ -283,6 +283,58 @@ class ContentMainFragmentSourceTest {
|
||||
assertTrue(audioCardLayout.contains("android:visibility=\"gone\""))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `콘텐츠 추천 섹션 타이틀은 Phase 2 대상에만 chevron을 표시한다`() {
|
||||
val source = projectFile(
|
||||
"app/src/main/java/kr/co/vividnext/sodalive/v2/main/content/ContentMainFragment.kt"
|
||||
).readText()
|
||||
|
||||
assertSourceContains(source, "private fun ViewSectionTitleBinding.setTitle(")
|
||||
assertSourceContains(source, "showMore: Boolean = false")
|
||||
assertSourceContains(source, "ivSectionTitleChevron.visibility = if (showMore) View.VISIBLE else View.GONE")
|
||||
assertSourceContains(
|
||||
source,
|
||||
"binding.viewContentOriginalSeriesTitle.setTitle(\n" +
|
||||
" R.string.content_recommendation_section_original_series,\n" +
|
||||
" showMore = true"
|
||||
)
|
||||
assertSourceContains(
|
||||
source,
|
||||
"binding.viewContentLatestAudioTitle.setTitle(\n" +
|
||||
" R.string.content_recommendation_section_latest_audio,\n" +
|
||||
" showMore = true"
|
||||
)
|
||||
assertSourceContains(
|
||||
source,
|
||||
"binding.viewContentNewAndHotTitle.setTitle(\n" +
|
||||
" R.string.content_recommendation_section_new_and_hot,\n" +
|
||||
" showMore = true"
|
||||
)
|
||||
assertSourceContains(
|
||||
source,
|
||||
"binding.viewContentFreeAudioTitle.setTitle(\n" +
|
||||
" R.string.content_recommendation_section_free_audio,\n" +
|
||||
" showMore = true"
|
||||
)
|
||||
assertSourceContains(
|
||||
source,
|
||||
"binding.viewContentPointAudioTitle.setTitle(\n" +
|
||||
" R.string.content_recommendation_section_point_audio,\n" +
|
||||
" showMore = true"
|
||||
)
|
||||
assertSourceContains(
|
||||
source,
|
||||
"binding.viewContentMostCommentedAudioTitle.setTitle(" +
|
||||
"R.string.content_recommendation_section_most_commented_audio)"
|
||||
)
|
||||
assertSourceContains(
|
||||
source,
|
||||
"binding.viewContentRecommendedAudioTitle.setTitle(" +
|
||||
"R.string.content_recommendation_section_recommended_audio)"
|
||||
)
|
||||
assertFalse(source.contains("viewContentNewAndHotTitle.ivSectionTitleChevron.setOnClickListener"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Phase 4~5 adapter source는 grouping과 badge comment 정책을 포함한다`() {
|
||||
val cardView = projectFile(
|
||||
|
||||
Reference in New Issue
Block a user