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 f4a9f3bb..06396e5e 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 @@ -5,7 +5,6 @@ import android.os.Bundle import android.view.View import androidx.recyclerview.widget.LinearLayoutManager import kr.co.vividnext.sodalive.R -import kr.co.vividnext.sodalive.audio_content.detail.AudioContentDetailActivity import kr.co.vividnext.sodalive.base.BaseFragment import kr.co.vividnext.sodalive.common.Constants import kr.co.vividnext.sodalive.common.LoadingDialog @@ -21,8 +20,6 @@ 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 @@ -39,8 +36,6 @@ import kr.co.vividnext.sodalive.v2.main.home.model.HomeRecommendationAiCharacter import kr.co.vividnext.sodalive.v2.main.home.model.HomeRecommendationBannerSection import kr.co.vividnext.sodalive.v2.main.home.model.HomeRecommendationBannerUiModel import kr.co.vividnext.sodalive.v2.main.home.model.HomeRecommendationCheerCreatorSection -import kr.co.vividnext.sodalive.v2.main.home.model.HomeRecommendationFirstAudioContentSection -import kr.co.vividnext.sodalive.v2.main.home.model.HomeRecommendationFirstAudioContentUiModel import kr.co.vividnext.sodalive.v2.main.home.model.HomeRecommendationGenreCreatorGroupUiModel import kr.co.vividnext.sodalive.v2.main.home.model.HomeRecommendationGenreCreatorSection import kr.co.vividnext.sodalive.v2.main.home.model.HomeRecommendationLiveSection @@ -62,7 +57,6 @@ import kr.co.vividnext.sodalive.v2.main.home.ui.HomeAiCharacterAdapter import kr.co.vividnext.sodalive.v2.main.home.ui.HomeBannerBinder import kr.co.vividnext.sodalive.v2.main.home.ui.HomeBusinessInfoBinder import kr.co.vividnext.sodalive.v2.main.home.ui.HomeCheerCreatorAdapter -import kr.co.vividnext.sodalive.v2.main.home.ui.HomeFirstAudioAdapter import kr.co.vividnext.sodalive.v2.main.home.ui.HomeFollowingChatAdapter import kr.co.vividnext.sodalive.v2.main.home.ui.HomeFollowingCreatorAdapter import kr.co.vividnext.sodalive.v2.main.home.ui.HomeFollowingLiveAdapter @@ -88,7 +82,6 @@ class HomeMainFragment : BaseFragment( private val liveAdapter = HomeLiveAdapter() private val recentActivityCreatorAdapter = HomeRecentActivityCreatorAdapter { onRecentActivityClick(it) } private val recentDebutCreatorAdapter = HomeRecentDebutCreatorAdapter { openCreatorProfile(it.creatorId) } - private val firstAudioAdapter = HomeFirstAudioAdapter { openAudioContentDetail(it) } private val aiCharacterAdapter = HomeAiCharacterAdapter { onAiCharacterClick(it) } private val genreCreatorAdapter = HomeGenreCreatorAdapter( onFollowAllClick = { creatorIds -> onGenreFollowAllClick(creatorIds) }, @@ -168,7 +161,6 @@ class HomeMainFragment : BaseFragment( binding.rvHomeLives.adapter = liveAdapter binding.rvHomeRecentActivityCreators.adapter = recentActivityCreatorAdapter binding.rvHomeRecentDebutCreators.adapter = recentDebutCreatorAdapter - binding.rvHomeFirstAudioContents.adapter = firstAudioAdapter binding.rvHomeAiCharacters.adapter = aiCharacterAdapter binding.rvHomeGenreCreators.apply { layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) @@ -332,7 +324,6 @@ class HomeMainFragment : BaseFragment( bindBannerSection(content.banners) bindRecentActivitySection(content.recentlyActiveCreators) bindRecentDebutSection(content.recentDebutCreators) - bindFirstAudioSection(content.firstAudioContents) bindAiCharacterSection(content.aiCharacters) bindGenreCreatorSection(content.genreCreators) bindCheerCreatorSection(content.cheerCreators) @@ -405,11 +396,6 @@ class HomeMainFragment : BaseFragment( recentDebutCreatorAdapter.submitItems(section.items) } - private fun bindFirstAudioSection(section: HomeRecommendationFirstAudioContentSection) { - binding.llHomeFirstAudioSection.visibility = section.items.toSectionVisibility() - firstAudioAdapter.submitItems(section.items) - } - private fun bindAiCharacterSection(section: HomeRecommendationAiCharacterSection) { binding.llHomeAiCharacterSection.visibility = section.items.toSectionVisibility() aiCharacterAdapter.submitItems(section.items) @@ -455,13 +441,6 @@ class HomeMainFragment : BaseFragment( R.string.home_recommendation_section_recent_debut_creators, showMore = true ) - binding.viewHomeFirstAudioTitle.setTitle( - 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 @@ -514,14 +493,6 @@ 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 @@ -573,16 +544,6 @@ class HomeMainFragment : BaseFragment( } } - private fun openAudioContentDetail(item: HomeRecommendationFirstAudioContentUiModel) { - ensureMainV2NavigationAllowed { - startActivity( - Intent(requireContext(), AudioContentDetailActivity::class.java).apply { - putExtra(Constants.EXTRA_AUDIO_CONTENT_ID, item.contentId) - } - ) - } - } - private fun openPopularCommunityPost(item: FeedItem.Community) { val creatorId = item.creatorId.toLongOrNull() ?: return val postId = item.postId.toLongOrNull() ?: return @@ -621,7 +582,6 @@ class HomeMainFragment : BaseFragment( banners = HomeRecommendationBannerSection(emptyList()), recentlyActiveCreators = HomeRecommendationRecentlyActiveCreatorSection(emptyList()), recentDebutCreators = HomeRecommendationRecentDebutCreatorSection(emptyList()), - firstAudioContents = HomeRecommendationFirstAudioContentSection(emptyList()), aiCharacters = HomeRecommendationAiCharacterSection(emptyList()), genreCreators = HomeRecommendationGenreCreatorSection(emptyList()), cheerCreators = HomeRecommendationCheerCreatorSection(emptyList()), diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/ui/HomeFirstAudioAdapter.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/ui/HomeFirstAudioAdapter.kt deleted file mode 100644 index 7646aaf4..00000000 --- a/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/ui/HomeFirstAudioAdapter.kt +++ /dev/null @@ -1,105 +0,0 @@ -package kr.co.vividnext.sodalive.v2.main.home.ui - -import android.graphics.Outline -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.view.ViewOutlineProvider -import android.widget.FrameLayout -import android.widget.ImageView -import android.widget.LinearLayout -import android.widget.TextView -import androidx.recyclerview.widget.RecyclerView -import kr.co.vividnext.sodalive.R -import kr.co.vividnext.sodalive.extensions.dpToPx -import kr.co.vividnext.sodalive.extensions.loadUrl -import kr.co.vividnext.sodalive.v2.main.home.model.HomeRecommendationFirstAudioContentUiModel -import kr.co.vividnext.sodalive.v2.widget.AudioContentTag - -class HomeFirstAudioAdapter( - private val onClickItem: (HomeRecommendationFirstAudioContentUiModel) -> Unit = {} -) : RecyclerView.Adapter() { - private var items: List = emptyList() - - fun submitItems(items: List) { - this.items = items - notifyDataSetChanged() - } - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AudioViewHolder { - val view = LayoutInflater.from(parent.context).inflate( - R.layout.item_home_first_audio_content, - parent, - false - ) - view.layoutParams = recyclerItemLayoutParams(parent, R.dimen.spacing_4) - return AudioViewHolder(view, onClickItem) - } - - override fun onBindViewHolder(holder: AudioViewHolder, position: Int) { - holder.bind(items[position]) - } - - override fun getItemCount(): Int = items.size - - class AudioViewHolder( - private val view: View, - private val onClickItem: (HomeRecommendationFirstAudioContentUiModel) -> Unit - ) : RecyclerView.ViewHolder(view) { - private val thumbnail: ImageView = view.findViewById(R.id.iv_home_first_audio_thumbnail) - private val thumbnailContainer: FrameLayout = view.findViewById(R.id.fl_home_first_audio_thumbnail_container) - private val topTagContainer: LinearLayout = view.findViewById(R.id.ll_home_first_audio_tag_top) - private val firstTag: LinearLayout = view.findViewById(R.id.ll_home_first_audio_tag_first) - private val bottomTagContainer: LinearLayout = view.findViewById(R.id.ll_home_first_audio_tag_bottom) - private val pointTag: ImageView = view.findViewById(R.id.iv_home_first_audio_tag_point) - private val freeTag: TextView = view.findViewById(R.id.tv_home_first_audio_tag_free) - private val creatorProfile: ImageView = view.findViewById(R.id.iv_home_first_audio_creator_profile) - private val creatorNickname: TextView = view.findViewById(R.id.tv_home_first_audio_creator_nickname) - - init { - thumbnailContainer.clipToOutline = true - thumbnailContainer.outlineProvider = object : ViewOutlineProvider() { - override fun getOutline(view: View, outline: Outline) { - outline.setRoundRect(0, 0, view.width, view.height, THUMBNAIL_RADIUS_DP.dpToPx()) - } - } - } - - fun bind(item: HomeRecommendationFirstAudioContentUiModel) { - bindImage(thumbnail, item.coverImage) - bindImage(creatorProfile, item.creatorProfileImage) - creatorNickname.text = item.creatorNickname - bindTags(item.tags) - view.setOnClickListener { onClickItem(item) } - } - - private fun bindImage( - imageView: ImageView, - imageUrl: String? - ) { - if (imageUrl.isNullOrBlank()) { - imageView.setImageDrawable(null) - } else { - imageView.loadUrl(imageUrl) - } - } - - private fun bindTags(tags: Set) { - firstTag.visibility = if (AudioContentTag.First in tags) View.VISIBLE else View.GONE - pointTag.visibility = if (AudioContentTag.Point in tags) View.VISIBLE else View.GONE - freeTag.visibility = if (AudioContentTag.Free in tags) View.VISIBLE else View.GONE - topTagContainer.visibility = if (firstTag.visibility == View.VISIBLE) View.VISIBLE else View.GONE - bottomTagContainer.visibility = if ( - pointTag.visibility == View.VISIBLE || freeTag.visibility == View.VISIBLE - ) { - View.VISIBLE - } else { - View.GONE - } - } - - private companion object { - const val THUMBNAIL_RADIUS_DP = 14f - } - } -} diff --git a/app/src/main/res/layout/fragment_v2_main_home.xml b/app/src/main/res/layout/fragment_v2_main_home.xml index d5a2d54a..326ce589 100644 --- a/app/src/main/res/layout/fragment_v2_main_home.xml +++ b/app/src/main/res/layout/fragment_v2_main_home.xml @@ -115,28 +115,6 @@ app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -