[Modify]判断中文环境才显示中文提示语

This commit is contained in:
wushaocheng
2023-06-07 17:35:19 +08:00
parent 0dfe37c18c
commit b3898958d6
3 changed files with 18 additions and 9 deletions

View File

@@ -117,6 +117,7 @@ import io.reactivex.disposables.Disposable
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode import org.greenrobot.eventbus.ThreadMode
import java.util.*
/** /**
@@ -702,7 +703,13 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
.compose(bindUntilEvent(FragmentEvent.DESTROY)) .compose(bindUntilEvent(FragmentEvent.DESTROY))
.doOnError { .doOnError {
if (it is VipLevelNotEnoughException) { if (it is VipLevelNotEnoughException) {
dialogManager.showOkDialog("${getString(R.string.not_yet_given)}${giftInfo.giftName}${getString(R.string.rank_of_nobility_required)}${giftInfo.giftVipInfo?.vipName}") dialogManager.showOkDialog(
"${getString(R.string.not_yet_given)}${giftInfo.giftName}${
getString(
R.string.rank_of_nobility_required
)
}${giftInfo.giftVipInfo?.vipName}"
)
} }
} }
.subscribe { _, throwable -> .subscribe { _, throwable ->
@@ -800,7 +807,13 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
} }
}) })
val buttonItem4 = val buttonItem4 =
ButtonItem(getString(R.string.up_micro)) { toUpMicroPhone(micPosition, currentUid.toString() + "", false) } ButtonItem(getString(R.string.up_micro)) {
toUpMicroPhone(
micPosition,
currentUid.toString() + "",
false
)
}
//別問為什麽ui調整了順序 //別問為什麽ui調整了順序
//禁用超管的上麥和抱TA上麥 //禁用超管的上麥和抱TA上麥
if (!SuperAdminUtil.isSuperAdmin()) { if (!SuperAdminUtil.isSuperAdmin()) {
@@ -1059,7 +1072,9 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
val rvSpeedyMessage = val rvSpeedyMessage =
speedyMessageContainer.findViewById<RecyclerView>(R.id.rv_speedy_message) speedyMessageContainer.findViewById<RecyclerView>(R.id.rv_speedy_message)
val phrases = AvRoomDataManager.get().phrases val phrases = AvRoomDataManager.get().phrases
if (ListUtils.isListEmpty(phrases) || !TimeUtils.isTomorrow(DemoCache.readSpeedyMessageGoneTime())) { if (ListUtils.isListEmpty(phrases) || !TimeUtils.isTomorrow(DemoCache.readSpeedyMessageGoneTime())
|| Locale.getDefault().language != "zh"
) {
speedyMessageContainer.visibility = View.GONE speedyMessageContainer.visibility = View.GONE
return return
} }

View File

@@ -50,11 +50,6 @@ class AreaSelectActivity : BaseViewBindingActivity<ActivityAreaSelectBinding>()
setViewModel.changePartitionLiveData.observe(this) { setViewModel.changePartitionLiveData.observe(this) {
EventBus.getDefault().post(AreaChangeEvent()) EventBus.getDefault().post(AreaChangeEvent())
if(mPartitionAdapter.getItem(mPosition)?.desc == "华语区"){
SPUtils.putString(SpConstants.AREA_SELECT, "华语区")
}else {
SPUtils.putString(SpConstants.AREA_SELECT, "其它地区")
}
} }
mPartitionAdapter.setOnItemClickListener { _, _, position -> mPartitionAdapter.setOnItemClickListener { _, _, position ->

View File

@@ -2,5 +2,4 @@ package com.yizhuan.xchat_android_library.common
object SpConstants { object SpConstants {
const val TAB_INFO_LIST = "tab_info_list" const val TAB_INFO_LIST = "tab_info_list"
const val AREA_SELECT = "area_select"
} }