포인트 내역 화면 문자열 리소스화
This commit is contained in:
@@ -37,14 +37,22 @@ class PointStatusActivity : BaseActivity<ActivityPointStatusBinding>(
|
||||
}
|
||||
|
||||
override fun setupView() {
|
||||
binding.toolbar.tvBack.text = "포인트 내역"
|
||||
binding.toolbar.tvBack.text = getString(R.string.screen_point_status_title)
|
||||
binding.toolbar.tvBack.setOnClickListener { onClickBackButton() }
|
||||
|
||||
loadingDialog = LoadingDialog(this, layoutInflater)
|
||||
|
||||
val tabs = binding.tabs
|
||||
tabs.addTab(tabs.newTab().setText("받은내역").setTag("reward_status"))
|
||||
tabs.addTab(tabs.newTab().setText("사용내역").setTag("use_status"))
|
||||
tabs.addTab(
|
||||
tabs.newTab()
|
||||
.setText(R.string.screen_point_status_tab_reward)
|
||||
.setTag("reward_status")
|
||||
)
|
||||
tabs.addTab(
|
||||
tabs.newTab()
|
||||
.setText(R.string.screen_point_status_tab_use)
|
||||
.setTag("use_status")
|
||||
)
|
||||
|
||||
changeFragment("reward_status")
|
||||
|
||||
@@ -96,7 +104,10 @@ class PointStatusActivity : BaseActivity<ActivityPointStatusBinding>(
|
||||
}
|
||||
|
||||
viewModel.toastLiveData.observe(this) {
|
||||
it?.let { Toast.makeText(applicationContext, it, Toast.LENGTH_LONG).show() }
|
||||
val message = it?.resId?.let(::getString) ?: it?.message
|
||||
message?.let { text ->
|
||||
Toast.makeText(applicationContext, text, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.isLoading.observe(this) {
|
||||
|
||||
@@ -6,7 +6,9 @@ import com.orhanobut.logger.Logger
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
import kr.co.vividnext.sodalive.base.BaseViewModel
|
||||
import kr.co.vividnext.sodalive.common.ToastMessage
|
||||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.mypage.point.reward.GetPointRewardStatusResponse
|
||||
import kr.co.vividnext.sodalive.mypage.point.use.GetPointUseStatusResponse
|
||||
|
||||
@@ -23,8 +25,8 @@ class PointStatusViewModel(private val repository: PointStatusRepository) : Base
|
||||
val pointRewardStatusLiveData: LiveData<List<GetPointRewardStatusResponse>>
|
||||
get() = _pointRewardStatusLiveData
|
||||
|
||||
private val _toastLiveData = MutableLiveData<String?>()
|
||||
val toastLiveData: LiveData<String?>
|
||||
private val _toastLiveData = MutableLiveData<ToastMessage?>()
|
||||
val toastLiveData: LiveData<ToastMessage?>
|
||||
get() = _toastLiveData
|
||||
|
||||
private var _isLoading = MutableLiveData(false)
|
||||
@@ -43,19 +45,17 @@ class PointStatusViewModel(private val repository: PointStatusRepository) : Base
|
||||
if (it.success && it.data != null) {
|
||||
_totalPointLiveData.value = it.data.point
|
||||
} else {
|
||||
if (it.message != null) {
|
||||
_toastLiveData.postValue(it.message)
|
||||
} else {
|
||||
_toastLiveData.postValue(
|
||||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||
)
|
||||
}
|
||||
_toastLiveData.postValue(
|
||||
it.message?.let { message ->
|
||||
ToastMessage(message = message)
|
||||
} ?: ToastMessage(resId = R.string.common_error_unknown)
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
_isLoading.value = false
|
||||
it.message?.let { message -> Logger.e(message) }
|
||||
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||
_toastLiveData.postValue(ToastMessage(resId = R.string.common_error_unknown))
|
||||
}
|
||||
)
|
||||
)
|
||||
@@ -73,19 +73,17 @@ class PointStatusViewModel(private val repository: PointStatusRepository) : Base
|
||||
if (it.success && it.data != null) {
|
||||
_pointRewardStatusLiveData.value = it.data
|
||||
} else {
|
||||
if (it.message != null) {
|
||||
_toastLiveData.postValue(it.message)
|
||||
} else {
|
||||
_toastLiveData.postValue(
|
||||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||
)
|
||||
}
|
||||
_toastLiveData.postValue(
|
||||
it.message?.let { message ->
|
||||
ToastMessage(message = message)
|
||||
} ?: ToastMessage(resId = R.string.common_error_unknown)
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
_isLoading.value = false
|
||||
it.message?.let { message -> Logger.e(message) }
|
||||
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||
_toastLiveData.postValue(ToastMessage(resId = R.string.common_error_unknown))
|
||||
}
|
||||
)
|
||||
)
|
||||
@@ -103,19 +101,17 @@ class PointStatusViewModel(private val repository: PointStatusRepository) : Base
|
||||
if (it.success && it.data != null) {
|
||||
_pointUseStatusLiveData.value = it.data
|
||||
} else {
|
||||
if (it.message != null) {
|
||||
_toastLiveData.postValue(it.message)
|
||||
} else {
|
||||
_toastLiveData.postValue(
|
||||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||
)
|
||||
}
|
||||
_toastLiveData.postValue(
|
||||
it.message?.let { message ->
|
||||
ToastMessage(message = message)
|
||||
} ?: ToastMessage(resId = R.string.common_error_unknown)
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
_isLoading.value = false
|
||||
it.message?.let { message -> Logger.e(message) }
|
||||
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||
_toastLiveData.postValue(ToastMessage(resId = R.string.common_error_unknown))
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
android:layout_marginTop="13.3dp"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:gravity="center"
|
||||
android:text="※ 획득한 포인트는 72시간이 지나면 자동소멸 됩니다."
|
||||
android:text="@string/screen_point_status_notice"
|
||||
android:textColor="@color/color_eeeeee"
|
||||
android:textSize="13.3sp" />
|
||||
|
||||
|
||||
@@ -357,6 +357,11 @@
|
||||
<!-- Member Tag -->
|
||||
<string name="screen_member_tag_title">Select interests</string>
|
||||
<string name="screen_member_tag_confirm">Apply selection</string>
|
||||
<!-- Point Status -->
|
||||
<string name="screen_point_status_title">Point history</string>
|
||||
<string name="screen_point_status_tab_reward">Earned</string>
|
||||
<string name="screen_point_status_tab_use">Used</string>
|
||||
<string name="screen_point_status_notice">※ Earned points expire after 72 hours.</string>
|
||||
<!-- Service Center -->
|
||||
<string name="screen_service_center_title">Customer service</string>
|
||||
<string name="screen_service_center_logo_label">VoiceOn Customer Service</string>
|
||||
|
||||
@@ -357,6 +357,11 @@
|
||||
<!-- Member Tag -->
|
||||
<string name="screen_member_tag_title">関心事を選択</string>
|
||||
<string name="screen_member_tag_confirm">選択する</string>
|
||||
<!-- Point Status -->
|
||||
<string name="screen_point_status_title">ポイント履歴</string>
|
||||
<string name="screen_point_status_tab_reward">獲得履歴</string>
|
||||
<string name="screen_point_status_tab_use">使用履歴</string>
|
||||
<string name="screen_point_status_notice">※ 獲得したポイントは72時間後に自動失効します。</string>
|
||||
<!-- Service Center -->
|
||||
<string name="screen_service_center_title">カスタマーセンター</string>
|
||||
<string name="screen_service_center_logo_label">VoiceOn カスタマーセンター</string>
|
||||
|
||||
@@ -356,6 +356,11 @@
|
||||
<!-- Member Tag -->
|
||||
<string name="screen_member_tag_title">관심사 선택</string>
|
||||
<string name="screen_member_tag_confirm">선택하기</string>
|
||||
<!-- Point Status -->
|
||||
<string name="screen_point_status_title">포인트 내역</string>
|
||||
<string name="screen_point_status_tab_reward">받은내역</string>
|
||||
<string name="screen_point_status_tab_use">사용내역</string>
|
||||
<string name="screen_point_status_notice">※ 획득한 포인트는 72시간이 지나면 자동소멸 됩니다.</string>
|
||||
<!-- Service Center -->
|
||||
<string name="screen_service_center_title">고객센터</string>
|
||||
<string name="screen_service_center_logo_label">보이스온 고객센터</string>
|
||||
|
||||
Reference in New Issue
Block a user