콘텐츠 메인 다시듣기 탭
- 순위 제거
This commit is contained in:
		@@ -1,6 +1,5 @@
 | 
			
		||||
package kr.co.vividnext.sodalive.audio_content.main.v2.replay
 | 
			
		||||
 | 
			
		||||
import android.annotation.SuppressLint
 | 
			
		||||
import android.content.Intent
 | 
			
		||||
import android.graphics.Rect
 | 
			
		||||
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.AudioContentMainContentAdapter
 | 
			
		||||
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.ContentRankCreatorAdapter
 | 
			
		||||
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 contentBannerAdapter: AudioContentMainBannerAdapter
 | 
			
		||||
    private lateinit var newContentAdapter: AudioContentMainContentAdapter
 | 
			
		||||
    private lateinit var contentRankingAdapter: AudioContentMainRankingAdapter
 | 
			
		||||
    private lateinit var curationAdapter: AudioContentMainContentCurationAdapter
 | 
			
		||||
    private lateinit var contentRankCreatorAdapter: ContentRankCreatorAdapter
 | 
			
		||||
    private lateinit var popularContentByCreatorAdapter: PopularContentByCreatorAdapter
 | 
			
		||||
@@ -66,7 +63,6 @@ class AudioContentMainTabReplayFragment : BaseFragment<FragmentAudioContentMainT
 | 
			
		||||
 | 
			
		||||
        setupContentBanner()
 | 
			
		||||
        setupNewContent()
 | 
			
		||||
        setupContentRanking()
 | 
			
		||||
        setupPopularContentCreator()
 | 
			
		||||
        setupPopularContentByCreator()
 | 
			
		||||
        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() {
 | 
			
		||||
        contentRankCreatorAdapter = ContentRankCreatorAdapter {
 | 
			
		||||
            binding.llNoItems.visibility = View.VISIBLE
 | 
			
		||||
 
 | 
			
		||||
@@ -33,10 +33,6 @@ class AudioContentMainTabReplayViewModel(
 | 
			
		||||
    val newContentListLiveData: LiveData<List<GetAudioContentMainItem>>
 | 
			
		||||
        get() = _newContentListLiveData
 | 
			
		||||
 | 
			
		||||
    private var _contentRankingLiveData = MutableLiveData<List<GetAudioContentRankingItem>>()
 | 
			
		||||
    val contentRankingLiveData: LiveData<List<GetAudioContentRankingItem>>
 | 
			
		||||
        get() = _contentRankingLiveData
 | 
			
		||||
 | 
			
		||||
    private val _contentCreatorListLiveData = MutableLiveData<List<ContentCreatorResponse>>()
 | 
			
		||||
    val contentCreatorListLiveData: LiveData<List<ContentCreatorResponse>>
 | 
			
		||||
        get() = _contentCreatorListLiveData
 | 
			
		||||
@@ -67,7 +63,6 @@ class AudioContentMainTabReplayViewModel(
 | 
			
		||||
 | 
			
		||||
                            _contentBannerLiveData.value = data.contentBannerList
 | 
			
		||||
                            _newContentListLiveData.value = data.newLiveReplayContentList
 | 
			
		||||
                            _contentRankingLiveData.value = data.rankLiveReplayContentList
 | 
			
		||||
                            _contentCreatorListLiveData.value = data.creatorList
 | 
			
		||||
                            _salesCountRankContentListLiveData.value =
 | 
			
		||||
                                data.salesCountRankContentList
 | 
			
		||||
 
 | 
			
		||||
@@ -15,8 +15,6 @@ data class GetContentMainTabLiveReplayResponse(
 | 
			
		||||
    val contentBannerList: List<GetAudioContentBannerResponse>,
 | 
			
		||||
    @SerializedName("newLiveReplayContentList")
 | 
			
		||||
    val newLiveReplayContentList: List<GetAudioContentMainItem>,
 | 
			
		||||
    @SerializedName("rankLiveReplayContentList")
 | 
			
		||||
    val rankLiveReplayContentList: List<GetAudioContentRankingItem>,
 | 
			
		||||
    @SerializedName("creatorList")
 | 
			
		||||
    val creatorList: List<ContentCreatorResponse>,
 | 
			
		||||
    @SerializedName("salesCountRankContentList")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user