Compare commits
5 Commits
b68b4eb8da
...
7e32727773
Author | SHA1 | Date |
---|---|---|
|
7e32727773 | |
|
1a3396b293 | |
|
d883a81602 | |
|
81bdd52edd | |
|
63483a2099 |
|
@ -40,8 +40,8 @@ android {
|
||||||
applicationId "kr.co.vividnext.sodalive"
|
applicationId "kr.co.vividnext.sodalive"
|
||||||
minSdk 23
|
minSdk 23
|
||||||
targetSdk 33
|
targetSdk 33
|
||||||
versionCode 9
|
versionCode 10
|
||||||
versionName "1.0.8"
|
versionName "1.1.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|
|
@ -170,10 +170,16 @@ interface AudioContentApi {
|
||||||
@Header("Authorization") authHeader: String
|
@Header("Authorization") authHeader: String
|
||||||
): Single<ApiResponse<List<String>>>
|
): Single<ApiResponse<List<String>>>
|
||||||
|
|
||||||
|
@GET("/audio-content/ranking-sort-type")
|
||||||
|
fun getContentRankingSortType(
|
||||||
|
@Header("Authorization") authHeader: String
|
||||||
|
): Single<ApiResponse<List<String>>>
|
||||||
|
|
||||||
@GET("/audio-content/ranking")
|
@GET("/audio-content/ranking")
|
||||||
fun getContentRanking(
|
fun getContentRanking(
|
||||||
@Query("page") page: Int,
|
@Query("page") page: Int,
|
||||||
@Query("size") size: Int,
|
@Query("size") size: Int,
|
||||||
|
@Query("sort-type") sortType: String,
|
||||||
@Header("Authorization") authHeader: String
|
@Header("Authorization") authHeader: String
|
||||||
): Single<ApiResponse<GetAudioContentRanking>>
|
): Single<ApiResponse<GetAudioContentRanking>>
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,13 +164,17 @@ class AudioContentRepository(
|
||||||
authHeader = token
|
authHeader = token
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fun getContentRankingSortType(token: String) = api.getContentRankingSortType(authHeader = token)
|
||||||
|
|
||||||
fun getContentRanking(
|
fun getContentRanking(
|
||||||
page: Int,
|
page: Int,
|
||||||
size: Int,
|
size: Int,
|
||||||
|
sortType: String = "매출",
|
||||||
token: String
|
token: String
|
||||||
) = api.getContentRanking(
|
) = api.getContentRanking(
|
||||||
page = page - 1,
|
page = page - 1,
|
||||||
size = size,
|
size = size,
|
||||||
|
sortType = sortType,
|
||||||
authHeader = token
|
authHeader = token
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +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.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
|
||||||
|
@ -23,11 +24,13 @@ class AudioContentRankingAllActivity : BaseActivity<ActivityAudioContentRankingA
|
||||||
|
|
||||||
private lateinit var loadingDialog: LoadingDialog
|
private lateinit var loadingDialog: LoadingDialog
|
||||||
private lateinit var adapter: AudioContentRankingAllAdapter
|
private lateinit var adapter: AudioContentRankingAllAdapter
|
||||||
|
private lateinit var sortAdapter: AudioContentMainNewContentThemeAdapter
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
bindData()
|
bindData()
|
||||||
|
viewModel.getAudioContentRankingSortType()
|
||||||
viewModel.getAudioContentRanking()
|
viewModel.getAudioContentRanking()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,6 +102,53 @@ class AudioContentRankingAllActivity : BaseActivity<ActivityAudioContentRankingA
|
||||||
})
|
})
|
||||||
|
|
||||||
binding.rvContentRanking.adapter = adapter
|
binding.rvContentRanking.adapter = adapter
|
||||||
|
|
||||||
|
setupContentRankingSortType()
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
private fun setupContentRankingSortType() {
|
||||||
|
sortAdapter = AudioContentMainNewContentThemeAdapter {
|
||||||
|
adapter.items.clear()
|
||||||
|
adapter.notifyDataSetChanged()
|
||||||
|
viewModel.selectSort(sort = it)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.rvContentRankingSort.layoutManager = LinearLayoutManager(
|
||||||
|
this,
|
||||||
|
LinearLayoutManager.HORIZONTAL,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
|
||||||
|
binding.rvContentRankingSort.addItemDecoration(object : RecyclerView.ItemDecoration() {
|
||||||
|
override fun getItemOffsets(
|
||||||
|
outRect: Rect,
|
||||||
|
view: View,
|
||||||
|
parent: RecyclerView,
|
||||||
|
state: RecyclerView.State
|
||||||
|
) {
|
||||||
|
super.getItemOffsets(outRect, view, parent, state)
|
||||||
|
|
||||||
|
when (parent.getChildAdapterPosition(view)) {
|
||||||
|
0 -> {
|
||||||
|
outRect.left = 0
|
||||||
|
outRect.right = 4f.dpToPx().toInt()
|
||||||
|
}
|
||||||
|
|
||||||
|
sortAdapter.itemCount - 1 -> {
|
||||||
|
outRect.left = 4f.dpToPx().toInt()
|
||||||
|
outRect.right = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
outRect.left = 4f.dpToPx().toInt()
|
||||||
|
outRect.right = 4f.dpToPx().toInt()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
binding.rvContentRankingSort.adapter = sortAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
@ -120,12 +170,16 @@ class AudioContentRankingAllActivity : BaseActivity<ActivityAudioContentRankingA
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel.contentRankingItemsLiveData.observe(this) {
|
viewModel.contentRankingItemsLiveData.observe(this) {
|
||||||
if (viewModel.page == 0) {
|
if (viewModel.page == 2) {
|
||||||
adapter.items.clear()
|
adapter.items.clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter.items.addAll(it)
|
adapter.items.addAll(it)
|
||||||
adapter.notifyDataSetChanged()
|
adapter.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel.contentRankingSortListLiveData.observe(this) {
|
||||||
|
sortAdapter.addItems(it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,10 @@ class AudioContentRankingAllViewModel(
|
||||||
val dateStringLiveData: LiveData<String>
|
val dateStringLiveData: LiveData<String>
|
||||||
get() = _dateStringLiveData
|
get() = _dateStringLiveData
|
||||||
|
|
||||||
|
private var _contentRankingSortListLiveData = MutableLiveData<List<String>>()
|
||||||
|
val contentRankingSortListLiveData: LiveData<List<String>>
|
||||||
|
get() = _contentRankingSortListLiveData
|
||||||
|
|
||||||
private var _contentRankingItemsLiveData = MutableLiveData<List<GetAudioContentRankingItem>>()
|
private var _contentRankingItemsLiveData = MutableLiveData<List<GetAudioContentRankingItem>>()
|
||||||
val contentRankingItemsLiveData: LiveData<List<GetAudioContentRankingItem>>
|
val contentRankingItemsLiveData: LiveData<List<GetAudioContentRankingItem>>
|
||||||
get() = _contentRankingItemsLiveData
|
get() = _contentRankingItemsLiveData
|
||||||
|
@ -33,6 +37,8 @@ class AudioContentRankingAllViewModel(
|
||||||
private var pageSize = 10
|
private var pageSize = 10
|
||||||
private var isLast = false
|
private var isLast = false
|
||||||
|
|
||||||
|
private var selectedSort = "매출"
|
||||||
|
|
||||||
fun getAudioContentRanking() {
|
fun getAudioContentRanking() {
|
||||||
if (!_isLoading.value!! && !isLast && page <= 5) {
|
if (!_isLoading.value!! && !isLast && page <= 5) {
|
||||||
_isLoading.value = true
|
_isLoading.value = true
|
||||||
|
@ -40,6 +46,7 @@ class AudioContentRankingAllViewModel(
|
||||||
repository.getContentRanking(
|
repository.getContentRanking(
|
||||||
page = page,
|
page = page,
|
||||||
size = pageSize,
|
size = pageSize,
|
||||||
|
sortType = selectedSort,
|
||||||
token = "Bearer ${SharedPreferenceManager.token}"
|
token = "Bearer ${SharedPreferenceManager.token}"
|
||||||
)
|
)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
|
@ -56,7 +63,6 @@ class AudioContentRankingAllViewModel(
|
||||||
_contentRankingItemsLiveData.value = it.data.items
|
_contentRankingItemsLiveData.value = it.data.items
|
||||||
} else {
|
} else {
|
||||||
isLast = true
|
isLast = true
|
||||||
_contentRankingItemsLiveData.value = listOf()
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_isLoading.value = false
|
_isLoading.value = false
|
||||||
|
@ -77,4 +83,38 @@ class AudioContentRankingAllViewModel(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getAudioContentRankingSortType() {
|
||||||
|
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 selectSort(sort: String) {
|
||||||
|
page = 1
|
||||||
|
isLast = false
|
||||||
|
selectedSort = sort
|
||||||
|
getAudioContentRanking()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ import kr.co.vividnext.sodalive.live.room.donation.LiveRoomDonationDialog
|
||||||
import kr.co.vividnext.sodalive.mypage.auth.Auth
|
import kr.co.vividnext.sodalive.mypage.auth.Auth
|
||||||
import kr.co.vividnext.sodalive.mypage.auth.AuthVerifyRequest
|
import kr.co.vividnext.sodalive.mypage.auth.AuthVerifyRequest
|
||||||
import kr.co.vividnext.sodalive.mypage.auth.BootpayResponse
|
import kr.co.vividnext.sodalive.mypage.auth.BootpayResponse
|
||||||
|
import kr.co.vividnext.sodalive.mypage.can.charge.CanChargeActivity
|
||||||
import kr.co.vividnext.sodalive.report.ReportType
|
import kr.co.vividnext.sodalive.report.ReportType
|
||||||
import org.koin.android.ext.android.inject
|
import org.koin.android.ext.android.inject
|
||||||
|
|
||||||
|
@ -737,7 +738,11 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
||||||
viewModel.order(
|
viewModel.order(
|
||||||
contentId = audioContent.contentId,
|
contentId = audioContent.contentId,
|
||||||
orderType = orderType
|
orderType = orderType
|
||||||
)
|
) {
|
||||||
|
val intent = Intent(applicationContext, CanChargeActivity::class.java)
|
||||||
|
intent.putExtra(Constants.EXTRA_GO_TO_PREV_PAGE, true)
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
).show(screenWidth)
|
).show(screenWidth)
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,7 @@ class AudioContentDetailViewModel(
|
||||||
_isShowPreviewAlert.value = !_isShowPreviewAlert.value!!
|
_isShowPreviewAlert.value = !_isShowPreviewAlert.value!!
|
||||||
}
|
}
|
||||||
|
|
||||||
fun order(contentId: Long, orderType: OrderType) {
|
fun order(contentId: Long, orderType: OrderType, gotoShop: () -> Unit) {
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
compositeDisposable.add(
|
compositeDisposable.add(
|
||||||
repository.orderContent(
|
repository.orderContent(
|
||||||
|
@ -200,6 +200,9 @@ class AudioContentDetailViewModel(
|
||||||
} else {
|
} else {
|
||||||
if (it.message != null) {
|
if (it.message != null) {
|
||||||
_toastLiveData.postValue(it.message)
|
_toastLiveData.postValue(it.message)
|
||||||
|
if (it.message.contains("캔이 부족합니다")) {
|
||||||
|
gotoShop()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_toastLiveData.postValue(
|
_toastLiveData.postValue(
|
||||||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||||
|
|
|
@ -50,6 +50,7 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
private lateinit var orderListAdapter: AudioContentMainContentAdapter
|
private lateinit var orderListAdapter: AudioContentMainContentAdapter
|
||||||
private lateinit var newContentThemeAdapter: AudioContentMainNewContentThemeAdapter
|
private lateinit var newContentThemeAdapter: AudioContentMainNewContentThemeAdapter
|
||||||
private lateinit var newContentAdapter: AudioContentMainContentAdapter
|
private lateinit var newContentAdapter: AudioContentMainContentAdapter
|
||||||
|
private lateinit var contentRankingSortAdapter: AudioContentMainNewContentThemeAdapter
|
||||||
private lateinit var contentRankingAdapter: AudioContentMainRankingAdapter
|
private lateinit var contentRankingAdapter: AudioContentMainRankingAdapter
|
||||||
private lateinit var curationAdapter: AudioContentMainCurationAdapter
|
private lateinit var curationAdapter: AudioContentMainCurationAdapter
|
||||||
|
|
||||||
|
@ -87,6 +88,7 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
setupOrderList()
|
setupOrderList()
|
||||||
setupNewContentTheme()
|
setupNewContentTheme()
|
||||||
setupNewContent()
|
setupNewContent()
|
||||||
|
setupContentRankingSortType()
|
||||||
setupContentRanking()
|
setupContentRanking()
|
||||||
setupCuration()
|
setupCuration()
|
||||||
|
|
||||||
|
@ -367,6 +369,48 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
binding.rvNewContent.adapter = newContentAdapter
|
binding.rvNewContent.adapter = newContentAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setupContentRankingSortType() {
|
||||||
|
contentRankingSortAdapter = AudioContentMainNewContentThemeAdapter {
|
||||||
|
viewModel.getContentRanking(sort = it)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.rvContentRankingSort.layoutManager = LinearLayoutManager(
|
||||||
|
context,
|
||||||
|
LinearLayoutManager.HORIZONTAL,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
|
||||||
|
binding.rvContentRankingSort.addItemDecoration(object : RecyclerView.ItemDecoration() {
|
||||||
|
override fun getItemOffsets(
|
||||||
|
outRect: Rect,
|
||||||
|
view: View,
|
||||||
|
parent: RecyclerView,
|
||||||
|
state: RecyclerView.State
|
||||||
|
) {
|
||||||
|
super.getItemOffsets(outRect, view, parent, state)
|
||||||
|
|
||||||
|
when (parent.getChildAdapterPosition(view)) {
|
||||||
|
0 -> {
|
||||||
|
outRect.left = 0
|
||||||
|
outRect.right = 4f.dpToPx().toInt()
|
||||||
|
}
|
||||||
|
|
||||||
|
contentRankingSortAdapter.itemCount - 1 -> {
|
||||||
|
outRect.left = 4f.dpToPx().toInt()
|
||||||
|
outRect.right = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
outRect.left = 4f.dpToPx().toInt()
|
||||||
|
outRect.right = 4f.dpToPx().toInt()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
binding.rvContentRankingSort.adapter = contentRankingSortAdapter
|
||||||
|
}
|
||||||
|
|
||||||
private fun setupContentRanking() {
|
private fun setupContentRanking() {
|
||||||
binding.ivContentRankingAll.setOnClickListener {
|
binding.ivContentRankingAll.setOnClickListener {
|
||||||
startActivity(Intent(requireContext(), AudioContentRankingAllActivity::class.java))
|
startActivity(Intent(requireContext(), AudioContentRankingAllActivity::class.java))
|
||||||
|
@ -537,6 +581,11 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel.contentRankingSortListLiveData.observe(viewLifecycleOwner) {
|
||||||
|
binding.llContentRanking.visibility = View.VISIBLE
|
||||||
|
contentRankingSortAdapter.addItems(it)
|
||||||
|
}
|
||||||
|
|
||||||
viewModel.contentRankingLiveData.observe(viewLifecycleOwner) {
|
viewModel.contentRankingLiveData.observe(viewLifecycleOwner) {
|
||||||
binding.llContentRanking.visibility = View.VISIBLE
|
binding.llContentRanking.visibility = View.VISIBLE
|
||||||
binding.tvDate.text = "${it.startDate}~${it.endDate}"
|
binding.tvDate.text = "${it.startDate}~${it.endDate}"
|
||||||
|
|
|
@ -22,7 +22,11 @@ class AudioContentMainNewContentThemeAdapter(
|
||||||
) : RecyclerView.ViewHolder(binding.root) {
|
) : RecyclerView.ViewHolder(binding.root) {
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
fun bind(theme: String) {
|
fun bind(theme: String) {
|
||||||
if (theme == selectedTheme || (selectedTheme == "" && theme == "전체")) {
|
if (
|
||||||
|
theme == selectedTheme ||
|
||||||
|
(selectedTheme == "" && theme == "전체") ||
|
||||||
|
(selectedTheme == "" && theme == "매출")
|
||||||
|
) {
|
||||||
binding.tvTheme.setBackgroundResource(
|
binding.tvTheme.setBackgroundResource(
|
||||||
R.drawable.bg_round_corner_16_7_transparent_9970ff
|
R.drawable.bg_round_corner_16_7_transparent_9970ff
|
||||||
)
|
)
|
||||||
|
|
|
@ -45,6 +45,10 @@ class AudioContentMainViewModel(
|
||||||
val curationListLiveData: LiveData<List<GetAudioContentCurationResponse>>
|
val curationListLiveData: LiveData<List<GetAudioContentCurationResponse>>
|
||||||
get() = _curationListLiveData
|
get() = _curationListLiveData
|
||||||
|
|
||||||
|
private var _contentRankingSortListLiveData = MutableLiveData<List<String>>()
|
||||||
|
val contentRankingSortListLiveData: LiveData<List<String>>
|
||||||
|
get() = _contentRankingSortListLiveData
|
||||||
|
|
||||||
private var _contentRankingLiveData = MutableLiveData<GetAudioContentRanking>()
|
private var _contentRankingLiveData = MutableLiveData<GetAudioContentRanking>()
|
||||||
val contentRankingLiveData: LiveData<GetAudioContentRanking>
|
val contentRankingLiveData: LiveData<GetAudioContentRanking>
|
||||||
get() = _contentRankingLiveData
|
get() = _contentRankingLiveData
|
||||||
|
@ -66,6 +70,7 @@ class AudioContentMainViewModel(
|
||||||
_bannerLiveData.value = data.bannerList
|
_bannerLiveData.value = data.bannerList
|
||||||
_curationListLiveData.value = data.curationList
|
_curationListLiveData.value = data.curationList
|
||||||
_contentRankingLiveData.value = data.contentRanking
|
_contentRankingLiveData.value = data.contentRanking
|
||||||
|
_contentRankingSortListLiveData.value = data.contentRankingSortTypeList
|
||||||
|
|
||||||
val themeList = listOf("전체").union(data.themeList).toList()
|
val themeList = listOf("전체").union(data.themeList).toList()
|
||||||
_themeListLiveData.value = themeList
|
_themeListLiveData.value = themeList
|
||||||
|
@ -123,4 +128,39 @@ class AudioContentMainViewModel(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ data class GetAudioContentMainResponse(
|
||||||
@SerializedName("themeList") val themeList: List<String>,
|
@SerializedName("themeList") val themeList: List<String>,
|
||||||
@SerializedName("newContentList") val newContentList: List<GetAudioContentMainItem>,
|
@SerializedName("newContentList") val newContentList: List<GetAudioContentMainItem>,
|
||||||
@SerializedName("curationList") val curationList: List<GetAudioContentCurationResponse>,
|
@SerializedName("curationList") val curationList: List<GetAudioContentCurationResponse>,
|
||||||
|
@SerializedName("contentRankingSortTypeList") val contentRankingSortTypeList: List<String>,
|
||||||
@SerializedName("contentRanking") val contentRanking: GetAudioContentRanking
|
@SerializedName("contentRanking") val contentRanking: GetAudioContentRanking
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ object Constants {
|
||||||
const val EXTRA_MESSAGE_BOX = "extra_message_box"
|
const val EXTRA_MESSAGE_BOX = "extra_message_box"
|
||||||
const val EXTRA_TEXT_MESSAGE = "extra_text_message"
|
const val EXTRA_TEXT_MESSAGE = "extra_text_message"
|
||||||
const val EXTRA_LIVE_TIME_NOW = "extra_live_time_now"
|
const val EXTRA_LIVE_TIME_NOW = "extra_live_time_now"
|
||||||
const val EXTRA_PREV_LIVE_ROOM = "extra_prev_live_room"
|
const val EXTRA_GO_TO_PREV_PAGE = "extra_go_to_prev_page"
|
||||||
const val EXTRA_SELECT_RECIPIENT = "extra_select_recipient"
|
const val EXTRA_SELECT_RECIPIENT = "extra_select_recipient"
|
||||||
const val EXTRA_ROOM_CHANNEL_NAME = "extra_room_channel_name"
|
const val EXTRA_ROOM_CHANNEL_NAME = "extra_room_channel_name"
|
||||||
const val EXTRA_LIVE_RESERVATION_RESPONSE = "extra_live_reservation_response"
|
const val EXTRA_LIVE_RESERVATION_RESPONSE = "extra_live_reservation_response"
|
||||||
|
|
|
@ -108,7 +108,7 @@ class LiveRoomDonationDialog(
|
||||||
bottomSheetDialog.dismiss()
|
bottomSheetDialog.dismiss()
|
||||||
|
|
||||||
val intent = Intent(activity, CanChargeActivity::class.java)
|
val intent = Intent(activity, CanChargeActivity::class.java)
|
||||||
intent.putExtra(Constants.EXTRA_PREV_LIVE_ROOM, true)
|
intent.putExtra(Constants.EXTRA_GO_TO_PREV_PAGE, true)
|
||||||
activity.startActivity(intent)
|
activity.startActivity(intent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ class CanChargeActivity : BaseActivity<ActivityCanChargeBinding>(
|
||||||
) {
|
) {
|
||||||
|
|
||||||
private val viewModel: CanChargeViewModel by inject()
|
private val viewModel: CanChargeViewModel by inject()
|
||||||
private var prevLiveRoom: Boolean = false
|
private var gotoPrevPage: Boolean = false
|
||||||
|
|
||||||
private lateinit var adapter: CanChargeAdapter
|
private lateinit var adapter: CanChargeAdapter
|
||||||
private lateinit var loadingDialog: LoadingDialog
|
private lateinit var loadingDialog: LoadingDialog
|
||||||
|
@ -51,8 +51,8 @@ class CanChargeActivity : BaseActivity<ActivityCanChargeBinding>(
|
||||||
binding.toolbar.tvBack.text = "충전하기"
|
binding.toolbar.tvBack.text = "충전하기"
|
||||||
binding.toolbar.tvBack.setOnClickListener { finish() }
|
binding.toolbar.tvBack.setOnClickListener { finish() }
|
||||||
|
|
||||||
prevLiveRoom = intent.getBooleanExtra(
|
gotoPrevPage = intent.getBooleanExtra(
|
||||||
Constants.EXTRA_PREV_LIVE_ROOM,
|
Constants.EXTRA_GO_TO_PREV_PAGE,
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ class CanChargeActivity : BaseActivity<ActivityCanChargeBinding>(
|
||||||
adapter = CanChargeAdapter {
|
adapter = CanChargeAdapter {
|
||||||
val intent = Intent(applicationContext, CanPaymentActivity::class.java)
|
val intent = Intent(applicationContext, CanPaymentActivity::class.java)
|
||||||
intent.putExtra(Constants.EXTRA_CAN, it)
|
intent.putExtra(Constants.EXTRA_CAN, it)
|
||||||
intent.putExtra(Constants.EXTRA_PREV_LIVE_ROOM, prevLiveRoom)
|
intent.putExtra(Constants.EXTRA_GO_TO_PREV_PAGE, gotoPrevPage)
|
||||||
activityResultLauncher.launch(intent)
|
activityResultLauncher.launch(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ class CanPaymentActivity : BaseActivity<ActivityCanPaymentBinding>(
|
||||||
private val viewModel: CanPaymentViewModel by inject()
|
private val viewModel: CanPaymentViewModel by inject()
|
||||||
|
|
||||||
private var canResponse: CanResponse? = null
|
private var canResponse: CanResponse? = null
|
||||||
private var prevLiveRoom: Boolean = false
|
private var gotoPrevPage: Boolean = false
|
||||||
|
|
||||||
private val handler = Handler(Looper.getMainLooper())
|
private val handler = Handler(Looper.getMainLooper())
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@ class CanPaymentActivity : BaseActivity<ActivityCanPaymentBinding>(
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
prevLiveRoom = intent.getBooleanExtra(
|
gotoPrevPage = intent.getBooleanExtra(
|
||||||
Constants.EXTRA_PREV_LIVE_ROOM,
|
Constants.EXTRA_GO_TO_PREV_PAGE,
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ class CanPaymentActivity : BaseActivity<ActivityCanPaymentBinding>(
|
||||||
request,
|
request,
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
Toast.makeText(applicationContext, "캔이 충전되었습니다", Toast.LENGTH_LONG).show()
|
Toast.makeText(applicationContext, "캔이 충전되었습니다", Toast.LENGTH_LONG).show()
|
||||||
if (prevLiveRoom) {
|
if (gotoPrevPage) {
|
||||||
setResult(RESULT_OK)
|
setResult(RESULT_OK)
|
||||||
} else {
|
} else {
|
||||||
val intent = Intent(applicationContext, CanStatusActivity::class.java)
|
val intent = Intent(applicationContext, CanStatusActivity::class.java)
|
||||||
|
|
|
@ -36,11 +36,19 @@
|
||||||
android:textSize="13.3sp" />
|
android:textSize="13.3sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_content_ranking_sort"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="13.3dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingHorizontal="13.3dp" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_content_ranking"
|
android:id="@+id/rv_content_ranking"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="13.3dp"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:paddingHorizontal="6.7dp"
|
android:paddingHorizontal="6.7dp" />
|
||||||
android:paddingVertical="13.3dp" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -216,6 +216,14 @@
|
||||||
android:textSize="13.3sp" />
|
android:textSize="13.3sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_content_ranking_sort"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="13.3dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingHorizontal="13.3dp" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_content_ranking"
|
android:id="@+id/rv_content_ranking"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in New Issue