콘텐츠 메인 API 분리 및 속도 개선
This commit is contained in:
parent
8f3a2f16ad
commit
8ddf85c1be
|
@ -10,9 +10,11 @@ import kr.co.vividnext.sodalive.audio_content.detail.GetAudioContentDetailRespon
|
||||||
import kr.co.vividnext.sodalive.audio_content.detail.PutAudioContentLikeRequest
|
import kr.co.vividnext.sodalive.audio_content.detail.PutAudioContentLikeRequest
|
||||||
import kr.co.vividnext.sodalive.audio_content.detail.PutAudioContentLikeResponse
|
import kr.co.vividnext.sodalive.audio_content.detail.PutAudioContentLikeResponse
|
||||||
import kr.co.vividnext.sodalive.audio_content.donation.AudioContentDonationRequest
|
import kr.co.vividnext.sodalive.audio_content.donation.AudioContentDonationRequest
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentBannerResponse
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentCurationResponse
|
||||||
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentMainItem
|
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentMainItem
|
||||||
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentMainResponse
|
|
||||||
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentRanking
|
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentRanking
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.GetNewContentUploadCreator
|
||||||
import kr.co.vividnext.sodalive.audio_content.order.GetAudioContentOrderListResponse
|
import kr.co.vividnext.sodalive.audio_content.order.GetAudioContentOrderListResponse
|
||||||
import kr.co.vividnext.sodalive.audio_content.order.OrderRequest
|
import kr.co.vividnext.sodalive.audio_content.order.OrderRequest
|
||||||
import kr.co.vividnext.sodalive.audio_content.upload.theme.GetAudioContentThemeResponse
|
import kr.co.vividnext.sodalive.audio_content.upload.theme.GetAudioContentThemeResponse
|
||||||
|
@ -125,11 +127,6 @@ interface AudioContentApi {
|
||||||
@Header("Authorization") authHeader: String
|
@Header("Authorization") authHeader: String
|
||||||
): Single<ApiResponse<Any>>
|
): Single<ApiResponse<Any>>
|
||||||
|
|
||||||
@GET("/audio-content/main")
|
|
||||||
fun getMain(
|
|
||||||
@Header("Authorization") authHeader: String
|
|
||||||
): Single<ApiResponse<GetAudioContentMainResponse>>
|
|
||||||
|
|
||||||
@GET("/audio-content/main/new")
|
@GET("/audio-content/main/new")
|
||||||
fun getNewContentOfTheme(
|
fun getNewContentOfTheme(
|
||||||
@Query("theme") theme: String,
|
@Query("theme") theme: String,
|
||||||
|
@ -182,4 +179,26 @@ interface AudioContentApi {
|
||||||
@Query("sort-type") sortType: String,
|
@Query("sort-type") sortType: String,
|
||||||
@Header("Authorization") authHeader: String
|
@Header("Authorization") authHeader: String
|
||||||
): Single<ApiResponse<GetAudioContentRanking>>
|
): Single<ApiResponse<GetAudioContentRanking>>
|
||||||
|
|
||||||
|
@GET("/audio-content/main/curation-list")
|
||||||
|
fun getCurationList(
|
||||||
|
@Query("page") page: Int,
|
||||||
|
@Query("size") size: Int,
|
||||||
|
@Header("Authorization") authHeader: String
|
||||||
|
): Single<ApiResponse<List<GetAudioContentCurationResponse>>>
|
||||||
|
|
||||||
|
@GET("/audio-content/main/new-content-upload-creator")
|
||||||
|
fun getNewContentUploadCreatorList(
|
||||||
|
@Header("Authorization") authHeader: String
|
||||||
|
): Single<ApiResponse<List<GetNewContentUploadCreator>>>
|
||||||
|
|
||||||
|
@GET("/audio-content/main/banner-list")
|
||||||
|
fun getMainBannerList(
|
||||||
|
@Header("Authorization") authHeader: String
|
||||||
|
): Single<ApiResponse<List<GetAudioContentBannerResponse>>>
|
||||||
|
|
||||||
|
@GET("/audio-content/main/order-list")
|
||||||
|
fun getMainOrderList(
|
||||||
|
@Header("Authorization") authHeader: String
|
||||||
|
): Single<ApiResponse<List<GetAudioContentMainItem>>>
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,8 +129,6 @@ class AudioContentRepository(
|
||||||
token: String
|
token: String
|
||||||
) = api.likeContent(request, authHeader = token)
|
) = api.likeContent(request, authHeader = token)
|
||||||
|
|
||||||
fun getMain(token: String) = api.getMain(authHeader = token)
|
|
||||||
|
|
||||||
fun getNewContentOfTheme(theme: String, token: String) = api.getNewContentOfTheme(
|
fun getNewContentOfTheme(theme: String, token: String) = api.getNewContentOfTheme(
|
||||||
theme = theme,
|
theme = theme,
|
||||||
authHeader = token
|
authHeader = token
|
||||||
|
@ -177,4 +175,17 @@ class AudioContentRepository(
|
||||||
sortType = sortType,
|
sortType = sortType,
|
||||||
authHeader = token
|
authHeader = token
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fun getCurationList(page: Int, size: Int, token: String) = api.getCurationList(
|
||||||
|
page = page - 1,
|
||||||
|
size = size,
|
||||||
|
authHeader = token
|
||||||
|
)
|
||||||
|
|
||||||
|
fun getNewContentUploadCreatorList(
|
||||||
|
token: String
|
||||||
|
) = api.getNewContentUploadCreatorList(authHeader = token)
|
||||||
|
|
||||||
|
fun getMainBannerList(token: String) = api.getMainBannerList(authHeader = token)
|
||||||
|
fun getMainOrderList(token: String) = api.getMainOrderList(authHeader = token)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import androidx.recyclerview.widget.GridLayoutManager
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import kr.co.vividnext.sodalive.audio_content.detail.AudioContentDetailActivity
|
import kr.co.vividnext.sodalive.audio_content.detail.AudioContentDetailActivity
|
||||||
import kr.co.vividnext.sodalive.audio_content.main.AudioContentMainNewContentThemeAdapter
|
import kr.co.vividnext.sodalive.audio_content.main.new_content.AudioContentMainNewContentThemeAdapter
|
||||||
import kr.co.vividnext.sodalive.base.BaseActivity
|
import kr.co.vividnext.sodalive.base.BaseActivity
|
||||||
import kr.co.vividnext.sodalive.common.Constants
|
import kr.co.vividnext.sodalive.common.Constants
|
||||||
import kr.co.vividnext.sodalive.common.LoadingDialog
|
import kr.co.vividnext.sodalive.common.LoadingDialog
|
||||||
|
|
|
@ -9,7 +9,7 @@ import android.widget.Toast
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import kr.co.vividnext.sodalive.audio_content.detail.AudioContentDetailActivity
|
import kr.co.vividnext.sodalive.audio_content.detail.AudioContentDetailActivity
|
||||||
import kr.co.vividnext.sodalive.audio_content.main.AudioContentMainNewContentThemeAdapter
|
import kr.co.vividnext.sodalive.audio_content.main.new_content.AudioContentMainNewContentThemeAdapter
|
||||||
import kr.co.vividnext.sodalive.base.BaseActivity
|
import kr.co.vividnext.sodalive.base.BaseActivity
|
||||||
import kr.co.vividnext.sodalive.common.Constants
|
import kr.co.vividnext.sodalive.common.Constants
|
||||||
import kr.co.vividnext.sodalive.common.LoadingDialog
|
import kr.co.vividnext.sodalive.common.LoadingDialog
|
||||||
|
|
|
@ -22,11 +22,21 @@ import kr.co.vividnext.sodalive.audio_content.all.AudioContentNewAllActivity
|
||||||
import kr.co.vividnext.sodalive.audio_content.all.AudioContentRankingAllActivity
|
import kr.co.vividnext.sodalive.audio_content.all.AudioContentRankingAllActivity
|
||||||
import kr.co.vividnext.sodalive.audio_content.curation.AudioContentCurationActivity
|
import kr.co.vividnext.sodalive.audio_content.curation.AudioContentCurationActivity
|
||||||
import kr.co.vividnext.sodalive.audio_content.detail.AudioContentDetailActivity
|
import kr.co.vividnext.sodalive.audio_content.detail.AudioContentDetailActivity
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.banner.AudioContentMainBannerAdapter
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.banner.AudioContentMainBannerViewModel
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.curation.AudioContentMainCurationAdapter
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.curation.AudioContentMainCurationViewModel
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.new_content.AudioContentMainNewContentThemeAdapter
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.new_content.AudioContentMainNewContentViewModel
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.new_content_upload_creator.AudioContentMainNewContentCreatorAdapter
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.new_content_upload_creator.AudioContentMainNewContentCreatorViewModel
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.order.AudioContentMainOrderListViewModel
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.ranking.AudioContentMainRankingAdapter
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.ranking.AudioContentMainRankingViewModel
|
||||||
import kr.co.vividnext.sodalive.audio_content.order.AudioContentOrderListActivity
|
import kr.co.vividnext.sodalive.audio_content.order.AudioContentOrderListActivity
|
||||||
import kr.co.vividnext.sodalive.audio_content.upload.AudioContentUploadActivity
|
import kr.co.vividnext.sodalive.audio_content.upload.AudioContentUploadActivity
|
||||||
import kr.co.vividnext.sodalive.base.BaseFragment
|
import kr.co.vividnext.sodalive.base.BaseFragment
|
||||||
import kr.co.vividnext.sodalive.common.Constants
|
import kr.co.vividnext.sodalive.common.Constants
|
||||||
import kr.co.vividnext.sodalive.common.LoadingDialog
|
|
||||||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||||
import kr.co.vividnext.sodalive.databinding.FragmentAudioContentMainBinding
|
import kr.co.vividnext.sodalive.databinding.FragmentAudioContentMainBinding
|
||||||
import kr.co.vividnext.sodalive.explorer.profile.UserProfileActivity
|
import kr.co.vividnext.sodalive.explorer.profile.UserProfileActivity
|
||||||
|
@ -39,32 +49,37 @@ import kotlin.math.roundToInt
|
||||||
class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
FragmentAudioContentMainBinding::inflate
|
FragmentAudioContentMainBinding::inflate
|
||||||
) {
|
) {
|
||||||
private val viewModel: AudioContentMainViewModel by inject()
|
private val newContentCreatorViewModel: AudioContentMainNewContentCreatorViewModel by inject()
|
||||||
|
|
||||||
private lateinit var loadingDialog: LoadingDialog
|
|
||||||
private lateinit var imm: InputMethodManager
|
|
||||||
|
|
||||||
private lateinit var newContentCreatorAdapter: AudioContentMainNewContentCreatorAdapter
|
private lateinit var newContentCreatorAdapter: AudioContentMainNewContentCreatorAdapter
|
||||||
|
|
||||||
|
private val bannerViewModel: AudioContentMainBannerViewModel by inject()
|
||||||
private lateinit var bannerAdapter: AudioContentMainBannerAdapter
|
private lateinit var bannerAdapter: AudioContentMainBannerAdapter
|
||||||
|
|
||||||
|
private val orderListViewModel: AudioContentMainOrderListViewModel by inject()
|
||||||
private lateinit var orderListAdapter: AudioContentMainContentAdapter
|
private lateinit var orderListAdapter: AudioContentMainContentAdapter
|
||||||
|
|
||||||
|
private val newContentViewModel: AudioContentMainNewContentViewModel by inject()
|
||||||
private lateinit var newContentThemeAdapter: AudioContentMainNewContentThemeAdapter
|
private lateinit var newContentThemeAdapter: AudioContentMainNewContentThemeAdapter
|
||||||
private lateinit var newContentAdapter: AudioContentMainContentAdapter
|
private lateinit var newContentAdapter: AudioContentMainContentAdapter
|
||||||
|
|
||||||
|
private val contentRankingViewModel: AudioContentMainRankingViewModel by inject()
|
||||||
private lateinit var contentRankingSortAdapter: AudioContentMainNewContentThemeAdapter
|
private lateinit var contentRankingSortAdapter: AudioContentMainNewContentThemeAdapter
|
||||||
private lateinit var contentRankingAdapter: AudioContentMainRankingAdapter
|
private lateinit var contentRankingAdapter: AudioContentMainRankingAdapter
|
||||||
|
|
||||||
|
private val curationViewModel: AudioContentMainCurationViewModel by inject()
|
||||||
private lateinit var curationAdapter: AudioContentMainCurationAdapter
|
private lateinit var curationAdapter: AudioContentMainCurationAdapter
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
loadingDialog = LoadingDialog(requireActivity(), layoutInflater)
|
|
||||||
imm = requireContext().getSystemService(
|
|
||||||
Service.INPUT_METHOD_SERVICE
|
|
||||||
) as InputMethodManager
|
|
||||||
|
|
||||||
setupView()
|
setupView()
|
||||||
bindData()
|
|
||||||
|
|
||||||
viewModel.getMain()
|
curationViewModel.getCurationList()
|
||||||
|
bannerViewModel.getMainBannerList()
|
||||||
|
newContentViewModel.getThemeList()
|
||||||
|
newContentViewModel.getNewContentOfTheme("전체")
|
||||||
|
contentRankingViewModel.getContentRanking()
|
||||||
|
contentRankingViewModel.getContentRankingSortType()
|
||||||
|
newContentCreatorViewModel.getNewContentUploadCreatorList()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupView() {
|
private fun setupView() {
|
||||||
|
@ -93,7 +108,13 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
|
|
||||||
binding.swipeRefreshLayout.setOnRefreshListener {
|
binding.swipeRefreshLayout.setOnRefreshListener {
|
||||||
binding.swipeRefreshLayout.isRefreshing = false
|
binding.swipeRefreshLayout.isRefreshing = false
|
||||||
viewModel.getMain()
|
curationViewModel.refresh()
|
||||||
|
bannerViewModel.getMainBannerList()
|
||||||
|
newContentViewModel.getThemeList()
|
||||||
|
newContentViewModel.getNewContentOfTheme("전체")
|
||||||
|
contentRankingViewModel.getContentRanking()
|
||||||
|
contentRankingViewModel.getContentRankingSortType()
|
||||||
|
newContentCreatorViewModel.getNewContentUploadCreatorList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,6 +160,21 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
})
|
})
|
||||||
|
|
||||||
binding.rvNewContentCreator.adapter = newContentCreatorAdapter
|
binding.rvNewContentCreator.adapter = newContentCreatorAdapter
|
||||||
|
|
||||||
|
newContentCreatorViewModel.newContentUploadCreatorListLiveData.observe(viewLifecycleOwner) {
|
||||||
|
newContentCreatorAdapter.addItems(it)
|
||||||
|
binding.rvNewContentCreator.visibility = if (
|
||||||
|
newContentCreatorAdapter.itemCount <= 0 && it.isEmpty()
|
||||||
|
) {
|
||||||
|
View.GONE
|
||||||
|
} else {
|
||||||
|
View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
newContentCreatorViewModel.toastLiveData.observe(viewLifecycleOwner) {
|
||||||
|
it?.let { Toast.makeText(requireContext(), it, Toast.LENGTH_LONG).show() }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupBanner() {
|
private fun setupBanner() {
|
||||||
|
@ -203,6 +239,21 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
)
|
)
|
||||||
.setIndicatorSliderWidth(4f.dpToPx().toInt(), 10f.dpToPx().toInt())
|
.setIndicatorSliderWidth(4f.dpToPx().toInt(), 10f.dpToPx().toInt())
|
||||||
.setIndicatorHeight(4f.dpToPx().toInt())
|
.setIndicatorHeight(4f.dpToPx().toInt())
|
||||||
|
|
||||||
|
bannerViewModel.bannerLiveData.observe(viewLifecycleOwner) {
|
||||||
|
if (bannerAdapter.itemCount <= 0 && it.isEmpty()) {
|
||||||
|
binding.rvBanner.visibility = View.GONE
|
||||||
|
binding.indicatorBanner.visibility = View.GONE
|
||||||
|
} else {
|
||||||
|
binding.rvBanner.visibility = View.VISIBLE
|
||||||
|
binding.indicatorBanner.visibility = View.VISIBLE
|
||||||
|
binding.rvBanner.refreshData(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bannerViewModel.toastLiveData.observe(viewLifecycleOwner) {
|
||||||
|
it?.let { Toast.makeText(requireContext(), it, Toast.LENGTH_LONG).show() }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupOrderList() {
|
private fun setupOrderList() {
|
||||||
|
@ -261,11 +312,26 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
binding.tvMyStashViewAll.setOnClickListener {
|
binding.tvMyStashViewAll.setOnClickListener {
|
||||||
startActivity(Intent(requireContext(), AudioContentOrderListActivity::class.java))
|
startActivity(Intent(requireContext(), AudioContentOrderListActivity::class.java))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
orderListViewModel.orderListLiveData.observe(viewLifecycleOwner) {
|
||||||
|
orderListAdapter.addItems(it)
|
||||||
|
binding.llMyStash.visibility = if (
|
||||||
|
orderListAdapter.itemCount <= 0 && it.isEmpty()
|
||||||
|
) {
|
||||||
|
View.GONE
|
||||||
|
} else {
|
||||||
|
View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
orderListViewModel.toastLiveData.observe(viewLifecycleOwner) {
|
||||||
|
it?.let { Toast.makeText(requireContext(), it, Toast.LENGTH_LONG).show() }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupNewContentTheme() {
|
private fun setupNewContentTheme() {
|
||||||
newContentThemeAdapter = AudioContentMainNewContentThemeAdapter {
|
newContentThemeAdapter = AudioContentMainNewContentThemeAdapter {
|
||||||
viewModel.getNewContentOfTheme(theme = it)
|
newContentViewModel.getNewContentOfTheme(theme = it)
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.rvNewContentTheme.layoutManager = LinearLayoutManager(
|
binding.rvNewContentTheme.layoutManager = LinearLayoutManager(
|
||||||
|
@ -303,6 +369,11 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
})
|
})
|
||||||
|
|
||||||
binding.rvNewContentTheme.adapter = newContentThemeAdapter
|
binding.rvNewContentTheme.adapter = newContentThemeAdapter
|
||||||
|
|
||||||
|
newContentViewModel.themeListLiveData.observe(viewLifecycleOwner) {
|
||||||
|
binding.llNewContent.visibility = View.VISIBLE
|
||||||
|
newContentThemeAdapter.addItems(it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupNewContent() {
|
private fun setupNewContent() {
|
||||||
|
@ -362,11 +433,27 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
})
|
})
|
||||||
|
|
||||||
binding.rvNewContent.adapter = newContentAdapter
|
binding.rvNewContent.adapter = newContentAdapter
|
||||||
|
|
||||||
|
newContentViewModel.newContentListLiveData.observe(viewLifecycleOwner) {
|
||||||
|
newContentAdapter.addItems(it)
|
||||||
|
}
|
||||||
|
|
||||||
|
newContentViewModel.isLoading.observe(viewLifecycleOwner) {
|
||||||
|
binding.pbNewContent.visibility = if (it) {
|
||||||
|
View.VISIBLE
|
||||||
|
} else {
|
||||||
|
View.GONE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
newContentViewModel.toastLiveData.observe(viewLifecycleOwner) {
|
||||||
|
it?.let { Toast.makeText(requireContext(), it, Toast.LENGTH_LONG).show() }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupContentRankingSortType() {
|
private fun setupContentRankingSortType() {
|
||||||
contentRankingSortAdapter = AudioContentMainNewContentThemeAdapter {
|
contentRankingSortAdapter = AudioContentMainNewContentThemeAdapter {
|
||||||
viewModel.getContentRanking(sort = it)
|
contentRankingViewModel.getContentRanking(sort = it)
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.rvContentRankingSort.layoutManager = LinearLayoutManager(
|
binding.rvContentRankingSort.layoutManager = LinearLayoutManager(
|
||||||
|
@ -404,8 +491,14 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
})
|
})
|
||||||
|
|
||||||
binding.rvContentRankingSort.adapter = contentRankingSortAdapter
|
binding.rvContentRankingSort.adapter = contentRankingSortAdapter
|
||||||
|
|
||||||
|
contentRankingViewModel.contentRankingSortListLiveData.observe(viewLifecycleOwner) {
|
||||||
|
binding.llContentRanking.visibility = View.VISIBLE
|
||||||
|
contentRankingSortAdapter.addItems(it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
private fun setupContentRanking() {
|
private fun setupContentRanking() {
|
||||||
binding.ivContentRankingAll.setOnClickListener {
|
binding.ivContentRankingAll.setOnClickListener {
|
||||||
startActivity(Intent(requireContext(), AudioContentRankingAllActivity::class.java))
|
startActivity(Intent(requireContext(), AudioContentRankingAllActivity::class.java))
|
||||||
|
@ -444,6 +537,16 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
})
|
})
|
||||||
|
|
||||||
binding.rvContentRanking.adapter = contentRankingAdapter
|
binding.rvContentRanking.adapter = contentRankingAdapter
|
||||||
|
|
||||||
|
contentRankingViewModel.contentRankingLiveData.observe(viewLifecycleOwner) {
|
||||||
|
binding.llContentRanking.visibility = View.VISIBLE
|
||||||
|
binding.tvDate.text = "${it.startDate}~${it.endDate}"
|
||||||
|
contentRankingAdapter.addItems(it.items)
|
||||||
|
}
|
||||||
|
|
||||||
|
contentRankingViewModel.toastLiveData.observe(viewLifecycleOwner) {
|
||||||
|
it?.let { Toast.makeText(requireContext(), it, Toast.LENGTH_LONG).show() }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupCuration() {
|
private fun setupCuration() {
|
||||||
|
@ -506,85 +609,50 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
binding.rvCuration.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||||
|
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||||
|
super.onScrolled(recyclerView, dx, dy)
|
||||||
|
|
||||||
|
val lastVisibleItemPosition = (recyclerView.layoutManager as LinearLayoutManager?)!!
|
||||||
|
.findLastCompletelyVisibleItemPosition()
|
||||||
|
val itemTotalCount = recyclerView.adapter!!.itemCount - 1
|
||||||
|
|
||||||
|
// 스크롤이 끝에 도달했는지 확인
|
||||||
|
if (!recyclerView.canScrollVertically(1) &&
|
||||||
|
lastVisibleItemPosition == itemTotalCount
|
||||||
|
) {
|
||||||
|
curationViewModel.getCurationList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
binding.rvCuration.adapter = curationAdapter
|
binding.rvCuration.adapter = curationAdapter
|
||||||
|
|
||||||
|
curationViewModel.curationListLiveData.observe(viewLifecycleOwner) {
|
||||||
|
if (curationViewModel.page == 2) {
|
||||||
|
curationAdapter.clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
curationAdapter.addItems(it)
|
||||||
private fun bindData() {
|
|
||||||
viewModel.isLoading.observe(viewLifecycleOwner) {
|
binding.rvCuration.visibility = if (curationAdapter.itemCount <= 0 && it.isEmpty()) {
|
||||||
if (it) {
|
View.GONE
|
||||||
loadingDialog.show(screenWidth)
|
|
||||||
} else {
|
} else {
|
||||||
loadingDialog.dismiss()
|
View.VISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel.toastLiveData.observe(viewLifecycleOwner) {
|
curationViewModel.isLoading.observe(viewLifecycleOwner) {
|
||||||
|
binding.pbCuration.visibility = if (it) {
|
||||||
|
View.VISIBLE
|
||||||
|
} else {
|
||||||
|
View.GONE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
curationViewModel.toastLiveData.observe(viewLifecycleOwner) {
|
||||||
it?.let { Toast.makeText(requireContext(), it, Toast.LENGTH_LONG).show() }
|
it?.let { Toast.makeText(requireContext(), it, Toast.LENGTH_LONG).show() }
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel.newContentUploadCreatorListLiveData.observe(viewLifecycleOwner) {
|
|
||||||
newContentCreatorAdapter.addItems(it)
|
|
||||||
binding.rvNewContentCreator.visibility = if (
|
|
||||||
newContentCreatorAdapter.itemCount <= 0 && it.isEmpty()
|
|
||||||
) {
|
|
||||||
View.GONE
|
|
||||||
} else {
|
|
||||||
View.VISIBLE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.bannerLiveData.observe(viewLifecycleOwner) {
|
|
||||||
if (bannerAdapter.itemCount <= 0 && it.isEmpty()) {
|
|
||||||
binding.rvBanner.visibility = View.GONE
|
|
||||||
binding.indicatorBanner.visibility = View.GONE
|
|
||||||
} else {
|
|
||||||
binding.rvBanner.visibility = View.VISIBLE
|
|
||||||
binding.indicatorBanner.visibility = View.VISIBLE
|
|
||||||
binding.rvBanner.refreshData(it)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.orderListLiveData.observe(viewLifecycleOwner) {
|
|
||||||
orderListAdapter.addItems(it)
|
|
||||||
binding.llMyStash.visibility = if (
|
|
||||||
orderListAdapter.itemCount <= 0 && it.isEmpty()
|
|
||||||
) {
|
|
||||||
View.GONE
|
|
||||||
} else {
|
|
||||||
View.VISIBLE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.newContentListLiveData.observe(viewLifecycleOwner) {
|
|
||||||
newContentAdapter.addItems(it)
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.themeListLiveData.observe(viewLifecycleOwner) {
|
|
||||||
binding.llNewContent.visibility = View.VISIBLE
|
|
||||||
newContentThemeAdapter.addItems(it)
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.curationListLiveData.observe(viewLifecycleOwner) {
|
|
||||||
curationAdapter.addItems(it)
|
|
||||||
binding.rvCuration.visibility = if (
|
|
||||||
curationAdapter.itemCount <= 0 && it.isEmpty()
|
|
||||||
) {
|
|
||||||
View.GONE
|
|
||||||
} else {
|
|
||||||
View.VISIBLE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.contentRankingSortListLiveData.observe(viewLifecycleOwner) {
|
|
||||||
binding.llContentRanking.visibility = View.VISIBLE
|
|
||||||
contentRankingSortAdapter.addItems(it)
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.contentRankingLiveData.observe(viewLifecycleOwner) {
|
|
||||||
binding.llContentRanking.visibility = View.VISIBLE
|
|
||||||
binding.tvDate.text = "${it.startDate}~${it.endDate}"
|
|
||||||
contentRankingAdapter.addItems(it.items)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,166 +0,0 @@
|
||||||
package kr.co.vividnext.sodalive.audio_content.main
|
|
||||||
|
|
||||||
import androidx.lifecycle.LiveData
|
|
||||||
import androidx.lifecycle.MutableLiveData
|
|
||||||
import com.orhanobut.logger.Logger
|
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
|
||||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
|
||||||
import kr.co.vividnext.sodalive.audio_content.AudioContentRepository
|
|
||||||
import kr.co.vividnext.sodalive.base.BaseViewModel
|
|
||||||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
|
||||||
|
|
||||||
class AudioContentMainViewModel(
|
|
||||||
private val repository: AudioContentRepository
|
|
||||||
) : BaseViewModel() {
|
|
||||||
private val _toastLiveData = MutableLiveData<String?>()
|
|
||||||
val toastLiveData: LiveData<String?>
|
|
||||||
get() = _toastLiveData
|
|
||||||
|
|
||||||
private var _isLoading = MutableLiveData(false)
|
|
||||||
val isLoading: LiveData<Boolean>
|
|
||||||
get() = _isLoading
|
|
||||||
|
|
||||||
private var _newContentUploadCreatorListLiveData =
|
|
||||||
MutableLiveData<List<GetNewContentUploadCreator>>()
|
|
||||||
val newContentUploadCreatorListLiveData: LiveData<List<GetNewContentUploadCreator>>
|
|
||||||
get() = _newContentUploadCreatorListLiveData
|
|
||||||
|
|
||||||
private var _newContentListLiveData = MutableLiveData<List<GetAudioContentMainItem>>()
|
|
||||||
val newContentListLiveData: LiveData<List<GetAudioContentMainItem>>
|
|
||||||
get() = _newContentListLiveData
|
|
||||||
|
|
||||||
private var _bannerLiveData = MutableLiveData<List<GetAudioContentBannerResponse>>()
|
|
||||||
val bannerLiveData: LiveData<List<GetAudioContentBannerResponse>>
|
|
||||||
get() = _bannerLiveData
|
|
||||||
|
|
||||||
private var _orderListLiveData = MutableLiveData<List<GetAudioContentMainItem>>()
|
|
||||||
val orderListLiveData: LiveData<List<GetAudioContentMainItem>>
|
|
||||||
get() = _orderListLiveData
|
|
||||||
|
|
||||||
private var _themeListLiveData = MutableLiveData<List<String>>()
|
|
||||||
val themeListLiveData: LiveData<List<String>>
|
|
||||||
get() = _themeListLiveData
|
|
||||||
|
|
||||||
private var _curationListLiveData = MutableLiveData<List<GetAudioContentCurationResponse>>()
|
|
||||||
val curationListLiveData: LiveData<List<GetAudioContentCurationResponse>>
|
|
||||||
get() = _curationListLiveData
|
|
||||||
|
|
||||||
private var _contentRankingSortListLiveData = MutableLiveData<List<String>>()
|
|
||||||
val contentRankingSortListLiveData: LiveData<List<String>>
|
|
||||||
get() = _contentRankingSortListLiveData
|
|
||||||
|
|
||||||
private var _contentRankingLiveData = MutableLiveData<GetAudioContentRanking>()
|
|
||||||
val contentRankingLiveData: LiveData<GetAudioContentRanking>
|
|
||||||
get() = _contentRankingLiveData
|
|
||||||
|
|
||||||
fun getMain() {
|
|
||||||
_isLoading.value = true
|
|
||||||
compositeDisposable.add(
|
|
||||||
repository.getMain(token = "Bearer ${SharedPreferenceManager.token}")
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(
|
|
||||||
{
|
|
||||||
if (it.success && it.data != null) {
|
|
||||||
val data = it.data
|
|
||||||
_newContentUploadCreatorListLiveData.value =
|
|
||||||
data.newContentUploadCreatorList
|
|
||||||
_newContentListLiveData.value = data.newContentList
|
|
||||||
_orderListLiveData.value = data.orderList
|
|
||||||
_bannerLiveData.value = data.bannerList
|
|
||||||
_curationListLiveData.value = data.curationList
|
|
||||||
_contentRankingLiveData.value = data.contentRanking
|
|
||||||
_contentRankingSortListLiveData.value = data.contentRankingSortTypeList
|
|
||||||
|
|
||||||
val themeList = listOf("전체").union(data.themeList).toList()
|
|
||||||
_themeListLiveData.value = themeList
|
|
||||||
} else {
|
|
||||||
if (it.message != null) {
|
|
||||||
_toastLiveData.postValue(it.message)
|
|
||||||
} else {
|
|
||||||
_toastLiveData.postValue(
|
|
||||||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_isLoading.value = false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
_isLoading.value = false
|
|
||||||
it.message?.let { message -> Logger.e(message) }
|
|
||||||
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getNewContentOfTheme(theme: String) {
|
|
||||||
compositeDisposable.add(
|
|
||||||
repository.getNewContentOfTheme(
|
|
||||||
theme = if (theme == "전체") {
|
|
||||||
""
|
|
||||||
} else {
|
|
||||||
theme
|
|
||||||
},
|
|
||||||
token = "Bearer ${SharedPreferenceManager.token}"
|
|
||||||
)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(
|
|
||||||
{
|
|
||||||
if (it.success && it.data != null) {
|
|
||||||
_newContentListLiveData.value = it.data!!
|
|
||||||
} else {
|
|
||||||
if (it.message != null) {
|
|
||||||
_toastLiveData.postValue(it.message)
|
|
||||||
} else {
|
|
||||||
_toastLiveData.postValue(
|
|
||||||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
it.message?.let { message -> Logger.e(message) }
|
|
||||||
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getContentRanking(sort: String) {
|
|
||||||
_isLoading.value = true
|
|
||||||
compositeDisposable.add(
|
|
||||||
repository.getContentRanking(
|
|
||||||
page = 1,
|
|
||||||
size = 12,
|
|
||||||
sortType = sort,
|
|
||||||
token = "Bearer ${SharedPreferenceManager.token}"
|
|
||||||
)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(
|
|
||||||
{
|
|
||||||
if (it.success && it.data != null) {
|
|
||||||
_isLoading.value = false
|
|
||||||
_contentRankingLiveData.value = it.data!!
|
|
||||||
} else {
|
|
||||||
_isLoading.value = false
|
|
||||||
if (it.message != null) {
|
|
||||||
_toastLiveData.postValue(it.message)
|
|
||||||
} else {
|
|
||||||
_toastLiveData.postValue(
|
|
||||||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
it.message?.let { message -> Logger.e(message) }
|
|
||||||
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,18 +3,6 @@ package kr.co.vividnext.sodalive.audio_content.main
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import kr.co.vividnext.sodalive.settings.event.EventItem
|
import kr.co.vividnext.sodalive.settings.event.EventItem
|
||||||
|
|
||||||
data class GetAudioContentMainResponse(
|
|
||||||
@SerializedName("newContentUploadCreatorList")
|
|
||||||
val newContentUploadCreatorList: List<GetNewContentUploadCreator>,
|
|
||||||
@SerializedName("bannerList") val bannerList: List<GetAudioContentBannerResponse>,
|
|
||||||
@SerializedName("orderList") val orderList: List<GetAudioContentMainItem>,
|
|
||||||
@SerializedName("themeList") val themeList: List<String>,
|
|
||||||
@SerializedName("newContentList") val newContentList: List<GetAudioContentMainItem>,
|
|
||||||
@SerializedName("curationList") val curationList: List<GetAudioContentCurationResponse>,
|
|
||||||
@SerializedName("contentRankingSortTypeList") val contentRankingSortTypeList: List<String>,
|
|
||||||
@SerializedName("contentRanking") val contentRanking: GetAudioContentRanking
|
|
||||||
)
|
|
||||||
|
|
||||||
data class GetNewContentUploadCreator(
|
data class GetNewContentUploadCreator(
|
||||||
@SerializedName("creatorId") val creatorId: Long,
|
@SerializedName("creatorId") val creatorId: Long,
|
||||||
@SerializedName("creatorNickname") val creatorNickname: String,
|
@SerializedName("creatorNickname") val creatorNickname: String,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package kr.co.vividnext.sodalive.audio_content.main
|
package kr.co.vividnext.sodalive.audio_content.main.banner
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
|
@ -11,6 +11,7 @@ import com.bumptech.glide.request.transition.Transition
|
||||||
import com.zhpan.bannerview.BaseBannerAdapter
|
import com.zhpan.bannerview.BaseBannerAdapter
|
||||||
import com.zhpan.bannerview.BaseViewHolder
|
import com.zhpan.bannerview.BaseViewHolder
|
||||||
import kr.co.vividnext.sodalive.R
|
import kr.co.vividnext.sodalive.R
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentBannerResponse
|
||||||
|
|
||||||
class AudioContentMainBannerAdapter(
|
class AudioContentMainBannerAdapter(
|
||||||
private val context: Context,
|
private val context: Context,
|
|
@ -0,0 +1,54 @@
|
||||||
|
package kr.co.vividnext.sodalive.audio_content.main.banner
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.orhanobut.logger.Logger
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.AudioContentRepository
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentBannerResponse
|
||||||
|
import kr.co.vividnext.sodalive.base.BaseViewModel
|
||||||
|
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||||
|
|
||||||
|
class AudioContentMainBannerViewModel(
|
||||||
|
private val repository: AudioContentRepository
|
||||||
|
) : BaseViewModel() {
|
||||||
|
private val _toastLiveData = MutableLiveData<String?>()
|
||||||
|
val toastLiveData: LiveData<String?>
|
||||||
|
get() = _toastLiveData
|
||||||
|
|
||||||
|
private var _bannerLiveData = MutableLiveData<List<GetAudioContentBannerResponse>>()
|
||||||
|
val bannerLiveData: LiveData<List<GetAudioContentBannerResponse>>
|
||||||
|
get() = _bannerLiveData
|
||||||
|
|
||||||
|
fun getMainBannerList() {
|
||||||
|
compositeDisposable.add(
|
||||||
|
repository.getMainBannerList(token = "Bearer ${SharedPreferenceManager.token}")
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
{
|
||||||
|
if (it.success && it.data != null) {
|
||||||
|
_bannerLiveData.postValue(it.data!!)
|
||||||
|
} else {
|
||||||
|
if (it.message != null) {
|
||||||
|
_toastLiveData.postValue(it.message)
|
||||||
|
} else {
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
"배너를 불러오지 못했습니다. 다시 시도해 주세요.\n" +
|
||||||
|
"계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
it.message?.let { message -> Logger.e(message) }
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
"배너를 불러오지 못했습니다. 다시 시도해 주세요.\n" +
|
||||||
|
"계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package kr.co.vividnext.sodalive.audio_content.main
|
package kr.co.vividnext.sodalive.audio_content.main.curation
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
@ -8,6 +8,9 @@ import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.AudioContentMainContentAdapter
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentCurationResponse
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentMainItem
|
||||||
import kr.co.vividnext.sodalive.databinding.ItemAudioContentMainCurationBinding
|
import kr.co.vividnext.sodalive.databinding.ItemAudioContentMainCurationBinding
|
||||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||||
|
|
||||||
|
@ -89,8 +92,11 @@ class AudioContentMainCurationAdapter(
|
||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
fun addItems(items: List<GetAudioContentCurationResponse>) {
|
fun addItems(items: List<GetAudioContentCurationResponse>) {
|
||||||
this.items.clear()
|
|
||||||
this.items.addAll(items)
|
this.items.addAll(items)
|
||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun clear() {
|
||||||
|
this.items.clear()
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,85 @@
|
||||||
|
package kr.co.vividnext.sodalive.audio_content.main.curation
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.orhanobut.logger.Logger
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.AudioContentRepository
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentCurationResponse
|
||||||
|
import kr.co.vividnext.sodalive.base.BaseViewModel
|
||||||
|
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||||
|
|
||||||
|
class AudioContentMainCurationViewModel(
|
||||||
|
private val repository: AudioContentRepository
|
||||||
|
) : BaseViewModel() {
|
||||||
|
private val _toastLiveData = MutableLiveData<String?>()
|
||||||
|
val toastLiveData: LiveData<String?>
|
||||||
|
get() = _toastLiveData
|
||||||
|
|
||||||
|
private var _isLoading = MutableLiveData(false)
|
||||||
|
val isLoading: LiveData<Boolean>
|
||||||
|
get() = _isLoading
|
||||||
|
|
||||||
|
private var _curationListLiveData = MutableLiveData<List<GetAudioContentCurationResponse>>()
|
||||||
|
val curationListLiveData: LiveData<List<GetAudioContentCurationResponse>>
|
||||||
|
get() = _curationListLiveData
|
||||||
|
|
||||||
|
var page = 1
|
||||||
|
var isLast = false
|
||||||
|
private val pageSize = 10
|
||||||
|
|
||||||
|
fun getCurationList() {
|
||||||
|
if (!_isLoading.value!! && !isLast) {
|
||||||
|
_isLoading.value = true
|
||||||
|
compositeDisposable.add(
|
||||||
|
repository.getCurationList(
|
||||||
|
page = page,
|
||||||
|
size = pageSize,
|
||||||
|
token = "Bearer ${SharedPreferenceManager.token}"
|
||||||
|
)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
{
|
||||||
|
if (it.success && it.data != null) {
|
||||||
|
page += 1
|
||||||
|
|
||||||
|
if (it.data.isNotEmpty()) {
|
||||||
|
_curationListLiveData.postValue(it.data!!)
|
||||||
|
} else {
|
||||||
|
_curationListLiveData.postValue(listOf())
|
||||||
|
isLast = true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (it.message != null) {
|
||||||
|
_toastLiveData.postValue(it.message)
|
||||||
|
} else {
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
"큐레이션을 불러오지 못했습니다. 다시 시도해 주세요.\n" +
|
||||||
|
"계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_isLoading.value = false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
_isLoading.value = false
|
||||||
|
it.message?.let { message -> Logger.e(message) }
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
"큐레이션을 불러오지 못했습니다. 다시 시도해 주세요.\n" +
|
||||||
|
"계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun refresh() {
|
||||||
|
page = 1
|
||||||
|
isLast = false
|
||||||
|
getCurationList()
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package kr.co.vividnext.sodalive.audio_content.main
|
package kr.co.vividnext.sodalive.audio_content.main.new_content
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
|
@ -0,0 +1,96 @@
|
||||||
|
package kr.co.vividnext.sodalive.audio_content.main.new_content
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.orhanobut.logger.Logger
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.AudioContentRepository
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentMainItem
|
||||||
|
import kr.co.vividnext.sodalive.base.BaseViewModel
|
||||||
|
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||||
|
|
||||||
|
class AudioContentMainNewContentViewModel(
|
||||||
|
private val repository: AudioContentRepository
|
||||||
|
) : BaseViewModel() {
|
||||||
|
private val _toastLiveData = MutableLiveData<String?>()
|
||||||
|
val toastLiveData: LiveData<String?>
|
||||||
|
get() = _toastLiveData
|
||||||
|
|
||||||
|
private var _isLoading = MutableLiveData(false)
|
||||||
|
val isLoading: LiveData<Boolean>
|
||||||
|
get() = _isLoading
|
||||||
|
|
||||||
|
private var _newContentListLiveData = MutableLiveData<List<GetAudioContentMainItem>>()
|
||||||
|
val newContentListLiveData: LiveData<List<GetAudioContentMainItem>>
|
||||||
|
get() = _newContentListLiveData
|
||||||
|
|
||||||
|
private var _themeListLiveData = MutableLiveData<List<String>>()
|
||||||
|
val themeListLiveData: LiveData<List<String>>
|
||||||
|
get() = _themeListLiveData
|
||||||
|
|
||||||
|
fun getThemeList() {
|
||||||
|
compositeDisposable.add(
|
||||||
|
repository.getNewContentThemeList(token = "Bearer ${SharedPreferenceManager.token}")
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
{
|
||||||
|
if (it.success && it.data != null) {
|
||||||
|
val themeList = listOf("전체").union(it.data).toList()
|
||||||
|
_themeListLiveData.postValue(themeList)
|
||||||
|
} else {
|
||||||
|
if (it.message != null) {
|
||||||
|
_toastLiveData.postValue(it.message)
|
||||||
|
} else {
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_isLoading.value = false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
_isLoading.value = false
|
||||||
|
it.message?.let { message -> Logger.e(message) }
|
||||||
|
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getNewContentOfTheme(theme: String) {
|
||||||
|
compositeDisposable.add(
|
||||||
|
repository.getNewContentOfTheme(
|
||||||
|
theme = if (theme == "전체") {
|
||||||
|
""
|
||||||
|
} else {
|
||||||
|
theme
|
||||||
|
},
|
||||||
|
token = "Bearer ${SharedPreferenceManager.token}"
|
||||||
|
)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
{
|
||||||
|
if (it.success && it.data != null) {
|
||||||
|
_newContentListLiveData.value = it.data!!
|
||||||
|
} else {
|
||||||
|
if (it.message != null) {
|
||||||
|
_toastLiveData.postValue(it.message)
|
||||||
|
} else {
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
it.message?.let { message -> Logger.e(message) }
|
||||||
|
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package kr.co.vividnext.sodalive.audio_content.main
|
package kr.co.vividnext.sodalive.audio_content.main.new_content_upload_creator
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
@ -7,6 +7,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import coil.load
|
import coil.load
|
||||||
import coil.transform.CircleCropTransformation
|
import coil.transform.CircleCropTransformation
|
||||||
import kr.co.vividnext.sodalive.R
|
import kr.co.vividnext.sodalive.R
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.GetNewContentUploadCreator
|
||||||
import kr.co.vividnext.sodalive.databinding.ItemAudioContentMainNewContentCreatorBinding
|
import kr.co.vividnext.sodalive.databinding.ItemAudioContentMainNewContentCreatorBinding
|
||||||
|
|
||||||
class AudioContentMainNewContentCreatorAdapter(
|
class AudioContentMainNewContentCreatorAdapter(
|
|
@ -0,0 +1,57 @@
|
||||||
|
package kr.co.vividnext.sodalive.audio_content.main.new_content_upload_creator
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.orhanobut.logger.Logger
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.AudioContentRepository
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.GetNewContentUploadCreator
|
||||||
|
import kr.co.vividnext.sodalive.base.BaseViewModel
|
||||||
|
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||||
|
|
||||||
|
class AudioContentMainNewContentCreatorViewModel(
|
||||||
|
private val repository: AudioContentRepository
|
||||||
|
) : BaseViewModel() {
|
||||||
|
private val _toastLiveData = MutableLiveData<String?>()
|
||||||
|
val toastLiveData: LiveData<String?>
|
||||||
|
get() = _toastLiveData
|
||||||
|
|
||||||
|
private var _newContentUploadCreatorListLiveData =
|
||||||
|
MutableLiveData<List<GetNewContentUploadCreator>>()
|
||||||
|
val newContentUploadCreatorListLiveData: LiveData<List<GetNewContentUploadCreator>>
|
||||||
|
get() = _newContentUploadCreatorListLiveData
|
||||||
|
|
||||||
|
fun getNewContentUploadCreatorList() {
|
||||||
|
compositeDisposable.add(
|
||||||
|
repository.getNewContentUploadCreatorList(
|
||||||
|
token = "Bearer ${SharedPreferenceManager.token}"
|
||||||
|
)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
{
|
||||||
|
if (it.success && it.data != null) {
|
||||||
|
_newContentUploadCreatorListLiveData.postValue(it.data!!)
|
||||||
|
} else {
|
||||||
|
if (it.message != null) {
|
||||||
|
_toastLiveData.postValue(it.message)
|
||||||
|
} else {
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
"크리에이터 리스트를 불러오지 못했습니다. 다시 시도해 주세요.\n" +
|
||||||
|
"계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
it.message?.let { message -> Logger.e(message) }
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
"크리에이터 리스트를 불러오지 못했습니다. 다시 시도해 주세요.\n" +
|
||||||
|
"계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
package kr.co.vividnext.sodalive.audio_content.main.order
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.orhanobut.logger.Logger
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.AudioContentRepository
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentMainItem
|
||||||
|
import kr.co.vividnext.sodalive.base.BaseViewModel
|
||||||
|
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||||
|
|
||||||
|
class AudioContentMainOrderListViewModel(
|
||||||
|
private val repository: AudioContentRepository
|
||||||
|
) : BaseViewModel() {
|
||||||
|
private val _toastLiveData = MutableLiveData<String?>()
|
||||||
|
val toastLiveData: LiveData<String?>
|
||||||
|
get() = _toastLiveData
|
||||||
|
|
||||||
|
private var _orderListLiveData = MutableLiveData<List<GetAudioContentMainItem>>()
|
||||||
|
val orderListLiveData: LiveData<List<GetAudioContentMainItem>>
|
||||||
|
get() = _orderListLiveData
|
||||||
|
|
||||||
|
fun getOrderList() {
|
||||||
|
compositeDisposable.add(
|
||||||
|
repository.getMainOrderList(token = "Bearer ${SharedPreferenceManager.token}")
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
{
|
||||||
|
if (it.success && it.data != null) {
|
||||||
|
_orderListLiveData.postValue(it.data!!)
|
||||||
|
} else {
|
||||||
|
if (it.message != null) {
|
||||||
|
_toastLiveData.postValue(it.message)
|
||||||
|
} else {
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
"주문정보를 불러오지 못했습니다. 다시 시도해 주세요.\n" +
|
||||||
|
"계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
it.message?.let { message -> Logger.e(message) }
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
"주문정보를 불러오지 못했습니다. 다시 시도해 주세요.\n" +
|
||||||
|
"계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package kr.co.vividnext.sodalive.audio_content.main
|
package kr.co.vividnext.sodalive.audio_content.main.ranking
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
@ -7,6 +7,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import coil.load
|
import coil.load
|
||||||
import coil.transform.RoundedCornersTransformation
|
import coil.transform.RoundedCornersTransformation
|
||||||
import kr.co.vividnext.sodalive.R
|
import kr.co.vividnext.sodalive.R
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentRankingItem
|
||||||
import kr.co.vividnext.sodalive.databinding.ItemAudioContentMainRankingBinding
|
import kr.co.vividnext.sodalive.databinding.ItemAudioContentMainRankingBinding
|
||||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||||
|
|
|
@ -0,0 +1,86 @@
|
||||||
|
package kr.co.vividnext.sodalive.audio_content.main.ranking
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.orhanobut.logger.Logger
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.AudioContentRepository
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentRanking
|
||||||
|
import kr.co.vividnext.sodalive.base.BaseViewModel
|
||||||
|
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||||
|
|
||||||
|
class AudioContentMainRankingViewModel(
|
||||||
|
private val repository: AudioContentRepository
|
||||||
|
) : BaseViewModel() {
|
||||||
|
private val _toastLiveData = MutableLiveData<String?>()
|
||||||
|
val toastLiveData: LiveData<String?>
|
||||||
|
get() = _toastLiveData
|
||||||
|
|
||||||
|
private var _contentRankingSortListLiveData = MutableLiveData<List<String>>()
|
||||||
|
val contentRankingSortListLiveData: LiveData<List<String>>
|
||||||
|
get() = _contentRankingSortListLiveData
|
||||||
|
|
||||||
|
private var _contentRankingLiveData = MutableLiveData<GetAudioContentRanking>()
|
||||||
|
val contentRankingLiveData: LiveData<GetAudioContentRanking>
|
||||||
|
get() = _contentRankingLiveData
|
||||||
|
|
||||||
|
fun getContentRankingSortType() {
|
||||||
|
compositeDisposable.add(
|
||||||
|
repository.getContentRankingSortType(token = "Bearer ${SharedPreferenceManager.token}")
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
{
|
||||||
|
if (it.success && it.data != null) {
|
||||||
|
_contentRankingSortListLiveData.value = it.data!!
|
||||||
|
} else {
|
||||||
|
if (it.message != null) {
|
||||||
|
_toastLiveData.postValue(it.message)
|
||||||
|
} else {
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
it.message?.let { message -> Logger.e(message) }
|
||||||
|
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getContentRanking(sort: String = "매출") {
|
||||||
|
compositeDisposable.add(
|
||||||
|
repository.getContentRanking(
|
||||||
|
page = 1,
|
||||||
|
size = 12,
|
||||||
|
sortType = sort,
|
||||||
|
token = "Bearer ${SharedPreferenceManager.token}"
|
||||||
|
)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
{
|
||||||
|
if (it.success && it.data != null) {
|
||||||
|
_contentRankingLiveData.value = it.data!!
|
||||||
|
} else {
|
||||||
|
if (it.message != null) {
|
||||||
|
_toastLiveData.postValue(it.message)
|
||||||
|
} else {
|
||||||
|
_toastLiveData.postValue(
|
||||||
|
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
it.message?.let { message -> Logger.e(message) }
|
||||||
|
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,7 +14,12 @@ import kr.co.vividnext.sodalive.audio_content.comment.AudioContentCommentReplyVi
|
||||||
import kr.co.vividnext.sodalive.audio_content.comment.AudioContentCommentRepository
|
import kr.co.vividnext.sodalive.audio_content.comment.AudioContentCommentRepository
|
||||||
import kr.co.vividnext.sodalive.audio_content.curation.AudioContentCurationViewModel
|
import kr.co.vividnext.sodalive.audio_content.curation.AudioContentCurationViewModel
|
||||||
import kr.co.vividnext.sodalive.audio_content.detail.AudioContentDetailViewModel
|
import kr.co.vividnext.sodalive.audio_content.detail.AudioContentDetailViewModel
|
||||||
import kr.co.vividnext.sodalive.audio_content.main.AudioContentMainViewModel
|
import kr.co.vividnext.sodalive.audio_content.main.banner.AudioContentMainBannerViewModel
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.curation.AudioContentMainCurationViewModel
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.new_content.AudioContentMainNewContentViewModel
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.new_content_upload_creator.AudioContentMainNewContentCreatorViewModel
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.order.AudioContentMainOrderListViewModel
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.main.ranking.AudioContentMainRankingViewModel
|
||||||
import kr.co.vividnext.sodalive.audio_content.modify.AudioContentModifyViewModel
|
import kr.co.vividnext.sodalive.audio_content.modify.AudioContentModifyViewModel
|
||||||
import kr.co.vividnext.sodalive.audio_content.order.AudioContentOrderListViewModel
|
import kr.co.vividnext.sodalive.audio_content.order.AudioContentOrderListViewModel
|
||||||
import kr.co.vividnext.sodalive.audio_content.upload.AudioContentUploadViewModel
|
import kr.co.vividnext.sodalive.audio_content.upload.AudioContentUploadViewModel
|
||||||
|
@ -183,7 +188,12 @@ class AppDI(private val context: Context, isDebugMode: Boolean) {
|
||||||
viewModel { SettingsViewModel(get()) }
|
viewModel { SettingsViewModel(get()) }
|
||||||
viewModel { TextMessageDetailViewModel(get()) }
|
viewModel { TextMessageDetailViewModel(get()) }
|
||||||
viewModel { LiveReservationStatusViewModel(get()) }
|
viewModel { LiveReservationStatusViewModel(get()) }
|
||||||
viewModel { AudioContentMainViewModel(get()) }
|
viewModel { AudioContentMainBannerViewModel(get()) }
|
||||||
|
viewModel { AudioContentMainRankingViewModel(get()) }
|
||||||
|
viewModel { AudioContentMainCurationViewModel(get()) }
|
||||||
|
viewModel { AudioContentMainOrderListViewModel(get()) }
|
||||||
|
viewModel { AudioContentMainNewContentViewModel(get()) }
|
||||||
|
viewModel { AudioContentMainNewContentCreatorViewModel(get()) }
|
||||||
viewModel { AudioContentViewModel(get()) }
|
viewModel { AudioContentViewModel(get()) }
|
||||||
viewModel { AudioContentOrderListViewModel(get()) }
|
viewModel { AudioContentOrderListViewModel(get()) }
|
||||||
viewModel { AudioContentUploadViewModel(get()) }
|
viewModel { AudioContentUploadViewModel(get()) }
|
||||||
|
|
|
@ -43,8 +43,7 @@
|
||||||
android:id="@+id/rv_banner"
|
android:id="@+id/rv_banner"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="13.3dp"
|
android:layout_marginHorizontal="13.3dp" />
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<com.zhpan.indicator.IndicatorView
|
<com.zhpan.indicator.IndicatorView
|
||||||
android:id="@+id/indicator_banner"
|
android:id="@+id/indicator_banner"
|
||||||
|
@ -143,6 +142,12 @@
|
||||||
android:paddingHorizontal="13.3dp" />
|
android:paddingHorizontal="13.3dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/pb_new_content"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_gravity="center" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_content_ranking"
|
android:id="@+id/ll_content_ranking"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -222,8 +227,13 @@
|
||||||
android:id="@+id/rv_curation"
|
android:id="@+id/rv_curation"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false" />
|
||||||
android:visibility="gone" />
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/pb_curation"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_gravity="center" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
Loading…
Reference in New Issue