多余语适配:去掉部分常量

This commit is contained in:
max
2024-05-13 19:07:13 +08:00
parent bf3098d5c3
commit 9be483de4b
11 changed files with 26 additions and 41 deletions

View File

@@ -1316,8 +1316,8 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
private fun addOpenDatingTips() { private fun addOpenDatingTips() {
if (AvRoomDataManager.get().isDatingMode && !isDatingMode && AvRoomDataManager.get().isManager) { if (AvRoomDataManager.get().isDatingMode && !isDatingMode && AvRoomDataManager.get().isManager) {
val tipMessage = val tipMessage =
ChatRoomMessageBuilder.createTipMessage(XConstants.DATING_TIPS_OPEN) ChatRoomMessageBuilder.createTipMessage(ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_09))
tipMessage.content = XConstants.DATING_TIPS_OPEN tipMessage.content = ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_09)
IMNetEaseManager.get().addMessages(tipMessage) IMNetEaseManager.get().addMessages(tipMessage)
} }
} }

View File

@@ -856,7 +856,7 @@ public class PublicChatMessageView extends FrameLayout {
} }
} else { } else {
String content = chatRoomMessage.getContent(); String content = chatRoomMessage.getContent();
if (!TextUtils.isEmpty(content) && content.equals(XConstants.ROOM_INTRODUCTION)) if (!TextUtils.isEmpty(content) && content.equals(ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_08)))
if (onClick != null) { if (onClick != null) {
onClick.onShowRoomIntroduction(); onClick.onShowRoomIntroduction();
} }

View File

@@ -661,13 +661,13 @@ public class MessageView extends FrameLayout {
// 房間通告 // 房間通告
if (ResUtil.getString(R.string.avroom_widget_messageview_03).equals(contentText)) { if (ResUtil.getString(R.string.avroom_widget_messageview_03).equals(contentText)) {
setUpdateGiftEffectMsg(tvContent); setUpdateGiftEffectMsg(tvContent);
} else if (XConstants.ROOM_INTRODUCTION.equals(contentText) || contentText.contains(IMNetEaseManager.ROOM_INTRO_TAG)) { } else if (ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_08).equals(contentText) || contentText.contains(IMNetEaseManager.ROOM_INTRO_TAG)) {
tvContent.setTextColor(ContextCompat.getColor(mContext, R.color.white)); tvContent.setTextColor(ContextCompat.getColor(mContext, R.color.white));
tvContent.setText(contentText); tvContent.setText(contentText);
} else if (XConstants.DATING_TIPS_OPEN.equals(contentText) || } else if (ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_09).equals(contentText) ||
contentText.contains(XConstants.DATING_TIPS_IN) || contentText.contains(ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_011)) ||
contentText.contains(XConstants.DATING_TIPS_NEW) || contentText.contains(ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_010)) ||
contentText.contains(XConstants.DATING_TIPS_PUBLIC)) { contentText.contains(ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_012))) {
//相親模式提示文案用特殊的顏色 //相親模式提示文案用特殊的顏色
tvContent.setTextColor(ContextCompat.getColor(mContext, R.color.color_fe5d7f)); tvContent.setTextColor(ContextCompat.getColor(mContext, R.color.color_fe5d7f));
tvContent.setText(contentText); tvContent.setText(contentText);
@@ -2942,7 +2942,7 @@ public class MessageView extends FrameLayout {
} }
} else { } else {
String content = chatRoomMessage.getContent(); String content = chatRoomMessage.getContent();
if (!TextUtils.isEmpty(content) && content.equals(XConstants.ROOM_INTRODUCTION)) if (!TextUtils.isEmpty(content) && content.equals(ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_08)))
if (onClick != null) { if (onClick != null) {
onClick.onShowRoomIntroduction(); onClick.onShowRoomIntroduction();
} }

View File

@@ -146,7 +146,7 @@ public class ChargeBillsActivity extends BillBaseActivity<ActivityBillsBinding>
adapter.addData(billItemEntities); adapter.addData(billItemEntities);
} else { } else {
if (mCurrentCounter == Constants.PAGE_START) { if (mCurrentCounter == Constants.PAGE_START) {
showNoData(R.drawable.icon_common_failure, XConstants.EMPTY_RECORD_AND_THREE_MONTHS_TIPSS); showNoData(R.drawable.icon_common_failure, ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_017));
} else { } else {
adapter.loadMoreEnd(true); adapter.loadMoreEnd(true);
} }

View File

@@ -20,6 +20,7 @@ import com.chwl.core.bills.bean.IncomeInfo;
import com.chwl.core.bills.bean.IncomeListInfo; import com.chwl.core.bills.bean.IncomeListInfo;
import com.chwl.library.base.factory.CreatePresenter; import com.chwl.library.base.factory.CreatePresenter;
import com.chwl.library.utils.ListUtils; import com.chwl.library.utils.ListUtils;
import com.chwl.library.utils.ResUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -124,7 +125,7 @@ public class GiftIncomeFragment extends BaseBillsFragment<IGiftIncomeView, GiftI
adapter.addData(billItemEntities); adapter.addData(billItemEntities);
} else { } else {
if (mCurrentCounter == Constants.PAGE_START) { if (mCurrentCounter == Constants.PAGE_START) {
showNoData(R.drawable.icon_common_failure, XConstants.EMPTY_RECORD_AND_THREE_MONTHS_TIPSS); showNoData(R.drawable.icon_common_failure, ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_017));
} else { } else {
adapter.loadMoreEnd(true); adapter.loadMoreEnd(true);
} }

View File

@@ -20,6 +20,7 @@ import com.chwl.core.bills.bean.ExpendInfo;
import com.chwl.core.bills.bean.ExpendListInfo; import com.chwl.core.bills.bean.ExpendListInfo;
import com.chwl.library.base.factory.CreatePresenter; import com.chwl.library.base.factory.CreatePresenter;
import com.chwl.library.utils.ListUtils; import com.chwl.library.utils.ListUtils;
import com.chwl.library.utils.ResUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -125,7 +126,7 @@ public class GiftOutputFragment extends BaseBillsFragment<IGiftOutputView, GiftO
adapter.addData(billItemEntities); adapter.addData(billItemEntities);
} else { } else {
if (mCurrentCounter == Constants.PAGE_START) { if (mCurrentCounter == Constants.PAGE_START) {
showNoData(R.drawable.icon_common_failure, XConstants.EMPTY_RECORD_AND_THREE_MONTHS_TIPSS); showNoData(R.drawable.icon_common_failure, ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_017));
} else { } else {
adapter.loadMoreEnd(true); adapter.loadMoreEnd(true);
} }

View File

@@ -27,6 +27,7 @@ import com.chwl.core.bills.bean.IncomeInfo;
import com.chwl.core.bills.bean.IncomeListInfo; import com.chwl.core.bills.bean.IncomeListInfo;
import com.chwl.library.annatation.ActLayoutRes; import com.chwl.library.annatation.ActLayoutRes;
import com.chwl.library.utils.ListUtils; import com.chwl.library.utils.ListUtils;
import com.chwl.library.utils.ResUtil;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
@@ -157,7 +158,7 @@ public class WithdrawBillsFragment extends BaseBindingFragment<FragmentXrexylerv
adapter.addData(billItemEntities); adapter.addData(billItemEntities);
} else { } else {
if (mCurrentCounter == 1) { if (mCurrentCounter == 1) {
showNoData(R.drawable.icon_common_failure, XConstants.EMPTY_RECORD_AND_THREE_MONTHS_TIPSS); showNoData(R.drawable.icon_common_failure, ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_017));
} else { } else {
adapter.loadMoreEnd(true); adapter.loadMoreEnd(true);
} }

View File

@@ -27,6 +27,7 @@ import com.chwl.core.radish.task.bean.TaskInfo;
import com.chwl.core.utils.net.DontWarnObserver; import com.chwl.core.utils.net.DontWarnObserver;
import com.chwl.core.utils.net.RxHelper; import com.chwl.core.utils.net.RxHelper;
import com.chwl.library.base.factory.CreatePresenter; import com.chwl.library.base.factory.CreatePresenter;
import com.chwl.library.utils.ResUtil;
import com.chwl.library.utils.SingleToastUtil; import com.chwl.library.utils.SingleToastUtil;
@CreatePresenter(TaskCenterFrgPresenter.class) @CreatePresenter(TaskCenterFrgPresenter.class)
@@ -85,7 +86,7 @@ public class TaskCenterFragment extends BaseMvpFragment<ITaskCenterViewFrg, Task
} }
final TaskInfo item = info; final TaskInfo item = info;
if (!item.isSupport()) { if (!item.isSupport()) {
SingleToastUtil.showToast(XConstants.UPDATE_VERSION_TIPS); SingleToastUtil.showToast(ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_013));
return; return;
} }
if (item.getStatus() == TaskInfo.STATUS_FINISHED_NOT_RECEIVE) { if (item.getStatus() == TaskInfo.STATUS_FINISHED_NOT_RECEIVE) {
@@ -115,7 +116,7 @@ public class TaskCenterFragment extends BaseMvpFragment<ITaskCenterViewFrg, Task
if (item.getSkipType() == TaskInfo.SHIP_TYPE_APP) { if (item.getSkipType() == TaskInfo.SHIP_TYPE_APP) {
boolean result = RouterHandler.handle(mContext, item.getRouterType(), item.getRouterValue()); boolean result = RouterHandler.handle(mContext, item.getRouterType(), item.getRouterValue());
if (!result) { if (!result) {
SingleToastUtil.showToast(XConstants.UPDATE_VERSION_TIPS); SingleToastUtil.showToast(ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_013));
return; return;
} }
@@ -127,7 +128,7 @@ public class TaskCenterFragment extends BaseMvpFragment<ITaskCenterViewFrg, Task
record = true; record = true;
} else } else
SingleToastUtil.showToast(XConstants.UPDATE_VERSION_TIPS); SingleToastUtil.showToast(ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_013));
if (record) { if (record) {

View File

@@ -1,6 +1,5 @@
package com.chwl.core; package com.chwl.core;
import com.chwl.library.utils.ResUtil;
/** /**
* Created by MadisonRong on 09/08/2018. * Created by MadisonRong on 09/08/2018.
@@ -53,29 +52,9 @@ public class XConstants {
* 賽事消息UID * 賽事消息UID
*/ */
public static final String MATCH_UID = BuildConfig.DEBUG ? "1296314" : "904772"; public static final String MATCH_UID = BuildConfig.DEBUG ? "1296314" : "904772";
public static final String ROOM_INTRODUCTION = ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_08);
public static final String DATING_TIPS_OPEN = ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_09);
//僅開頭提示文案,這個tips消息我們服務端發的
public static final String DATING_TIPS_NEW = ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_010);
public static final String DATING_TIPS_IN = ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_011);
public static final String DATING_TIPS_PUBLIC = ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_012);
public static final String SHOW = "show"; public static final String SHOW = "show";
public static final String HIDE = "hide"; public static final String HIDE = "hide";
public static final String UPDATE_VERSION_TIPS = ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_013);
public static final String NET_ERROR = ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_014);
public static final String UNKOWN_ERROR = ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_015);
/**
* 當布局記錄為空時的提示,比如禮物,充值
*/
public static final String EMPTY_RECORD_AND_THREE_MONTHS_TIPSS = ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_017);
// 舉報入口標識 // 舉報入口標識
public static final String REPORT_TYPE_CHAT = "chat"; // 私聊 public static final String REPORT_TYPE_CHAT = "chat"; // 私聊
public static final String REPORT_TYPE_PERSONAL = "personal"; // 個人中心 public static final String REPORT_TYPE_PERSONAL = "personal"; // 個人中心

View File

@@ -2907,7 +2907,7 @@ public final class IMNetEaseManager {
public Publisher<?> apply(Throwable throwable) throws Exception { public Publisher<?> apply(Throwable throwable) throws Exception {
String error = throwable.getMessage(); String error = throwable.getMessage();
if (TextUtils.isEmpty(error)) { if (TextUtils.isEmpty(error)) {
error = XConstants.UNKOWN_ERROR; error = ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_015);
} }
if (listener != null) { if (listener != null) {
listener.onFailed(retryChatRoomMessage.getRetryCount(), error); listener.onFailed(retryChatRoomMessage.getRetryCount(), error);
@@ -3640,7 +3640,7 @@ public final class IMNetEaseManager {
addMessagesImmediately(message); addMessagesImmediately(message);
} }
content = XConstants.ROOM_INTRODUCTION; content = ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_08);
message = ChatRoomMessageBuilder.createTipMessage(content); message = ChatRoomMessageBuilder.createTipMessage(content);
message.setContent(content); message.setContent(content);
addMessagesImmediately(message); addMessagesImmediately(message);

View File

@@ -2,7 +2,9 @@ package com.chwl.core.utils.net;
import android.text.TextUtils; import android.text.TextUtils;
import com.chwl.core.R;
import com.chwl.core.XConstants; import com.chwl.core.XConstants;
import com.chwl.library.utils.ResUtil;
import java.net.UnknownHostException; import java.net.UnknownHostException;
@@ -41,10 +43,10 @@ public abstract class DontWarnObserver<T> implements SingleObserver<T> {
error = e.getMessage(); error = e.getMessage();
} }
if (e instanceof UnknownHostException) { if (e instanceof UnknownHostException) {
error = XConstants.NET_ERROR; error = ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_014);
} }
if (TextUtils.isEmpty(error)) { if (TextUtils.isEmpty(error)) {
error = XConstants.NET_ERROR; error = ResUtil.getString(R.string.yizhuan_xchat_android_constants_xchatconstants_014);
} }
accept(null, error); accept(null, error);
acceptThrowable(null, e); acceptThrowable(null, e);