시리즈 전체 목록 문자열 리소스화
This commit is contained in:
@@ -38,7 +38,10 @@ class SeriesListAdapter(
|
||||
}
|
||||
|
||||
binding.tvTitle.text = item.title
|
||||
binding.tvSeriesContentCount.text = "총 ${item.numberOfContent}화"
|
||||
binding.tvSeriesContentCount.text = binding.root.context.getString(
|
||||
R.string.screen_home_series_episode_count,
|
||||
item.numberOfContent
|
||||
)
|
||||
binding.tvPublishedDaysOfWeek.text = item.publishedDaysOfWeek
|
||||
|
||||
binding.tvNew.visibility = if (item.isNew) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.widget.Toast
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.audio_content.series.detail.SeriesDetailActivity
|
||||
import kr.co.vividnext.sodalive.base.BaseActivity
|
||||
import kr.co.vividnext.sodalive.common.Constants
|
||||
@@ -57,11 +58,11 @@ class SeriesListAllActivity : BaseActivity<ActivitySeriesListAllBinding>(
|
||||
loadingDialog = LoadingDialog(this, layoutInflater)
|
||||
binding.toolbar.tvBack.text =
|
||||
if (intent.getBooleanExtra(Constants.EXTRA_IS_COMPLETED, false)) {
|
||||
"완결 시리즈"
|
||||
getString(R.string.screen_series_main_completed_title)
|
||||
} else if (intent.getBooleanExtra(Constants.EXTRA_IS_ORIGINAL, false)) {
|
||||
"오직 보이스온에서만"
|
||||
getString(R.string.voiceon_original_only)
|
||||
} else {
|
||||
"시리즈 전체보기"
|
||||
getString(R.string.screen_series_main_title)
|
||||
}
|
||||
binding.toolbar.tvBack.setOnClickListener { finish() }
|
||||
|
||||
|
||||
@@ -6,8 +6,10 @@ import com.google.gson.annotations.SerializedName
|
||||
import com.orhanobut.logger.Logger
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.base.BaseViewModel
|
||||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||
import kr.co.vividnext.sodalive.common.SodaLiveApplicationHolder
|
||||
|
||||
class SeriesListAllViewModel(private val repository: SeriesRepository) : BaseViewModel() {
|
||||
|
||||
@@ -34,6 +36,8 @@ class SeriesListAllViewModel(private val repository: SeriesRepository) : BaseVie
|
||||
var isLast = false
|
||||
var page = 1
|
||||
private val size = 20
|
||||
private val unknownErrorMessage: String
|
||||
get() = SodaLiveApplicationHolder.get().getString(R.string.common_error_unknown)
|
||||
|
||||
fun getSeriesList() {
|
||||
if (!_isLoading.value!! && !isLast) {
|
||||
@@ -62,12 +66,7 @@ class SeriesListAllViewModel(private val repository: SeriesRepository) : BaseVie
|
||||
isLast = true
|
||||
}
|
||||
} else {
|
||||
if (it.message != null) {
|
||||
_toastLiveData.value = it.message
|
||||
} else {
|
||||
_toastLiveData.value = "알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||
|
||||
}
|
||||
_toastLiveData.value = it.message ?: unknownErrorMessage
|
||||
}
|
||||
|
||||
_isLoading.value = false
|
||||
@@ -75,7 +74,7 @@ class SeriesListAllViewModel(private val repository: SeriesRepository) : BaseVie
|
||||
{
|
||||
_isLoading.value = false
|
||||
it.message?.let { message -> Logger.e(message) }
|
||||
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||
_toastLiveData.postValue(unknownErrorMessage)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:paddingHorizontal="5.3dp"
|
||||
android:paddingVertical="3.7dp"
|
||||
android:text="신작"
|
||||
android:text="@string/screen_home_series_new"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10.3sp"
|
||||
android:visibility="gone"
|
||||
@@ -57,7 +57,7 @@
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:paddingHorizontal="5.3dp"
|
||||
android:paddingVertical="3.7dp"
|
||||
android:text="완결"
|
||||
android:text="@string/screen_home_series_complete"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10.3sp"
|
||||
android:visibility="gone"
|
||||
@@ -71,7 +71,7 @@
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:paddingHorizontal="5.3dp"
|
||||
android:paddingVertical="3.7dp"
|
||||
android:text="인기"
|
||||
android:text="@string/screen_home_series_popular"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10.3sp"
|
||||
android:visibility="gone"
|
||||
|
||||
Reference in New Issue
Block a user