diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index 414d111f3..48eb61e90 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -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() { @Override public void onSuccess(Integer integer) { 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 25b19bbb8..b4d000cbb 100644 --- a/common/src/main/java/com/yunbao/common/dialog/MessageSayHiNotifyDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/MessageSayHiNotifyDialog.java @@ -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(); - } - } } diff --git a/common/src/main/java/com/yunbao/common/utils/SoundUtils.java b/common/src/main/java/com/yunbao/common/utils/SoundUtils.java new file mode 100644 index 000000000..4d9caf0bd --- /dev/null +++ b/common/src/main/java/com/yunbao/common/utils/SoundUtils.java @@ -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(); + } + } +} diff --git a/config.gradle b/config.gradle index 934289805..de86dd339 100644 --- a/config.gradle +++ b/config.gradle @@ -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, diff --git a/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java b/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java index 719666c70..1a568cb1f 100644 --- a/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java @@ -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(); } diff --git a/live/src/main/java/com/yunbao/live/activity/SudSwGameActivity.java b/live/src/main/java/com/yunbao/live/activity/SudSwGameActivity.java index d8cd07071..8d442c8db 100644 --- a/live/src/main/java/com/yunbao/live/activity/SudSwGameActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/SudSwGameActivity.java @@ -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); diff --git a/live/src/main/java/com/yunbao/live/views/LivePlaySwViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlaySwViewHolder.java index 8ce62f8a6..d72767c8e 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlaySwViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlaySwViewHolder.java @@ -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------->"); diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 6fcea97c5..28706b7b0 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -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() { @Override public void onSubscribe(Disposable d) { diff --git a/main/src/main/res/values/rc_config.xml b/main/src/main/res/values/rc_config.xml index d7d420bc4..7d5e06dcd 100644 --- a/main/src/main/res/values/rc_config.xml +++ b/main/src/main/res/values/rc_config.xml @@ -75,9 +75,9 @@ false - true + false - true + false