feat(series-list-all): 완결시리즈 전체보기 페이지 추가
This commit is contained in:
@@ -18,6 +18,7 @@ interface SeriesApi {
|
|||||||
@Query("isAdultContentVisible") isAdultContentVisible: Boolean,
|
@Query("isAdultContentVisible") isAdultContentVisible: Boolean,
|
||||||
@Query("contentType") contentType: ContentType,
|
@Query("contentType") contentType: ContentType,
|
||||||
@Query("isOriginal") isOriginal: Boolean?,
|
@Query("isOriginal") isOriginal: Boolean?,
|
||||||
|
@Query("isCompleted") isCompleted: Boolean?,
|
||||||
@Query("page") page: Int,
|
@Query("page") page: Int,
|
||||||
@Query("size") size: Int,
|
@Query("size") size: Int,
|
||||||
@Header("Authorization") authHeader: String
|
@Header("Authorization") authHeader: String
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class SeriesListAllActivity : BaseActivity<ActivitySeriesListAllBinding>(
|
|||||||
|
|
||||||
val passedCreatorId = intent.getLongExtra(Constants.EXTRA_USER_ID, 0)
|
val passedCreatorId = intent.getLongExtra(Constants.EXTRA_USER_ID, 0)
|
||||||
val isOriginal = intent.getBooleanExtra(Constants.EXTRA_IS_ORIGINAL, false)
|
val isOriginal = intent.getBooleanExtra(Constants.EXTRA_IS_ORIGINAL, false)
|
||||||
|
val isCompleted = intent.getBooleanExtra(Constants.EXTRA_IS_COMPLETED, false)
|
||||||
|
|
||||||
bindData()
|
bindData()
|
||||||
|
|
||||||
@@ -38,6 +39,11 @@ class SeriesListAllActivity : BaseActivity<ActivitySeriesListAllBinding>(
|
|||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
viewModel.isCompleted = if (isCompleted) {
|
||||||
|
true
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
viewModel.isOriginal = if (isOriginal) {
|
viewModel.isOriginal = if (isOriginal) {
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
@@ -49,7 +55,9 @@ class SeriesListAllActivity : BaseActivity<ActivitySeriesListAllBinding>(
|
|||||||
override fun setupView() {
|
override fun setupView() {
|
||||||
loadingDialog = LoadingDialog(this, layoutInflater)
|
loadingDialog = LoadingDialog(this, layoutInflater)
|
||||||
binding.toolbar.tvBack.text =
|
binding.toolbar.tvBack.text =
|
||||||
if (intent.getBooleanExtra(Constants.EXTRA_IS_ORIGINAL, false)) {
|
if (intent.getBooleanExtra(Constants.EXTRA_IS_COMPLETED, false)) {
|
||||||
|
"완결 시리즈"
|
||||||
|
} else if (intent.getBooleanExtra(Constants.EXTRA_IS_ORIGINAL, false)) {
|
||||||
"오직 보이스온에서만"
|
"오직 보이스온에서만"
|
||||||
} else {
|
} else {
|
||||||
"시리즈 전체보기"
|
"시리즈 전체보기"
|
||||||
|
|||||||
@@ -29,10 +29,11 @@ class SeriesListAllViewModel(private val repository: SeriesRepository) : BaseVie
|
|||||||
get() = _seriesListLiveData
|
get() = _seriesListLiveData
|
||||||
|
|
||||||
var creatorId: Long? = null
|
var creatorId: Long? = null
|
||||||
|
var isCompleted: Boolean? = null
|
||||||
var isOriginal: Boolean? = null
|
var isOriginal: Boolean? = null
|
||||||
var isLast = false
|
var isLast = false
|
||||||
var page = 1
|
var page = 1
|
||||||
private val size = 10
|
private val size = 20
|
||||||
|
|
||||||
fun getSeriesList() {
|
fun getSeriesList() {
|
||||||
if (!_isLoading.value!! && !isLast) {
|
if (!_isLoading.value!! && !isLast) {
|
||||||
@@ -42,6 +43,7 @@ class SeriesListAllViewModel(private val repository: SeriesRepository) : BaseVie
|
|||||||
repository.getSeriesList(
|
repository.getSeriesList(
|
||||||
creatorId = creatorId,
|
creatorId = creatorId,
|
||||||
isOriginal = isOriginal,
|
isOriginal = isOriginal,
|
||||||
|
isCompleted = isCompleted,
|
||||||
sortType = SeriesSortType.NEWEST,
|
sortType = SeriesSortType.NEWEST,
|
||||||
page = page,
|
page = page,
|
||||||
size = size,
|
size = size,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ class SeriesRepository(private val api: SeriesApi) {
|
|||||||
fun getSeriesList(
|
fun getSeriesList(
|
||||||
creatorId: Long?,
|
creatorId: Long?,
|
||||||
isOriginal: Boolean?,
|
isOriginal: Boolean?,
|
||||||
|
isCompleted: Boolean?,
|
||||||
sortType: SeriesListAllViewModel.SeriesSortType,
|
sortType: SeriesListAllViewModel.SeriesSortType,
|
||||||
page: Int,
|
page: Int,
|
||||||
size: Int,
|
size: Int,
|
||||||
@@ -17,6 +18,7 @@ class SeriesRepository(private val api: SeriesApi) {
|
|||||||
isAdultContentVisible = SharedPreferenceManager.isAdultContentVisible,
|
isAdultContentVisible = SharedPreferenceManager.isAdultContentVisible,
|
||||||
contentType = ContentType.entries[SharedPreferenceManager.contentPreference],
|
contentType = ContentType.entries[SharedPreferenceManager.contentPreference],
|
||||||
isOriginal = isOriginal,
|
isOriginal = isOriginal,
|
||||||
|
isCompleted = isCompleted,
|
||||||
page = page - 1,
|
page = page - 1,
|
||||||
size = size,
|
size = size,
|
||||||
authHeader = token
|
authHeader = token
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import com.zhpan.bannerview.BaseBannerAdapter
|
|||||||
import com.zhpan.indicator.enums.IndicatorSlideMode
|
import com.zhpan.indicator.enums.IndicatorSlideMode
|
||||||
import com.zhpan.indicator.enums.IndicatorStyle
|
import com.zhpan.indicator.enums.IndicatorStyle
|
||||||
import kr.co.vividnext.sodalive.R
|
import kr.co.vividnext.sodalive.R
|
||||||
|
import kr.co.vividnext.sodalive.audio_content.series.SeriesListAllActivity
|
||||||
import kr.co.vividnext.sodalive.audio_content.series.detail.SeriesDetailActivity
|
import kr.co.vividnext.sodalive.audio_content.series.detail.SeriesDetailActivity
|
||||||
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
|
||||||
@@ -166,6 +167,17 @@ class SeriesMainHomeFragment : BaseFragment<FragmentSeriesMainHomeBinding>(
|
|||||||
})
|
})
|
||||||
recyclerView.adapter = completedAdapter
|
recyclerView.adapter = completedAdapter
|
||||||
|
|
||||||
|
binding.tvCompletedSeriesAll.setOnClickListener {
|
||||||
|
startActivity(
|
||||||
|
Intent(
|
||||||
|
requireContext(),
|
||||||
|
SeriesListAllActivity::class.java
|
||||||
|
).apply {
|
||||||
|
putExtra(Constants.EXTRA_IS_COMPLETED, true)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
viewModel.completedSeriesLiveData.observe(viewLifecycleOwner) {
|
viewModel.completedSeriesLiveData.observe(viewLifecycleOwner) {
|
||||||
if (it.isNotEmpty()) {
|
if (it.isNotEmpty()) {
|
||||||
binding.llCompletedSeries.visibility = View.VISIBLE
|
binding.llCompletedSeries.visibility = View.VISIBLE
|
||||||
|
|||||||
@@ -96,4 +96,5 @@ object Constants {
|
|||||||
|
|
||||||
// Series List All options
|
// Series List All options
|
||||||
const val EXTRA_IS_ORIGINAL = "extra_is_original"
|
const val EXTRA_IS_ORIGINAL = "extra_is_original"
|
||||||
|
const val EXTRA_IS_COMPLETED = "extra_is_completed"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -653,7 +653,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
|
|||||||
requireContext(),
|
requireContext(),
|
||||||
SeriesListAllActivity::class.java
|
SeriesListAllActivity::class.java
|
||||||
).apply {
|
).apply {
|
||||||
putExtra(kr.co.vividnext.sodalive.common.Constants.EXTRA_IS_ORIGINAL, true)
|
putExtra(Constants.EXTRA_IS_ORIGINAL, true)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -42,16 +42,33 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/tv_completed_series"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="24dp"
|
android:gravity="center_vertical"
|
||||||
android:fontFamily="@font/pretendard_bold"
|
android:orientation="horizontal"
|
||||||
android:text="완결 시리즈"
|
android:paddingHorizontal="24dp">
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="24sp" />
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_completed_series"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:fontFamily="@font/pretendard_bold"
|
||||||
|
android:text="완결 시리즈"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="24sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_completed_series_all"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/pretendard_regular"
|
||||||
|
android:text="전체보기"
|
||||||
|
android:textColor="#90A4AE"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_completed_series"
|
android:id="@+id/rv_completed_series"
|
||||||
|
|||||||
Reference in New Issue
Block a user