fix(home): FIRST 오디오 섹션 UI를 제거한다
This commit is contained in:
@@ -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<FragmentV2MainHomeBinding>(
|
||||
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<FragmentV2MainHomeBinding>(
|
||||
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<FragmentV2MainHomeBinding>(
|
||||
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<FragmentV2MainHomeBinding>(
|
||||
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<FragmentV2MainHomeBinding>(
|
||||
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<FragmentV2MainHomeBinding>(
|
||||
}
|
||||
}
|
||||
|
||||
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<FragmentV2MainHomeBinding>(
|
||||
}
|
||||
}
|
||||
|
||||
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<FragmentV2MainHomeBinding>(
|
||||
banners = HomeRecommendationBannerSection(emptyList()),
|
||||
recentlyActiveCreators = HomeRecommendationRecentlyActiveCreatorSection(emptyList()),
|
||||
recentDebutCreators = HomeRecommendationRecentDebutCreatorSection(emptyList()),
|
||||
firstAudioContents = HomeRecommendationFirstAudioContentSection(emptyList()),
|
||||
aiCharacters = HomeRecommendationAiCharacterSection(emptyList()),
|
||||
genreCreators = HomeRecommendationGenreCreatorSection(emptyList()),
|
||||
cheerCreators = HomeRecommendationCheerCreatorSection(emptyList()),
|
||||
|
||||
@@ -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<HomeFirstAudioAdapter.AudioViewHolder>() {
|
||||
private var items: List<HomeRecommendationFirstAudioContentUiModel> = emptyList()
|
||||
|
||||
fun submitItems(items: List<HomeRecommendationFirstAudioContentUiModel>) {
|
||||
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<AudioContentTag>) {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,28 +115,6 @@
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_home_first_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_home_first_audio_title"
|
||||
layout="@layout/view_section_title" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_home_first_audio_contents"
|
||||
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
|
||||
android:id="@+id/ll_home_ai_character_section"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="185dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_home_first_audio_thumbnail_container"
|
||||
android:layout_width="185dp"
|
||||
android:layout_height="185dp"
|
||||
android:background="@drawable/bg_audio_content_card_thumbnail"
|
||||
android:outlineProvider="background">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_home_first_audio_thumbnail"
|
||||
android:layout_width="185dp"
|
||||
android:layout_height="185dp"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="@drawable/ic_launcher_background" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_home_first_audio_tag_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|start"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_home_first_audio_tag_first"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/spacing_24"
|
||||
android:background="@drawable/bg_audio_content_tag_first"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="4dp"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="17dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_content_tag_first_star" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:fontFamily="@font/phosphate_solid"
|
||||
android:singleLine="true"
|
||||
android:text="FIRST"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
tools:ignore="HardcodedText" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_home_first_audio_tag_bottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|start"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:ignore="UseCompoundDrawables"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_home_first_audio_tag_point"
|
||||
android:layout_width="@dimen/spacing_24"
|
||||
android:layout_height="@dimen/spacing_24"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_content_tag_point" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_home_first_audio_tag_free"
|
||||
style="@style/Typography.Body4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/spacing_24"
|
||||
android:background="@drawable/bg_audio_content_tag_free"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="@string/audio_content_tag_free"
|
||||
android:textColor="@color/white" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/spacing_8"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="6dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_home_first_audio_creator_profile"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="@drawable/bg_round_corner_999_263238"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="@drawable/ic_launcher_background" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_home_first_audio_creator_nickname"
|
||||
style="@style/Typography.Body4"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/spacing_8"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
tools:text="크리에이터 이름" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user