Skip to content

Commit

Permalink
清理代码,优化命名
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoRanLiu3119 committed Nov 17, 2023
1 parent 7dfb275 commit e3b8e19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ private Notification buildNotification(){
return builder.build();
}

private NotificationCompat.Action buildNotificationAction(int iconResId, String title, PendingIntent intent) {
final IconCompat icon = IconCompat.createWithResource(App.getInstance(), iconResId);
// 创建通知栏操作
return new NotificationCompat.Action.Builder(icon, title, intent).build();
}

private PendingIntent getPendingIntentActivity() {
Intent intent = new Intent(this, DetailActivity.class);
return PendingIntent.getActivity(this, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public class DetailActivity extends BaseVbActivity<ActivityDetailBinding> {
* 是否开启后台播放标记,不在广播开启,onPause根据标记开启
*/
boolean openBackgroundPlay;
private BroadcastReceiver mPipActionReceiver;
private BroadcastReceiver mRemoteActionReceiver;

@Override
protected void init() {
Expand Down Expand Up @@ -909,7 +909,7 @@ private RemoteAction generateRemoteAction(int iconResId, int actionCode, String
*/
private void registerActionReceiver(boolean isRegister){
if (isRegister) {
mPipActionReceiver = new BroadcastReceiver() {
mRemoteActionReceiver = new BroadcastReceiver() {

@Override
public void onReceive(Context context, Intent intent) {
Expand All @@ -931,11 +931,11 @@ public void onReceive(Context context, Intent intent) {
}
}
};
registerReceiver(mPipActionReceiver, new IntentFilter(Constants.BROADCAST_ACTION));
registerReceiver(mRemoteActionReceiver, new IntentFilter(Constants.BROADCAST_ACTION));
} else {
if (mPipActionReceiver!=null){
unregisterReceiver(mPipActionReceiver);
mPipActionReceiver = null;
if (mRemoteActionReceiver !=null){
unregisterReceiver(mRemoteActionReceiver);
mRemoteActionReceiver = null;
}
if (playFragment.getPlayer().isPlaying()){// 退出画中画时,暂停播放(画中画的全屏也会触发,但全屏后会自动播放)
playFragment.getController().togglePlay();
Expand Down

0 comments on commit e3b8e19

Please sign in to comment.