diff --git a/common/src/main/java/com/yunbao/common/bean/NewLevelModel.java b/common/src/main/java/com/yunbao/common/bean/NewLevelModel.java index abc884d0d..b477eba85 100644 --- a/common/src/main/java/com/yunbao/common/bean/NewLevelModel.java +++ b/common/src/main/java/com/yunbao/common/bean/NewLevelModel.java @@ -2,6 +2,7 @@ package com.yunbao.common.bean; import android.text.TextUtils; +import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; /** @@ -17,6 +18,17 @@ public class NewLevelModel extends BaseModel { private String levemax; @SerializedName("thumb") private String thumb; + @SerializedName("icon") + private String icon; + @SerializedName("colour") + private String colour; + @SerializedName("live_icon") + private String liveIcon; + + public static NewLevelModel objectFromData(String str) { + + return new Gson().fromJson(str, NewLevelModel.class); + } public String getId() { return id; @@ -67,4 +79,28 @@ public class NewLevelModel extends BaseModel { this.thumb = thumb; return this; } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getColour() { + return colour; + } + + public void setColour(String colour) { + this.colour = colour; + } + + public String getLiveIcon() { + return liveIcon; + } + + public void setLiveIcon(String liveIcon) { + this.liveIcon = liveIcon; + } } diff --git a/common/src/main/java/com/yunbao/common/manager/NewLevelManager.java b/common/src/main/java/com/yunbao/common/manager/NewLevelManager.java index 919da14af..51cb6f70a 100644 --- a/common/src/main/java/com/yunbao/common/manager/NewLevelManager.java +++ b/common/src/main/java/com/yunbao/common/manager/NewLevelManager.java @@ -16,6 +16,8 @@ import java.util.List; public class NewLevelManager extends BaseCacheManager { private final String KEY_USER_LEVEL = "keyUserLevel"; private final String KEY_ANCHOR_LEVEL = "keyAnchorLevel"; + private final String KEY_LIVE_LEVEL = "keyLiveLevel"; + private List newLevelModels = new ArrayList<>(); private List keyAnchorLevel = new ArrayList<>(); diff --git a/common/src/main/res/values-en/strings.xml b/common/src/main/res/values-en/strings.xml index ba779e04e..b46fdb4e6 100644 --- a/common/src/main/res/values-en/strings.xml +++ b/common/src/main/res/values-en/strings.xml @@ -735,7 +735,7 @@ Exit User - If you don\'t take the initiative,how can we have a story?\nTell the anchor say hi~ + If you don\'t take the initiative,how can we have a story?Tell the anchor say hi~ + follow Enter activity diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 7d686fd4a..7906aafe9 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -780,7 +780,7 @@ 直接退出 用戶 - 你都不主動我們怎麼會有故事,\n跟主播Say Hi吧~ + 你都不主動我們怎麼會有故事,跟主播Say Hi吧~ + 關注 進入活動 diff --git a/config.gradle b/config.gradle index 59ac79f7b..2285dc3eb 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", //测试 -// serverHost : "https://ceshi.yaoulive.com", + serverHost : "https://ceshi.yaoulive.com", //腾讯地图 txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", diff --git a/live/src/main/assets/chat_message_bg.png b/live/src/main/assets/chat_message_bg.png index 3f1095d71..4138e7e12 100644 Binary files a/live/src/main/assets/chat_message_bg.png and b/live/src/main/assets/chat_message_bg.png differ diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java index 03820cd05..c6403d0cd 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java @@ -14,11 +14,13 @@ import android.text.SpannableStringBuilder; import android.text.TextUtils; import android.text.style.ForegroundColorSpan; import android.util.Log; +import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.AnimationUtils; +import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; @@ -37,6 +39,7 @@ import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DpUtil; +import com.yunbao.common.views.weight.ClipPathCircleImage; import com.yunbao.live.R; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.bean.LiveChatBean; @@ -176,12 +179,16 @@ public class LiveChatAdapter extends RecyclerView.Adapter { RoundedImageView avatar; View v_chat_active_close; RecyclerView rv_chat_active; - ImageView img_zg_img; + ImageView img_zg_img, btnAttention; + FrameLayout attentionLayout; + ClipPathCircleImage clipImage2; public Vh(View itemView) { super(itemView); mBg = (LinearLayout) itemView.findViewById(R.id.bg); mTextView = (TextView) itemView.findViewById(R.id.text_txt); + attentionLayout = (FrameLayout) itemView.findViewById(R.id.attention_layout); + clipImage2 = (ClipPathCircleImage) itemView.findViewById(R.id.clip_image2); itemView.setOnClickListener(mOnClickListener); view_follow = (LinearLayout) itemView.findViewById(R.id.view_follow); @@ -196,6 +203,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { view_zg = (LinearLayout) itemView.findViewById(R.id.view_zg); tv_zg_anchorname = (TextView) itemView.findViewById(R.id.tv_zg_anchorname); img_zg_img = (ImageView) itemView.findViewById(R.id.img_zg_img); + btnAttention = (ImageView) itemView.findViewById(R.id.btn_attention); } @@ -203,7 +211,8 @@ public class LiveChatAdapter extends RecyclerView.Adapter { itemView.setTag(bean); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); - params.setMargins(0, 0, DpUtil.dp2px(95), 12); + params.setMargins(0, 0, DpUtil.dp2px(95), 0); + params.gravity = Gravity.CENTER_VERTICAL; mBg.setLayoutParams(params); if (bean.getType() == 6) {//大作战活动 view_action_game.setVisibility(View.VISIBLE); @@ -241,7 +250,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getBubble(), 1); } else { // mBg.setBackgroundResource(R.drawable.bg_live_chat_item); - new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg,1); + new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1); } SpannableStringBuilder builder = new SpannableStringBuilder(); if (bean.getType() == -3) { @@ -282,7 +291,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getBubble(), 1); } else { // mBg.setBackgroundResource(R.drawable.bg_live_chat_item); - new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg,1); + new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1); } String str1 = "火力四射,魅力無限!感謝"; String str2 = "為本直播間加成熱度"; @@ -302,7 +311,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getBubble(), 1); } else { // mBg.setBackgroundResource(R.drawable.bg_live_chat_item); - new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg,1); + new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1); } String str1 = "甜蜜不停,愛意不斷!恭喜"; String str2 = "在甜蜜約會中搶購到了"; @@ -329,33 +338,48 @@ public class LiveChatAdapter extends RecyclerView.Adapter { } if (isContains) { mTextView.setTextColor(0xffffffff); - mBg.setBackground(null); + new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1); mTextView.setText(bean.getContent()); } } else if (bean.getType() == LiveChatBean.SYSTEM2) { mTextView.setTextColor(0xffffffff); mBg.setBackground(null); mTextView.setText(bean.getContent()); - } else if (bean.getType() == -1) {//自动消息,关注 - boolean isContains = false; - for (LiveChatBean model : mList) { - if (bean.getType() == -1) { - isContains = true; - } - } - if (isContains) { - mBg.setBackground(null); - mTextView.setVisibility(View.GONE); - view_follow.setVisibility(View.VISIBLE); - ImgLoader.display(mContext, bean.getId(), avatar); - bean.setHeart(position); - } - - } else if (bean.getType() == -2) {//自动消息,点击发言 - - mBg.setBackgroundResource(R.drawable.bg_chat_automatic_item); - mTextView.setText(R.string.automatic_chat); + } +// else if (bean.getType() == -1) {//自动消息,关注 +// boolean isContains = false; +// for (LiveChatBean model : mList) { +// if (bean.getType() == -1) { +// isContains = true; +// } +// } +// if (isContains) { +// mBg.setBackground(null); +// mTextView.setVisibility(View.GONE); +// view_follow.setVisibility(View.VISIBLE); +// ImgLoader.display(mContext, bean.getId(), avatar); +// bean.setHeart(position); +// } +// +// } + else if (bean.getType() == -2) {//自动消息,点击发言 + LinearLayout.LayoutParams params3 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + params3.setMargins(0, 8, DpUtil.dp2px(95), 8); + params3.gravity = Gravity.CENTER_VERTICAL; + mBg.setLayoutParams(params3); + mBg.setBackground(null); + mTextView.setVisibility(View.GONE); bean.setHeart(position); + ImgLoader.display(mContext, bean.getId(), clipImage2); + attentionLayout.setVisibility(View.VISIBLE); + btnAttention.setVisibility(bean.isAttention() ? View.GONE : View.VISIBLE); + btnAttention.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LiveRoomViewHolder.follow(); + btnAttention.setVisibility(View.GONE); + } + }); } else if (bean.getType() == MSG_HOUR_RANK_CHANGE) { mBg.setBackgroundResource(R.drawable.bg_chat_automatic_item); mTextView.setText(bean.getContent()); @@ -382,21 +406,20 @@ public class LiveChatAdapter extends RecyclerView.Adapter { new LiveTextRender().luckyAngel(mContext, mTextView, bean.getMsgModel()); } - }else if(bean.getType() == LUCKY_100_CHECK){ + } else if (bean.getType() == LUCKY_100_CHECK) { if (!TextUtils.isEmpty(bean.getMsgModel().getSystem_bubble())) { bean.setId(bean.getMsgModel().getUserId()); itemView.setTag(bean); new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getMsgModel().getSystem_bubble(), 1); new LiveTextRender().lucky100(mContext, mTextView, bean.getMsgModel()); } - } - else { + } else { if (bean.getBubble() != null && !bean.getBubble().equals("")) { //加载.9图聊天气泡 new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getBubble(), 1); } else { // mBg.setBackgroundResource(R.drawable.bg_live_chat_item); - new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg,1); + new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1); } if (bean.getType() == LiveChatBean.ENTER_ROOM || bean.getType() == LiveChatBean.LIGHT) { mTextView.setTextColor(0xffc8c8c8); @@ -406,7 +429,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { new LiveTextRender().render(mContext, mTextView, bean); } - Animation animation = AnimationUtils.loadAnimation(itemView.getContext(),R.anim.live_chat_msg_in); + Animation animation = AnimationUtils.loadAnimation(itemView.getContext(), R.anim.live_chat_msg_in); itemView.startAnimation(animation); } } diff --git a/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java b/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java index 8d876699b..599d74661 100644 --- a/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java +++ b/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java @@ -83,6 +83,17 @@ public class LiveChatBean { //@ID @SerializedName("atUserID") private String atUserID = ""; + //用户是否关注主播 + private boolean isAttention = false; + + public boolean isAttention() { + return isAttention; + } + + public LiveChatBean setAttention(boolean attention) { + isAttention = attention; + return this; + } public String getAtUserName() { return atUserName; diff --git a/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java b/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java index da83aca91..bf274caca 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java @@ -158,10 +158,11 @@ public class LiveTextRender { builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF86C")), giftIndexOf, giftIndexOf + giftSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); mTextView.setText(builder); } + /** * 幸运100%活动 */ - public void lucky100(Context mContext, TextView mTextView, MsgModel msgModel){ + public void lucky100(Context mContext, TextView mTextView, MsgModel msgModel) { String msg = mContext.getString(R.string.lucky_100); msg = String.format(msg, msgModel.getUserName(), msgModel.getGiftName()); int unameIndexOf = msg.indexOf(msgModel.getUserName()); @@ -199,7 +200,7 @@ public class LiveTextRender { int index = mContext.indexOf(userName); int end = index + userName.length(); int endIndex = startIndex + userName.length(); - spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#fffe9b")), + spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#FBEABF")), startIndex, endIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); mContext = mContext.substring(end + 1, mContext.length()); startIndex = startIndex + end + 1; @@ -215,7 +216,7 @@ public class LiveTextRender { int end = index + name.length(); startIndex = index + startIndex; int endIndex = startIndex + name.length(); - spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#fffe9b")), + spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#FBEABF")), startIndex, endIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); mContext = mContext.substring(end, mContext.length()); startIndex = endIndex; @@ -248,7 +249,7 @@ public class LiveTextRender { if (levelDrawable != null) { builder.append(" "); - levelDrawable.setBounds(0, 0, DpUtil.dp2px(32), DpUtil.dp2px(14)); + levelDrawable.setBounds(0, 0, DpUtil.dp2px(17), DpUtil.dp2px(17)); builder.setSpan(new VerticalImageSpan(levelDrawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); index = builder.length(); } @@ -416,7 +417,6 @@ public class LiveTextRender { }); } - private ImgLoader.DrawableCallback mCallback; /** * 等级设置 @@ -424,10 +424,9 @@ public class LiveTextRender { * @return */ public void getLevelImage(Context mContext, int userLevel, ImgLoader.DrawableCallback callback) { - mCallback = callback; - if(mContext instanceof Activity){ - if(((Activity)mContext).isDestroyed()){ - mContext=CommonAppContext.getTopActivity(); + if (mContext instanceof Activity) { + if (((Activity) mContext).isDestroyed()) { + mContext = CommonAppContext.getTopActivity(); } } List models = new NewLevelManager(mContext).getNewLevelModels(); @@ -484,18 +483,76 @@ public class LiveTextRender { }); } + public void getLiveLevelImage(Context mContext, int userLevel, ImgLoader.DrawableCallback callback) { + if (mContext instanceof Activity) { + if (((Activity) mContext).isDestroyed()) { + mContext = CommonAppContext.getTopActivity(); + } + } + List models = new NewLevelManager(mContext).getNewLevelModels(); + String imgUrl = "https://downs.yaoulive.com/level1/img_1-9.png"; + for (NewLevelModel newLevelModel : models) { + if (newLevelModel.getLeveMin() <= userLevel && userLevel <= newLevelModel.getLeveMax()) { + imgUrl = newLevelModel.getLiveIcon(); + } + } + + Glide.with(mContext).asBitmap().load(imgUrl).into(new CustomTarget() { + @Override + public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition transition) { + Observable.create(new ObservableOnSubscribe() { + @Override + public void subscribe(ObservableEmitter emitter) throws Exception { + emitter.onNext(AddTimeLiveWatermark(resource, String.valueOf(userLevel)));// + } + }).subscribeOn(Schedulers.newThread()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Observer() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onNext(Bitmap bitmap) { + BitmapDrawable drawable = new BitmapDrawable(bitmap); + if (callback != null) { + callback.onLoadSuccess(drawable); + } + } + + @Override + public void onError(Throwable e) { + + } + + @Override + public void onComplete() { + + } + }); + } + + @Override + public void onLoadCleared(@Nullable Drawable placeholder) { + if (callback != null) { + callback.onLoadFailed(); + } + } + }); + } private void renderTMP(Context context, final TextView textView, final LiveChatBean bean) { if (textView != null) { - getLevelImage(context, bean.getLevel(), new ImgLoader.DrawableCallback() { + getLiveLevelImage(context, bean.getLevel(), new ImgLoader.DrawableCallback() { @Override public void onLoadSuccess(Drawable drawable) { SpannableStringBuilder builder = createPrefix(drawable, bean); int color = Color.parseColor("#68F1F4"); if (bean.isAnchor()) { - color = 0xffffdd00; + color =Color.parseColor("#FBEABF"); } else { color = Color.parseColor("#68F1F4"); } @@ -535,6 +592,43 @@ public class LiveTextRender { } + /** + * bitmap添加文字 + * + * @param mBitmap + * @return + */ + private Bitmap AddTimeLiveWatermark(Bitmap mBitmap, String level) { + //获取原始图片与水印图片的宽与高 + int mBitmapWidth = mBitmap.getWidth(); + int mBitmapHeight = mBitmap.getHeight(); + Bitmap mNewBitmap = Bitmap.createBitmap(mBitmapWidth, mBitmapHeight, Bitmap.Config.ARGB_8888); + Canvas mCanvas = new Canvas(mNewBitmap); + //向位图中开始画入MBitmap原始图片 + mCanvas.drawBitmap(mBitmap, 0, 0, null); + //添加文字 + Paint mPaint = new Paint(); + Typeface font = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD); + mPaint.setColor(Color.WHITE); + if (level.length() == 3) { + mPaint.setTextSize(27); + mPaint.setTypeface(font); + mCanvas.drawText(level, 3, 38, mPaint); + } else if (level.length() == 2) { + mPaint.setTextSize(30 ); + mPaint.setTypeface(font); + mCanvas.drawText(level, 10, 38, mPaint); + }else if (level.length() == 1) { + mPaint.setTextSize(37 ); + mPaint.setTypeface(font); + mCanvas.drawText(level, 16, 38, mPaint); + } + + mCanvas.save(); + mCanvas.restore(); + return mNewBitmap; + } + /** * bitmap添加文字 * diff --git a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java index c6ceacd3e..0b149102a 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -448,15 +448,11 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { if (!liveUid.equals(mLiveUid)) { return; } - if (isattention == 0) { - LiveChatBean lvBean = new LiveChatBean(); - lvBean.setType(-1); - lvBean.setId(url); - LiveRoomViewHolder.insertChat(lvBean, 1); - } - LiveChatBean lvBean2 = new LiveChatBean(); - lvBean2.setType(-2); - LiveRoomViewHolder.insertChat(lvBean2, 1); + LiveChatBean lvBean = new LiveChatBean(); + lvBean.setType(-2); + lvBean.setId(url); + lvBean.setAttention(isattention == 0); + LiveRoomViewHolder.insertChat(lvBean, 1); Log.i("chatMgs", liveUid + "|" + mLiveUid); } }, 10000);//3秒后执行Runnable中的run方法 diff --git a/live/src/main/res/drawable/chat_message_bg.xml b/live/src/main/res/drawable/chat_message_bg.xml new file mode 100644 index 000000000..debf06ab0 --- /dev/null +++ b/live/src/main/res/drawable/chat_message_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/item_live_chat.xml b/live/src/main/res/layout/item_live_chat.xml index 0bc47a2be..81dfffd9a 100644 --- a/live/src/main/res/layout/item_live_chat.xml +++ b/live/src/main/res/layout/item_live_chat.xml @@ -3,22 +3,20 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/bg" - android:layout_width="wrap_content" + android:layout_width="match_parent" android:layout_height="wrap_content" + android:gravity="center_vertical" android:orientation="vertical"> @@ -182,4 +180,40 @@ android:layout_width="90dp" android:layout_height="45dp" /> + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/mipmap-xxxhdpi/btn_attention.png b/live/src/main/res/mipmap-xxxhdpi/btn_attention.png new file mode 100644 index 000000000..40db4e88f Binary files /dev/null and b/live/src/main/res/mipmap-xxxhdpi/btn_attention.png differ diff --git a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java index dd8f49e3a..2bcaa5844 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java @@ -70,6 +70,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.List; +import java.util.Locale; /** * Created by cxf on 2018/9/22. @@ -302,8 +303,15 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi user_noble_time.setText(mContext.getResources().getString(R.string.open_noble_text)); } String singnature = u.getSignature(); - if (TextUtils.equals(singnature, "這個人很懶,什麼也沒留下") ||TextUtils.equals(singnature, "这家伙很懒,什么都没留下") || TextUtils.isEmpty(singnature)) { - singnature ="The guy was lazy and didn't write anything."; + if (TextUtils.equals(singnature, "這個人很懶,什麼也沒留下") || TextUtils.equals(singnature, "这家伙很懒,什么都没留下") || TextUtils.isEmpty(singnature)) { + String ct = Locale.getDefault().getCountry(); + ct = TextUtils.equals("CN", ct) ? "HK" : ct; + if (TextUtils.equals(ct, "CN")) { + singnature = "這個人很懶,什麼也沒留下"; + } else { + singnature = "The guy was lazy and didn't write anything."; + } + } signature.setText(singnature); CommonAppConfig appConfig = CommonAppConfig.getInstance();