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