parent
d0e01a83e3
commit
61cb208f2f
|
@ -1,6 +1,5 @@
|
||||||
package kr.co.vividnext.sodalive.audio_content.main.v2.replay
|
package kr.co.vividnext.sodalive.audio_content.main.v2.replay
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.graphics.Rect
|
import android.graphics.Rect
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
@ -22,7 +21,6 @@ import kr.co.vividnext.sodalive.audio_content.detail.AudioContentDetailActivity
|
||||||
import kr.co.vividnext.sodalive.audio_content.main.AudioContentBannerType
|
import kr.co.vividnext.sodalive.audio_content.main.AudioContentBannerType
|
||||||
import kr.co.vividnext.sodalive.audio_content.main.AudioContentMainContentAdapter
|
import kr.co.vividnext.sodalive.audio_content.main.AudioContentMainContentAdapter
|
||||||
import kr.co.vividnext.sodalive.audio_content.main.banner.AudioContentMainBannerAdapter
|
import kr.co.vividnext.sodalive.audio_content.main.banner.AudioContentMainBannerAdapter
|
||||||
import kr.co.vividnext.sodalive.audio_content.main.ranking.AudioContentMainRankingAdapter
|
|
||||||
import kr.co.vividnext.sodalive.audio_content.main.v2.AudioContentMainContentCurationAdapter
|
import kr.co.vividnext.sodalive.audio_content.main.v2.AudioContentMainContentCurationAdapter
|
||||||
import kr.co.vividnext.sodalive.audio_content.main.v2.ContentRankCreatorAdapter
|
import kr.co.vividnext.sodalive.audio_content.main.v2.ContentRankCreatorAdapter
|
||||||
import kr.co.vividnext.sodalive.audio_content.main.v2.PopularContentByCreatorAdapter
|
import kr.co.vividnext.sodalive.audio_content.main.v2.PopularContentByCreatorAdapter
|
||||||
|
@ -48,7 +46,6 @@ class AudioContentMainTabReplayFragment : BaseFragment<FragmentAudioContentMainT
|
||||||
private lateinit var loadingDialog: LoadingDialog
|
private lateinit var loadingDialog: LoadingDialog
|
||||||
private lateinit var contentBannerAdapter: AudioContentMainBannerAdapter
|
private lateinit var contentBannerAdapter: AudioContentMainBannerAdapter
|
||||||
private lateinit var newContentAdapter: AudioContentMainContentAdapter
|
private lateinit var newContentAdapter: AudioContentMainContentAdapter
|
||||||
private lateinit var contentRankingAdapter: AudioContentMainRankingAdapter
|
|
||||||
private lateinit var curationAdapter: AudioContentMainContentCurationAdapter
|
private lateinit var curationAdapter: AudioContentMainContentCurationAdapter
|
||||||
private lateinit var contentRankCreatorAdapter: ContentRankCreatorAdapter
|
private lateinit var contentRankCreatorAdapter: ContentRankCreatorAdapter
|
||||||
private lateinit var popularContentByCreatorAdapter: PopularContentByCreatorAdapter
|
private lateinit var popularContentByCreatorAdapter: PopularContentByCreatorAdapter
|
||||||
|
@ -66,7 +63,6 @@ class AudioContentMainTabReplayFragment : BaseFragment<FragmentAudioContentMainT
|
||||||
|
|
||||||
setupContentBanner()
|
setupContentBanner()
|
||||||
setupNewContent()
|
setupNewContent()
|
||||||
setupContentRanking()
|
|
||||||
setupPopularContentCreator()
|
setupPopularContentCreator()
|
||||||
setupPopularContentByCreator()
|
setupPopularContentByCreator()
|
||||||
setupEventBanner()
|
setupEventBanner()
|
||||||
|
@ -226,52 +222,6 @@ class AudioContentMainTabReplayFragment : BaseFragment<FragmentAudioContentMainT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
|
||||||
private fun setupContentRanking() {
|
|
||||||
contentRankingAdapter = AudioContentMainRankingAdapter(
|
|
||||||
width = (screenWidth * 0.66).toInt()
|
|
||||||
) {
|
|
||||||
startActivity(
|
|
||||||
Intent(requireContext(), AudioContentDetailActivity::class.java).apply {
|
|
||||||
putExtra(Constants.EXTRA_AUDIO_CONTENT_ID, it)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.rvContentRanking.layoutManager = GridLayoutManager(
|
|
||||||
context,
|
|
||||||
3,
|
|
||||||
GridLayoutManager.HORIZONTAL,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
|
|
||||||
binding.rvContentRanking.addItemDecoration(object : RecyclerView.ItemDecoration() {
|
|
||||||
override fun getItemOffsets(
|
|
||||||
outRect: Rect,
|
|
||||||
view: View,
|
|
||||||
parent: RecyclerView,
|
|
||||||
state: RecyclerView.State
|
|
||||||
) {
|
|
||||||
super.getItemOffsets(outRect, view, parent, state)
|
|
||||||
outRect.top = 13.3f.dpToPx().toInt()
|
|
||||||
outRect.bottom = 13.3f.dpToPx().toInt()
|
|
||||||
outRect.left = 13.3f.dpToPx().toInt()
|
|
||||||
outRect.right = 13.3f.dpToPx().toInt()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
binding.rvContentRanking.adapter = contentRankingAdapter
|
|
||||||
|
|
||||||
viewModel.contentRankingLiveData.observe(viewLifecycleOwner) {
|
|
||||||
if (it.isNotEmpty()) {
|
|
||||||
binding.llContentRanking.visibility = View.VISIBLE
|
|
||||||
contentRankingAdapter.addItems(it)
|
|
||||||
} else {
|
|
||||||
binding.llContentRanking.visibility = View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setupPopularContentCreator() {
|
private fun setupPopularContentCreator() {
|
||||||
contentRankCreatorAdapter = ContentRankCreatorAdapter {
|
contentRankCreatorAdapter = ContentRankCreatorAdapter {
|
||||||
binding.llNoItems.visibility = View.VISIBLE
|
binding.llNoItems.visibility = View.VISIBLE
|
||||||
|
|
|
@ -33,10 +33,6 @@ class AudioContentMainTabReplayViewModel(
|
||||||
val newContentListLiveData: LiveData<List<GetAudioContentMainItem>>
|
val newContentListLiveData: LiveData<List<GetAudioContentMainItem>>
|
||||||
get() = _newContentListLiveData
|
get() = _newContentListLiveData
|
||||||
|
|
||||||
private var _contentRankingLiveData = MutableLiveData<List<GetAudioContentRankingItem>>()
|
|
||||||
val contentRankingLiveData: LiveData<List<GetAudioContentRankingItem>>
|
|
||||||
get() = _contentRankingLiveData
|
|
||||||
|
|
||||||
private val _contentCreatorListLiveData = MutableLiveData<List<ContentCreatorResponse>>()
|
private val _contentCreatorListLiveData = MutableLiveData<List<ContentCreatorResponse>>()
|
||||||
val contentCreatorListLiveData: LiveData<List<ContentCreatorResponse>>
|
val contentCreatorListLiveData: LiveData<List<ContentCreatorResponse>>
|
||||||
get() = _contentCreatorListLiveData
|
get() = _contentCreatorListLiveData
|
||||||
|
@ -67,7 +63,6 @@ class AudioContentMainTabReplayViewModel(
|
||||||
|
|
||||||
_contentBannerLiveData.value = data.contentBannerList
|
_contentBannerLiveData.value = data.contentBannerList
|
||||||
_newContentListLiveData.value = data.newLiveReplayContentList
|
_newContentListLiveData.value = data.newLiveReplayContentList
|
||||||
_contentRankingLiveData.value = data.rankLiveReplayContentList
|
|
||||||
_contentCreatorListLiveData.value = data.creatorList
|
_contentCreatorListLiveData.value = data.creatorList
|
||||||
_salesCountRankContentListLiveData.value =
|
_salesCountRankContentListLiveData.value =
|
||||||
data.salesCountRankContentList
|
data.salesCountRankContentList
|
||||||
|
|
|
@ -15,8 +15,6 @@ data class GetContentMainTabLiveReplayResponse(
|
||||||
val contentBannerList: List<GetAudioContentBannerResponse>,
|
val contentBannerList: List<GetAudioContentBannerResponse>,
|
||||||
@SerializedName("newLiveReplayContentList")
|
@SerializedName("newLiveReplayContentList")
|
||||||
val newLiveReplayContentList: List<GetAudioContentMainItem>,
|
val newLiveReplayContentList: List<GetAudioContentMainItem>,
|
||||||
@SerializedName("rankLiveReplayContentList")
|
|
||||||
val rankLiveReplayContentList: List<GetAudioContentRankingItem>,
|
|
||||||
@SerializedName("creatorList")
|
@SerializedName("creatorList")
|
||||||
val creatorList: List<ContentCreatorResponse>,
|
val creatorList: List<ContentCreatorResponse>,
|
||||||
@SerializedName("salesCountRankContentList")
|
@SerializedName("salesCountRankContentList")
|
||||||
|
|
|
@ -63,32 +63,6 @@
|
||||||
android:paddingHorizontal="13.3dp" />
|
android:paddingHorizontal="13.3dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_content_ranking"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="30dp"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="13.3dp"
|
|
||||||
android:fontFamily="@font/gmarket_sans_bold"
|
|
||||||
android:text="인기 다시듣기"
|
|
||||||
android:textColor="@color/color_eeeeee"
|
|
||||||
android:textSize="18.3sp" />
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/rv_content_ranking"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="13.3dp"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:paddingHorizontal="6.7dp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_creator_content_ranking"
|
android:id="@+id/ll_creator_content_ranking"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in New Issue