同步PD修复内容:
fix[修復小窗播放白屏問題] 潘多拉: 调整回融云拦截声音&震动 消息通知调用声音&震动
This commit is contained in:
parent
65b045ca61
commit
0ff76e1e47
@ -58,6 +58,7 @@ import com.yunbao.common.utils.GoogleUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MessageChatNotifyManager;
|
||||
import com.yunbao.common.utils.MessageSayHiNotifyManager;
|
||||
import com.yunbao.common.utils.SoundUtils;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
@ -369,6 +370,7 @@ public class AppContext extends CommonAppContext {
|
||||
if (message.getReceivedStatus().isRead()) {
|
||||
return false;
|
||||
}
|
||||
SoundUtils.playNotificationSound(AppManager.getInstance().getMainActivity());
|
||||
RongIMClient.getInstance().getUnreadCount(Conversation.ConversationType.PRIVATE, message.getTargetId(), new RongIMClient.ResultCallback<Integer>() {
|
||||
@Override
|
||||
public void onSuccess(Integer integer) {
|
||||
|
@ -26,6 +26,7 @@ import com.yunbao.common.custom.RatioRoundImageView;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.SoundUtils;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.ViewUtils;
|
||||
@ -128,7 +129,7 @@ public class MessageSayHiNotifyDialog extends AbsDialogCenterPopupWindow {
|
||||
)
|
||||
);
|
||||
showTag();
|
||||
playNotificationSound();
|
||||
SoundUtils.playNotificationSound(mContext);
|
||||
}
|
||||
|
||||
private void showTag() {
|
||||
@ -182,21 +183,5 @@ public class MessageSayHiNotifyDialog extends AbsDialogCenterPopupWindow {
|
||||
});
|
||||
}
|
||||
|
||||
public void playNotificationSound() {
|
||||
try {
|
||||
|
||||
Uri ringUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
||||
MediaPlayer mMediaPlayer = new MediaPlayer();
|
||||
mMediaPlayer.setDataSource(mContext, ringUri);
|
||||
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_NOTIFICATION);
|
||||
mMediaPlayer.setLooping(false);
|
||||
mMediaPlayer.prepare();
|
||||
mMediaPlayer.start();
|
||||
|
||||
Vibrator vibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
|
||||
vibrator.vibrate(new long[]{150, 250, 150, 250}, -1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
28
common/src/main/java/com/yunbao/common/utils/SoundUtils.java
Normal file
28
common/src/main/java/com/yunbao/common/utils/SoundUtils.java
Normal file
@ -0,0 +1,28 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.media.RingtoneManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Vibrator;
|
||||
|
||||
public class SoundUtils {
|
||||
public static void playNotificationSound(Context mContext) {
|
||||
try {
|
||||
|
||||
Uri ringUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
||||
MediaPlayer mMediaPlayer = new MediaPlayer();
|
||||
mMediaPlayer.setDataSource(mContext, ringUri);
|
||||
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_NOTIFICATION);
|
||||
mMediaPlayer.setLooping(false);
|
||||
mMediaPlayer.prepare();
|
||||
mMediaPlayer.start();
|
||||
|
||||
Vibrator vibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
|
||||
vibrator.vibrate(new long[]{150, 250, 150, 250}, -1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -4,8 +4,8 @@ ext {
|
||||
buildToolsVersion: "29.0.2",
|
||||
minSdkVersion : 23,
|
||||
targetSdkVersion : 33,
|
||||
versionCode : 529,
|
||||
versionName : "6.7.0",
|
||||
versionCode : 531,
|
||||
versionName : "6.7.1",
|
||||
namespace : "com.pandoralive.shayu"
|
||||
]
|
||||
manifestPlaceholders = [
|
||||
@ -26,7 +26,7 @@ ext {
|
||||
// true表示谷歌支付 false
|
||||
// isGooglePlay : false,
|
||||
// true表示谷歌支付 false 0 链接包(isPluginModel-> true) 1 谷歌包 2华为包 3 samsung包
|
||||
isGooglePlay : 0,
|
||||
isGooglePlay : 1,
|
||||
|
||||
//是否上报异常日志
|
||||
isUploadLog : true,
|
||||
|
@ -19,6 +19,7 @@ import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
@ -56,6 +57,7 @@ import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.LiveSudGameHistoryPopup;
|
||||
import com.yunbao.common.views.TopGradual;
|
||||
import com.yunbao.common.views.floatingview.APPEasyFloat;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.dialog.LiveUserDialogFragment;
|
||||
|
||||
@ -102,6 +104,9 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M
|
||||
Bus.getOn(this);
|
||||
super.main();
|
||||
initView();
|
||||
//进游戏房就关掉小窗
|
||||
EasyFloat.dismiss("LiveFloatView", true);
|
||||
APPEasyFloat.getInstance().dismiss(mContext);
|
||||
initDate();
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,7 @@ import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.LiveSudGameHistoryPopup;
|
||||
import com.yunbao.common.views.TopGradual;
|
||||
import com.yunbao.common.views.floatingview.APPEasyFloat;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.dialog.LiveUserDialogFragment;
|
||||
|
||||
@ -110,6 +111,9 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
Bus.getOn(this);
|
||||
super.main();
|
||||
initView();
|
||||
//进游戏房就关掉小窗
|
||||
EasyFloat.dismiss("LiveFloatView", true);
|
||||
APPEasyFloat.getInstance().dismiss(mContext);
|
||||
initDate();
|
||||
}
|
||||
|
||||
@ -133,8 +137,6 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
|
||||
}
|
||||
});
|
||||
//进游戏房就关掉小窗
|
||||
EasyFloat.dismiss("LiveFloatView", true);
|
||||
|
||||
// 设置禁用麦克风采集
|
||||
//RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(disable);
|
||||
|
@ -630,6 +630,9 @@ public class LivePlaySwViewHolder extends LiveRoomPlayViewHolder {
|
||||
mEnd = true;
|
||||
mStarted = false;
|
||||
Bus.getOff(this);
|
||||
if(ry_view!=null){
|
||||
ry_view.removeAllViews();
|
||||
}
|
||||
EventBus.getDefault().unregister(this);
|
||||
//swAuManager.exitChannelAll();
|
||||
L.e(TAG, "release------->");
|
||||
|
@ -479,7 +479,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
}
|
||||
isInstructor();
|
||||
|
||||
/*RongConfigCenter.notificationConfig().setInterceptor(new NotificationConfig.Interceptor() {
|
||||
RongConfigCenter.notificationConfig().setInterceptor(new NotificationConfig.Interceptor() {
|
||||
@Override
|
||||
public boolean isNotificationIntercepted(Message message) {
|
||||
return true;
|
||||
@ -499,7 +499,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
public NotificationChannel onRegisterChannel(NotificationChannel notificationChannel) {
|
||||
return null;
|
||||
}
|
||||
});*/
|
||||
});
|
||||
RxView.clicks(findViewById(R.id.banner_click)).throttleFirst(2, TimeUnit.SECONDS).subscribe(new Observer<Unit>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
@ -75,9 +75,9 @@
|
||||
<bool name="rc_enable_send_combine_message">false</bool>
|
||||
|
||||
<!--在前台非会话页面时,接收到新消息是否响铃 -->
|
||||
<bool name="rc_sound_in_foreground">true</bool>
|
||||
<bool name="rc_sound_in_foreground">false</bool>
|
||||
<!--在前台非会话页面时,接收到新消息是否震动-->
|
||||
<bool name="rc_vibrate_in_foreground">true</bool>
|
||||
<bool name="rc_vibrate_in_foreground">false</bool>
|
||||
|
||||
|
||||
<!--会话页面右上角的未读 @ 消息数提示,当收到的消息中有 @ 消息时,进入会话之后,是否在右上角提示未读 @ 消息数-->
|
||||
|
Loading…
Reference in New Issue
Block a user