feat(home): 홈 추천 상단 UI shell을 추가한다
This commit is contained in:
@@ -1,8 +1,59 @@
|
||||
package kr.co.vividnext.sodalive.v2.main
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.base.BaseFragment
|
||||
import kr.co.vividnext.sodalive.databinding.FragmentV2MainHomeBinding
|
||||
import kr.co.vividnext.sodalive.databinding.ViewSectionTitleBinding
|
||||
|
||||
class HomeMainFragment : BaseFragment<FragmentV2MainHomeBinding>(
|
||||
FragmentV2MainHomeBinding::inflate
|
||||
)
|
||||
) {
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
binding.textTabBarHome.root.setMenus(
|
||||
listOf(
|
||||
getString(R.string.screen_home_tab_recommendation),
|
||||
getString(R.string.screen_home_tab_ranking),
|
||||
getString(R.string.screen_home_tab_following)
|
||||
),
|
||||
selectedIndex = 0
|
||||
)
|
||||
binding.textTabBarHome.root.setOnTabSelectedListener { }
|
||||
setUpSectionTitles()
|
||||
}
|
||||
|
||||
private fun setUpSectionTitles() {
|
||||
binding.viewHomeRecentActivityTitle.setTitle(
|
||||
R.string.home_recommendation_section_recently_active_creators
|
||||
)
|
||||
binding.viewHomeRecentDebutTitle.setTitle(
|
||||
R.string.home_recommendation_section_recent_debut_creators,
|
||||
showMore = true
|
||||
)
|
||||
binding.viewHomeFirstAudioTitle.setTitle(
|
||||
R.string.home_recommendation_section_first_audio_contents,
|
||||
showMore = true
|
||||
)
|
||||
binding.viewHomeAiCharacterTitle.setTitle(
|
||||
R.string.home_recommendation_section_ai_characters,
|
||||
showMore = true
|
||||
)
|
||||
binding.viewHomeCheerCreatorTitle.setTitle(
|
||||
R.string.home_recommendation_section_cheer_creators
|
||||
)
|
||||
binding.viewHomePopularCommunityTitle.setTitle(
|
||||
R.string.home_recommendation_section_popular_community_posts
|
||||
)
|
||||
}
|
||||
|
||||
private fun ViewSectionTitleBinding.setTitle(
|
||||
titleResId: Int,
|
||||
showMore: Boolean = false
|
||||
) {
|
||||
tvSectionTitle.setText(titleResId)
|
||||
ivSectionTitleChevron.visibility = if (showMore) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user