添加媒体播放状态改变监听
This commit is contained in:
@@ -13,6 +13,7 @@ import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.module.carchattingprovider.ICallProviderResponse;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.glide.SkinAbleBitmapTarget;
|
||||
import com.mogo.module.media.MediaConstants;
|
||||
import com.mogo.module.media.R;
|
||||
@@ -269,6 +270,8 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener {
|
||||
if (mCircleImg != null) {
|
||||
mCircleImg.startAnim();
|
||||
}
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setMediaPlayStatus(TAG, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -282,6 +285,8 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener {
|
||||
if (mCircleImg != null) {
|
||||
mCircleImg.stopAnim();
|
||||
}
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setMediaPlayStatus(TAG,false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -296,7 +301,7 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener {
|
||||
mCircleImg.stopAnim();
|
||||
}
|
||||
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setMediaPlayStatus(TAG,false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -116,6 +116,19 @@ public interface IMogoStatusManager extends IProvider {
|
||||
*/
|
||||
boolean isMainPageLaunched();
|
||||
|
||||
/**
|
||||
* 媒体是否正在播放
|
||||
* @return true - 正在播放 false - 没有播放
|
||||
*/
|
||||
boolean isMediaPlaying();
|
||||
|
||||
/**
|
||||
* 设置媒体播放状态
|
||||
* @param tag 业务类型
|
||||
* @param status true - 正在播放 false - 未在播放
|
||||
*/
|
||||
void setMediaPlayStatus(String tag, boolean status);
|
||||
|
||||
/**
|
||||
* 设置topView展示状态
|
||||
* @param tag 业务类型
|
||||
|
||||
@@ -82,5 +82,9 @@ public enum StatusDescriptor {
|
||||
/**
|
||||
* topView展示状态
|
||||
*/
|
||||
TOP_VIEW
|
||||
TOP_VIEW,
|
||||
/**
|
||||
* 媒体播放状态
|
||||
*/
|
||||
MEDIA_PLAYER_STATUS
|
||||
}
|
||||
|
||||
@@ -127,6 +127,16 @@ public class MogoStatusManager implements IMogoStatusManager {
|
||||
return get_bool_val(StatusDescriptor.TOP_VIEW);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMediaPlaying() {
|
||||
return get_bool_val( StatusDescriptor.MEDIA_PLAYER_STATUS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMediaPlayStatus(String tag, boolean status) {
|
||||
doSetStatus(tag, StatusDescriptor.MEDIA_PLAYER_STATUS, status);
|
||||
}
|
||||
|
||||
private boolean get_bool_val(StatusDescriptor descriptor ) {
|
||||
Boolean val = mStatus.get( descriptor );
|
||||
return val == null ? false : val;
|
||||
|
||||
Reference in New Issue
Block a user