diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 6f4c447c6..33167f52e 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -194,9 +194,12 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode; -keep public class com.alibaba.android.arouter.facade.**{*;} -keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;} -# If you use the byType method to obtain Service, add the following rules to protect the interface: +# 如果使用了 byType 的方式获取 Service,需添加下面规则,保护接口 -keep interface * implements com.alibaba.android.arouter.facade.template.IProvider +# 如果使用了 单类注入,即不定义接口实现 IProvider,需添加下面规则,保护实现 +-keep class * implements com.alibaba.android.arouter.facade.template.IProvider + # If single-type injection is used, that is, no interface is defined to implement IProvider, the following rules need to be added to protect the implementation # -keep class * implements com.alibaba.android.arouter.facade.template.IProvider diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index 192cab24c..c1f1fe212 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -284,10 +284,25 @@ public class AppContext extends CommonAppContext { if (message.getReceivedStatus().isRead()) { return false; } - MessageChatNotifyManager.getInstance().push(AppManager.getInstance().getLastActivity() - , message.getTargetId(), - content.getContent() - ); + + RongIMClient.getInstance().getUnreadCount(Conversation.ConversationType.PRIVATE, message.getTargetId(), new RongIMClient.ResultCallback() { + @Override + public void onSuccess(Integer integer) { + if (integer > 0) { + MessageChatNotifyManager.getInstance().push(AppManager.getInstance().getLastActivity() + , message.getTargetId(), + content.getContent() + ); + } + } + + @Override + public void onError(RongIMClient.ErrorCode e) { + + } + }); + + } } } catch (Exception e) { diff --git a/app/tmp/full-r8-config.txt b/app/tmp/full-r8-config.txt index bcc009643..b1bb41625 100644 --- a/app/tmp/full-r8-config.txt +++ b/app/tmp/full-r8-config.txt @@ -293,9 +293,12 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode; -keep public class com.alibaba.android.arouter.facade.**{*;} -keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;} -# If you use the byType method to obtain Service, add the following rules to protect the interface: +# 如果使用了 byType 的方式获取 Service,需添加下面规则,保护接口 -keep interface * implements com.alibaba.android.arouter.facade.template.IProvider +# 如果使用了 单类注入,即不定义接口实现 IProvider,需添加下面规则,保护实现 +-keep class * implements com.alibaba.android.arouter.facade.template.IProvider + # If single-type injection is used, that is, no interface is defined to implement IProvider, the following rules need to be added to protect the implementation # -keep class * implements com.alibaba.android.arouter.facade.template.IProvider diff --git a/common/src/main/java/com/yunbao/common/dialog/MessageSayHiNotifyDialog.java b/common/src/main/java/com/yunbao/common/dialog/MessageSayHiNotifyDialog.java index e08ba1b7d..d5f8adf05 100644 --- a/common/src/main/java/com/yunbao/common/dialog/MessageSayHiNotifyDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/MessageSayHiNotifyDialog.java @@ -77,9 +77,9 @@ public class MessageSayHiNotifyDialog extends AbsDialogCenterPopupWindow { @Override protected void onDismiss() { super.onDismiss(); - /*if (onDismissListener != null) { + if (onDismissListener != null) { onDismissListener.onItemClick(userInfoBean.getUser().getId() + "", isSayHi ? 2 : 1); - }*/ + } } boolean isSayHi = false; @@ -98,7 +98,7 @@ public class MessageSayHiNotifyDialog extends AbsDialogCenterPopupWindow { sendMsg(userInfoBean.getSayHiMsg()); dismiss(); }); - /* avatar = findViewById(R.id.avatar); + avatar = findViewById(R.id.avatar); anchorName = findViewById(R.id.anchorName); ImgLoader.display(mContext, userInfoBean.getUser().getAvatar(), avatar); anchorName.setText(userInfoBean.getUser().getUserNicename()); @@ -110,7 +110,7 @@ public class MessageSayHiNotifyDialog extends AbsDialogCenterPopupWindow { ,WordUtil.isNewZh()?"歲":"years old" ) ); - showTag();*/ + showTag(); } private void showTag() { diff --git a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java index cb7684922..4947310c0 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -8,15 +8,18 @@ import android.text.TextUtils; import androidx.annotation.NonNull; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; import com.lzf.easyfloat.EasyFloat; +import com.lzy.okgo.model.Response; import com.umeng.analytics.MobclickAgent; import com.yunbao.common.CommonAppContext; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.event.DataUserInfoEvent; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; +import com.yunbao.common.http.JsonBean; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.manager.base.BaseCacheManager; import com.yunbao.common.manager.imrongcloud.MessageIMManager; @@ -439,6 +442,11 @@ public class IMLoginManager extends BaseCacheManager { //兼容老模块(之后要把用户维护的类更换掉) SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, new Gson().toJson(userInfo)); } + + @Override + public void onError(Response response) { + super.onError(response); + } }); } diff --git a/common/src/main/java/com/yunbao/common/manager/InstructorRemarkManager.java b/common/src/main/java/com/yunbao/common/manager/InstructorRemarkManager.java index 4f725edf8..2b81e5e09 100644 --- a/common/src/main/java/com/yunbao/common/manager/InstructorRemarkManager.java +++ b/common/src/main/java/com/yunbao/common/manager/InstructorRemarkManager.java @@ -4,12 +4,16 @@ import android.content.Context; import android.os.Handler; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.TypeReference; import com.google.gson.Gson; +import com.lzy.okgo.model.Response; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; +import com.yunbao.common.http.JsonBean; import com.yunbao.common.manager.base.BaseCacheManager; +import com.yunbao.common.utils.StringUtil; import java.util.HashMap; import java.util.Map; @@ -36,8 +40,12 @@ public class InstructorRemarkManager extends BaseCacheManager { */ public Map getInstructorRemark() { if (null == instructorRemarkMap) { - instructorRemarkMap = JSON.parseObject(getString(KEY_INSTRUCTOR_REMARK), new TypeReference>() { - }); + String string = getString(KEY_INSTRUCTOR_REMARK); + if (!StringUtil.isEmpty(string)) { + instructorRemarkMap = JSON.parseObject(string, new TypeReference>() { + + }); + } } if (instructorRemarkMap == null) { instructorRemarkMap = new HashMap<>(); @@ -103,8 +111,8 @@ public class InstructorRemarkManager extends BaseCacheManager { public void run() { IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo(); HttpClient.getInstance().get("User.getInstructorRemark", "getInstructorRemark") - .params("uid", userInfo.getId(),true) - .params("token", userInfo.getToken(),true) + .params("uid", userInfo.getId(), true) + .params("token", userInfo.getToken(), true) .execute(new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { @@ -116,6 +124,11 @@ public class InstructorRemarkManager extends BaseCacheManager { } } + + @Override + public void onError(Response response) { + super.onError(response); + } }); diff --git a/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java b/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java index d600937f5..9773cb423 100644 --- a/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java @@ -880,8 +880,9 @@ public class EditProfileActivity extends AbsActivity { userInfoBean = data; ((TextView) findViewById(R.id.occupation)).setText(data.getInfo().getCareer()); String height = data.getInfo().getHeight(); - if("0".equals(height)||StringUtil.isEmpty(height)){ - height="170"; + if ("0".equals(height) || StringUtil.isEmpty(height)) { + // height="170"; + ((TextView) findViewById(R.id.height)).setVisibility(View.GONE); } ((TextView) findViewById(R.id.height)).setText(height + "cm"); List tags = WordUtil.isNewZh() ? data.getInfo().getCn_label() : data.getInfo().getEn_label(); diff --git a/main/src/main/java/com/yunbao/main/activity/PDLiveConversationActivity.java b/main/src/main/java/com/yunbao/main/activity/PDLiveConversationActivity.java index d78def165..2dab906fd 100644 --- a/main/src/main/java/com/yunbao/main/activity/PDLiveConversationActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/PDLiveConversationActivity.java @@ -332,7 +332,7 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl tags.add(userInfoBean.getInfo().getCareer()); } if (!StringUtil.isEmpty(userInfoBean.getInfo().getHeight()) && !userInfoBean.getInfo().getHeight().equals("0")) { - tags.add(userInfoBean.getInfo().getHeight()); + tags.add(userInfoBean.getInfo().getHeight()+"cm"); } List t; if (WordUtil.isNewZh()) {