Original 탭 인증 문자열 리소스로 치환
This commit is contained in:
@@ -11,6 +11,7 @@ import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.gson.Gson
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.base.BaseFragment
|
||||
import kr.co.vividnext.sodalive.base.SodaDialog
|
||||
import kr.co.vividnext.sodalive.chat.original.detail.OriginalWorkDetailActivity
|
||||
@@ -100,7 +101,13 @@ class OriginalTabFragment :
|
||||
}
|
||||
|
||||
viewModel.toast.observe(viewLifecycleOwner) {
|
||||
it?.let { Toast.makeText(requireActivity(), it, Toast.LENGTH_LONG).show() }
|
||||
it?.let { uiText ->
|
||||
Toast.makeText(
|
||||
requireActivity(),
|
||||
uiText.asString(requireContext()),
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,12 +121,11 @@ class OriginalTabFragment :
|
||||
SodaDialog(
|
||||
activity = requireActivity(),
|
||||
layoutInflater = layoutInflater,
|
||||
title = "본인인증",
|
||||
desc = "보이스온의 오픈월드 캐릭터톡은\n청소년 보호를 위해 본인인증한\n성인만 이용이 가능합니다.\n" +
|
||||
"캐릭터톡 서비스를 이용하시려면\n본인인증을 하고 이용해주세요.",
|
||||
confirmButtonTitle = "본인인증 하러가기",
|
||||
title = getString(R.string.auth_title),
|
||||
desc = getString(R.string.auth_desc),
|
||||
confirmButtonTitle = getString(R.string.auth_go),
|
||||
confirmButtonClick = { startAuthFlow() },
|
||||
cancelButtonTitle = "취소",
|
||||
cancelButtonTitle = getString(R.string.cancel),
|
||||
cancelButtonClick = {},
|
||||
descGravity = Gravity.CENTER
|
||||
).show(screenWidth)
|
||||
|
||||
@@ -4,8 +4,10 @@ import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
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.UiText
|
||||
|
||||
class OriginalWorkViewModel(
|
||||
private val repository: OriginalWorkRepository
|
||||
@@ -14,8 +16,8 @@ class OriginalWorkViewModel(
|
||||
private val _isLoading = MutableLiveData(false)
|
||||
val isLoading: LiveData<Boolean> get() = _isLoading
|
||||
|
||||
private val _toast = MutableLiveData<String?>(null)
|
||||
val toast: LiveData<String?> get() = _toast
|
||||
private val _toast = MutableLiveData<UiText?>(null)
|
||||
val toast: LiveData<UiText?> get() = _toast
|
||||
|
||||
private val _totalCount = MutableLiveData<Long>(0)
|
||||
val totalCount: LiveData<Long> get() = _totalCount
|
||||
@@ -52,12 +54,14 @@ class OriginalWorkViewModel(
|
||||
isLast = true
|
||||
}
|
||||
} else {
|
||||
_toast.value = response.message ?: "알 수 없는 오류가 발생했습니다."
|
||||
_toast.value = response.message?.let { UiText.DynamicString(it) }
|
||||
?: UiText.StringResource(R.string.common_error_unknown)
|
||||
}
|
||||
_isLoading.value = false
|
||||
}, { e ->
|
||||
_isLoading.value = false
|
||||
_toast.value = e.message ?: "알 수 없는 오류가 발생했습니다."
|
||||
_toast.value = e.message?.let { UiText.DynamicString(it) }
|
||||
?: UiText.StringResource(R.string.common_error_unknown)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user