parent
6da8846460
commit
8867fe9a1c
|
@ -88,7 +88,6 @@ interface AudioContentApi {
|
|||
|
||||
@GET("/order/audio-content")
|
||||
fun getAudioContentOrderList(
|
||||
@Query("orderType") orderType: OrderType? = null,
|
||||
@Query("page") page: Int,
|
||||
@Query("size") size: Int,
|
||||
@Header("Authorization") authHeader: String
|
||||
|
|
|
@ -118,12 +118,10 @@ class AudioContentRepository(
|
|||
)
|
||||
|
||||
fun getAudioContentOrderList(
|
||||
orderType: OrderType? = null,
|
||||
page: Int,
|
||||
size: Int,
|
||||
token: String
|
||||
) = api.getAudioContentOrderList(
|
||||
orderType = orderType,
|
||||
page = page - 1,
|
||||
size = size,
|
||||
authHeader = token
|
||||
|
|
|
@ -33,12 +33,11 @@ class AudioContentOrderListViewModel(
|
|||
var page = 1
|
||||
private val size = 10
|
||||
|
||||
fun getAudioContentOrderList(orderType: OrderType? = null, onFailure: (() -> Unit)? = null) {
|
||||
fun getAudioContentOrderList(onFailure: (() -> Unit)? = null) {
|
||||
if (_isLoading.value == false) {
|
||||
_isLoading.value = true
|
||||
compositeDisposable.add(
|
||||
repository.getAudioContentOrderList(
|
||||
orderType = orderType,
|
||||
page = page,
|
||||
size = size,
|
||||
token = "Bearer ${SharedPreferenceManager.token}"
|
||||
|
|
|
@ -17,7 +17,6 @@ import com.google.android.material.bottomsheet.BottomSheetDialog
|
|||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import kr.co.vividnext.sodalive.audio_content.order.AudioContentOrderListViewModel
|
||||
import kr.co.vividnext.sodalive.audio_content.order.GetAudioContentOrderListItem
|
||||
import kr.co.vividnext.sodalive.audio_content.order.OrderType
|
||||
import kr.co.vividnext.sodalive.audio_content.playlist.detail.AudioContentPlaylistContent
|
||||
import kr.co.vividnext.sodalive.common.LoadingDialog
|
||||
import kr.co.vividnext.sodalive.databinding.FragmentPlaylistAddContentBinding
|
||||
|
@ -74,7 +73,7 @@ class PlaylistAddContentDialogFragment(
|
|||
|
||||
setupView()
|
||||
bindData()
|
||||
viewModel.getAudioContentOrderList(orderType = OrderType.KEEP) { dismiss() }
|
||||
viewModel.getAudioContentOrderList { dismiss() }
|
||||
}
|
||||
|
||||
override fun onDismiss(dialog: DialogInterface) {
|
||||
|
@ -141,7 +140,7 @@ class PlaylistAddContentDialogFragment(
|
|||
if (!recyclerView.canScrollVertically(1) &&
|
||||
lastVisibleItemPosition == itemTotalCount
|
||||
) {
|
||||
viewModel.getAudioContentOrderList(orderType = OrderType.KEEP) {}
|
||||
viewModel.getAudioContentOrderList {}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue