This commit is contained in:
zlzw 2024-04-07 14:46:08 +08:00
parent 954a14662b
commit 269ad6e808
16 changed files with 94 additions and 64 deletions

View File

@ -88,6 +88,9 @@ import io.rong.imkit.config.RongConfigCenter;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation;
import io.rong.imlib.model.MessageContent;
import io.rong.message.HQVoiceMessage;
import io.rong.message.ImageMessage;
import io.rong.message.SightMessage;
import io.rong.message.TextMessage;
//import cn.tillusory.sdk.TiSDK;
@ -280,7 +283,14 @@ public class AppContext extends CommonAppContext {
content = new TextMessage(WordUtil.getNewString(R.string.activity_msg_chat_list_card));
} else if (message.getContent() instanceof TextMessage) {
content = (TextMessage) message.getContent();
}else{
}else if(message.getContent() instanceof ImageMessage){
content = new TextMessage(WordUtil.getNewString(R.string.rc_conversation_summary_content_image));
}else if(message.getContent() instanceof SightMessage){
content = new TextMessage(WordUtil.getNewString(R.string.rc_conversation_summary_content_sight));
}else if(message.getContent() instanceof HQVoiceMessage){
content = new TextMessage(WordUtil.getNewString(R.string.rc_conversation_summary_content_voice));
}else {
System.out.println("未知消息类型:"+message.getContent().getClass().getSimpleName()+"|"+message.getContent());
return false;
}
if (content.getContent().contains("_method_")) {

View File

@ -3,6 +3,7 @@ package com.yunbao.common.manager.imrongcloud;
import android.app.Activity;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
@ -19,6 +20,7 @@ import com.yunbao.common.http.HttpClient;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import org.greenrobot.eventbus.EventBus;
@ -100,13 +102,14 @@ public class MessageIMManager {
@Override
public void onSuccess(Integer integer) {
imNumber = integer;
System.out.println(">>>>>>>>>未读数 "+integer);
//发送通知
unreadMessagesHandler.post(essagesRunnable);
}
@Override
public void onError(RongIMClient.ErrorCode e) {
ToastUtil.showDebug(e.getMessage());
}
});
@ -214,6 +217,16 @@ public class MessageIMManager {
//整合未读消息数目并且发送出去
private final Runnable essagesRunnable = () -> {
number = imNumber + systemNumber;
/*if(AppManager.getInstance().getMainActivity()==null){
new Handler(Looper.getMainLooper()).postDelayed(() -> {
DebugDialog.getInstance(AppManager.getInstance().getMainActivity()).setParams("消息", imNumber + "");
DebugDialog.getInstance(AppManager.getInstance().getMainActivity()).setParams("系統", systemNumber + "");
},300);
}else {
DebugDialog.getInstance(AppManager.getInstance().getMainActivity()).setParams("消息", imNumber + "");
DebugDialog.getInstance(AppManager.getInstance().getMainActivity()).setParams("系統", systemNumber + "");
}*/
Log.i("未读消息", "消息: "+imNumber+" | 系统: "+systemNumber);
EventBus.getDefault().post(new MessageIMEvent().setNumber(number).setMessage(imNumber));
};

View File

@ -118,7 +118,7 @@ public class RongcloudIMManager {
* @param context
*/
public static void connectIM(Context context) {
MessageIMManager.get(context).addImRongCloudObserver();
// MessageIMManager.get(context).addImRongCloudObserver();
MessageIMManager.get(context).getSystemMessages();
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
String IMToken = userInfo.getTokenRong();

View File

@ -70,7 +70,7 @@ public class MessageSayHiNotifyManager {
return isInit;
}
public synchronized void next() {
private synchronized void next() {
Log.i(TAG, "next: 获取下一轮定时器信息&显示当前弹框");
LiveNetManager.get(AppManager.getInstance().getLastActivity())
.getMessageSayHiTimer(new HttpCallback<MessageSayHiBean>() {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 333 B

View File

@ -1058,11 +1058,11 @@ Limited ride And limited avatar frame</string>
<string name="privacy_terms">Privacy Policy</string>
<string name="terms_and_policies">Terms and policies</string>
<string name="install_the_application">For details, please read the following message to install the application:</string>
<string name="treat_and_protect">Welcome to PD LIVE. For your personal information and privacy, we will adopt the highest standards of treatment and protection.</string>
<string name="treat_and_protect">Welcome to PandoraLive. For your personal information and privacy, we will adopt the highest standards of treatment and protection.</string>
<string name="anti_cheating_services">In order to provide users with better services, our products integrate [Alliance SDK], SDK needs to collect your device information (IMEI/MAC/Android ID/IDFA/OpenUDID/GUID/IP address /SIM card IMSI information, etc.), In order for you to better understand the types and purposes of the data collected by [Alliance SDK] and how to protect your personal information, you can log on to: https://www.umeng.com/page/policy Learn about [Alliance SDK] Privacy Policy [Alliance +] Privacy Policy [Alliance +], a third-party global big data service provider, providing customers with PC/APP/ offline statistics, advertising effect monitoring, message push/micro community/sharing /IM and other operating tools,DIP, global index and industry reports. https://www.umeng.com/page/policy</string>
<string name="read_and_agre">Clicking Agree means you have read and agree to all of the above.。</string>
<string name="agreement">agreement</string>
<string name="come_to">Welcome to PD LIVE.</string>
<string name="come_to">Welcome to PandoraLive.</string>
<string name="live_gift">gift</string>
<string name="register_tip_2">User service agreement</string>
<string name="live_fans_medal_pri_des">一 Fan privilege 一</string>

View File

@ -1082,7 +1082,7 @@
<string name="and"></string>
<string name="privacy_terms">隱私條款</string>
<string name="terms_and_policies">條款和政策</string>
<string name="treat_and_protect">歡迎來到PD LIVE,對於您的個人信息及隱私,我們將採用最高標準對待和保護。</string>
<string name="treat_and_protect">歡迎來到PandoraLive,對於您的個人信息及隱私,我們將採用最高標準對待和保護。</string>
<string name="install_the_application">詳情請您閱讀以下安裝應用程序的消息:</string>
<string name="anti_cheating_services">為了給用戶提供更好的服務,我們的產品集成[友盟SDK]SDK需要收集您的设备信息IMEI/MAC/Android ID/IDFA/OpenUDID/GUID/IP地址/SIM 卡 IMSI 信息等),為便於您更好地了解[友盟SDK]采集的數據類型及用途以及何保護您的個人信息您可以登陸https://www.umeng.com/page/policy 了解[友盟SDK]隱私權政策【友盟+】隐私政策【友盟+】,第三方全域大数据服务提供商,为客户提供PC/APP/线下统计,广告效果监测,消息推送/微社区/分享/IM等运营工具,DIP,全域指数与行业报告等。https://www.umeng.com/page/policy</string>
<string name="agreement">同意</string>

View File

@ -1082,7 +1082,7 @@
<string name="and"></string>
<string name="privacy_terms">隱私條款</string>
<string name="terms_and_policies">條款和政策</string>
<string name="treat_and_protect">歡迎來到PD LIVE,對於您的個人信息及隱私,我們將採用最高標準對待和保護。</string>
<string name="treat_and_protect">歡迎來到PandoraLive,對於您的個人信息及隱私,我們將採用最高標準對待和保護。</string>
<string name="install_the_application">詳情請您閱讀以下安裝應用程序的消息:</string>
<string name="anti_cheating_services">為了給用戶提供更好的服務,我們的產品集成[友盟SDK]SDK需要收集您的设备信息IMEI/MAC/Android ID/IDFA/OpenUDID/GUID/IP地址/SIM 卡 IMSI 信息等),為便於您更好地了解[友盟SDK]采集的數據類型及用途以及何保護您的個人信息您可以登陸https://www.umeng.com/page/policy 了解[友盟SDK]隱私權政策【友盟+】隐私政策【友盟+】,第三方全域大数据服务提供商,为客户提供PC/APP/线下统计,广告效果监测,消息推送/微社区/分享/IM等运营工具,DIP,全域指数与行业报告等。https://www.umeng.com/page/policy</string>
<string name="agreement">同意</string>

View File

@ -1082,7 +1082,7 @@
<string name="and"></string>
<string name="privacy_terms">隱私條款</string>
<string name="terms_and_policies">條款和政策</string>
<string name="treat_and_protect">歡迎來到PD LIVE,對於您的個人信息及隱私,我們將採用最高標準對待和保護。</string>
<string name="treat_and_protect">歡迎來到PandoraLive,對於您的個人信息及隱私,我們將採用最高標準對待和保護。</string>
<string name="install_the_application">詳情請您閱讀以下安裝應用程序的消息:</string>
<string name="anti_cheating_services">為了給用戶提供更好的服務,我們的產品集成[友盟SDK]SDK需要收集您的设备信息IMEI/MAC/Android ID/IDFA/OpenUDID/GUID/IP地址/SIM 卡 IMSI 信息等),為便於您更好地了解[友盟SDK]采集的數據類型及用途以及何保護您的個人信息您可以登陸https://www.umeng.com/page/policy 了解[友盟SDK]隱私權政策【友盟+】隐私政策【友盟+】,第三方全域大数据服务提供商,为客户提供PC/APP/线下统计,广告效果监测,消息推送/微社区/分享/IM等运营工具,DIP,全域指数与行业报告等。https://www.umeng.com/page/policy</string>
<string name="agreement">同意</string>

View File

@ -1058,11 +1058,11 @@ Limited ride And limited avatar frame</string>
<string name="privacy_terms">Privacy Policy</string>
<string name="terms_and_policies">Terms and policies</string>
<string name="install_the_application">For details, please read the following message to install the application:</string>
<string name="treat_and_protect">Welcome to PD LIVE. For your personal information and privacy, we will adopt the highest standards of treatment and protection.</string>
<string name="treat_and_protect">Welcome to PandoraLive. For your personal information and privacy, we will adopt the highest standards of treatment and protection.</string>
<string name="anti_cheating_services">In order to provide users with better services, our products integrate [Alliance SDK], SDK needs to collect your device information (IMEI/MAC/Android ID/IDFA/OpenUDID/GUID/IP address /SIM card IMSI information, etc.), In order for you to better understand the types and purposes of the data collected by [Alliance SDK] and how to protect your personal information, you can log on to: https://www.umeng.com/page/policy Learn about [Alliance SDK] Privacy Policy [Alliance +] Privacy Policy [Alliance +], a third-party global big data service provider, providing customers with PC/APP/ offline statistics, advertising effect monitoring, message push/micro community/sharing /IM and other operating tools,DIP, global index and industry reports. https://www.umeng.com/page/policy</string>
<string name="read_and_agre">Clicking Agree means you have read and agree to all of the above.。</string>
<string name="agreement">agreement</string>
<string name="come_to">Welcome to PD LIVE.</string>
<string name="come_to">Welcome to PandoraLive.</string>
<string name="live_gift">gift</string>
<string name="register_tip_2">User service agreement</string>
<string name="live_fans_medal_pri_des">一 Fan privilege 一</string>

View File

@ -14,7 +14,7 @@
android:id="@+id/rc_conversation_portrait_rl"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="@dimen/rc_margin_size_12"
android:layout_marginTop="@dimen/rc_margin_size_12"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -107,7 +107,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/rc_margin_size_16"
android:layout_marginEnd="@dimen/rc_margin_size_12"
android:text="3 月 22 日"
android:textColor="@color/rc_auxiliary_color"
android:textSize="@dimen/rc_font_nav_or_date_size"

View File

@ -207,6 +207,10 @@ public class CompleteUserInfoActivity extends AbsActivity {
avatar.setTag("https://downs.yaoulive.com/defaultblue.jpg");
avatarChange.setOnClickListener(view -> {
UserAvatarPopup userAvatarPopup = new UserAvatarPopup(this, userAvatar1 -> {
if(StringUtil.isEmpty(userAvatar1)){
ToastUtil.show(R.string.upload_fail);
return;
}
avatar.setTag(userAvatar1);
ImgLoader.display(this, userAvatar1, avatar);
//txtChoose.setVisibility(View.GONE);
@ -230,6 +234,11 @@ public class CompleteUserInfoActivity extends AbsActivity {
onSuccessToUrl(file, new OnItemClickListener<String>() {
@Override
public void onItemClick(String bean, int position) {
if(StringUtil.isEmpty(bean)){
ToastUtil.show(R.string.upload_fail);
loading.dismiss();
return;
}
avatar.setTag(bean);
ImgLoader.display(mContext, bean, avatar);
loading.dismiss();

View File

@ -93,6 +93,7 @@ import com.yunbao.common.manager.APKManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.NoviceInstructorManager;
import com.yunbao.common.manager.OpenAdManager;
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
@ -235,6 +236,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
@Override
public void run() {
ConversationIMListManager.get(mContext).addUserInfoProvider();
MessageIMManager.get(mContext).resetImUnReadMessageCount(mContext);
}
}, 1000);
UserInfoManager.updateMyInfo(this, null);

View File

@ -86,6 +86,12 @@ public class MainMsgAddressBookListAdapter extends BaseAdapter<MessageChatUserBe
} else {
bindList(holder, position);
}
View avatar = holder.getView(R.id.rc_conversation_portrait);
if(avatar!=null){
avatar.setOnClickListener(view -> {
RouteUtil.forwardUserHome(mDataList.get(position).getId());
});
}
holder.getConvertView().setTag(mDataList.get(position));
holder.getConvertView().setOnClickListener(view -> {
AppManager.runDebugCode(new Runnable() {

View File

@ -34,63 +34,53 @@
app:layout_constraintStart_toStartOf="@+id/titleView"
app:layout_constraintTop_toBottomOf="@+id/titleView" />
<ScrollView
android:layout_width="0dp"
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
app:layout_constraintBottom_toTopOf="@+id/buttons"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/number"
android:layout_marginBottom="10dp"
android:layout_height="0dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_marginTop="20dp"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="4"
tools:listitem="@layout/item_edit_user_hobby" />
<LinearLayout
android:id="@+id/buttons"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/number">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="4"
tools:listitem="@layout/item_edit_user_hobby" />
<LinearLayout
android:orientation="horizontal"
android:layout_marginBottom="112dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/btn_cancel"
android:layout_width="122dp"
android:layout_height="54dp"
android:textAllCaps="false"
android:background="@drawable/dialog_bg_chat_status_config_cuia"
android:text="@string/edit_profile_hobby_cancel"
/>
<Button
android:id="@+id/btn_save"
android:layout_width="186dp"
android:layout_height="54dp"
android:textColor="#FFFFFF"
android:layout_marginStart="21dp"
android:background="@drawable/bg_msg_address_book_user_btn_fan_cuia"
android:textAllCaps="false"
android:text="@string/back_community_sure" />
</LinearLayout>
</LinearLayout>
</ScrollView>
app:layout_constraintTop_toBottomOf="@+id/recyclerView"
android:orientation="horizontal"
android:layout_marginBottom="112dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/btn_cancel"
android:layout_width="122dp"
android:layout_height="54dp"
android:textAllCaps="false"
android:background="@drawable/dialog_bg_chat_status_config_cuia"
android:text="@string/edit_profile_hobby_cancel"
/>
<Button
android:id="@+id/btn_save"
android:layout_width="186dp"
android:layout_height="54dp"
android:textColor="#FFFFFF"
android:layout_marginStart="21dp"
android:background="@drawable/bg_msg_address_book_user_btn_fan_cuia"
android:textAllCaps="false"
android:text="@string/back_community_sure" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -136,8 +136,9 @@
<View
android:id="@+id/v_table_redpoint_me"
android:layout_width="12dp"
tools:visibility="visible"
android:layout_height="12dp"
android:layout_marginTop="2dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="20dp"
android:background="@drawable/background_ff5075"
android:visibility="gone" />