1. 综合产品需求以及爱趣听提供能力,最终和产品确认,初始状态音频框不显示,用户主动播放一次后,音频浮框显示,直到acc-off才消失,下次acc-on后不显示;
This commit is contained in:
@@ -15,7 +15,7 @@ import com.mogo.module.apps.R;
|
||||
*/
|
||||
public enum AppEnum {
|
||||
// 爱趣听
|
||||
WeCarFlow("爱趣听","com.tencent.wecarflow", R.drawable.module_apps_ic_qq_music ),
|
||||
WeCarFlow("爱趣听","com.tencent.wecarflow", R.drawable.module_apps_ic_we_car_flow ),
|
||||
//"QQ音乐",
|
||||
QQMusic( "QQ音乐", "com.pvetec.musics", R.drawable.module_apps_ic_qq_music ),
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
@@ -33,7 +33,7 @@ public class MediaWindow2 implements IMusicView {
|
||||
private Context mContext;
|
||||
private WeCarFlowPresenter mPresenter;
|
||||
|
||||
private MediaInfoData mMediaInfoData = null;
|
||||
private MediaInfoData mMediaInfoData = new MediaInfoData();
|
||||
|
||||
private View mWindowView;
|
||||
private AnimCircleImageView mCircleImg;
|
||||
@@ -97,11 +97,11 @@ public class MediaWindow2 implements IMusicView {
|
||||
if (mMediaInfoData != null) {
|
||||
if (mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PAUSE_OR_STOP) {
|
||||
mPresenter.play(mMediaInfoData);
|
||||
}else{
|
||||
} else {
|
||||
// 没有做详细判断,不是暂停就是播放
|
||||
mPresenter.pause(mMediaInfoData);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
openAqtApp();
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,9 @@ public class MediaWindow2 implements IMusicView {
|
||||
return;
|
||||
}
|
||||
if (mMediaInfoData != null) {
|
||||
if (mMediaInfoData.getType() == 1 || mMediaInfoData.getType() == 2 || mMediaInfoData.getType() == 3) {
|
||||
if (mMediaInfoData.getType() == MusicConstant.PLAY_STATE_ERROR||isFirstPlay) {
|
||||
mWindowView.setVisibility(View.GONE);
|
||||
} else {
|
||||
mWindowView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
@@ -164,7 +166,9 @@ public class MediaWindow2 implements IMusicView {
|
||||
|
||||
@Override
|
||||
public void onMusicPlaying() {
|
||||
Logger.d(TAG, "onMusicPlaying");
|
||||
Logger.d(TAG, "onMusicPlaying===" + mMediaInfoData);
|
||||
isFirstPlay = false;
|
||||
updateWindowUI(false);
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_play);
|
||||
}
|
||||
@@ -176,7 +180,7 @@ public class MediaWindow2 implements IMusicView {
|
||||
|
||||
@Override
|
||||
public void onMusicPause() {
|
||||
Logger.d(TAG, "onMusicPause: ");
|
||||
Logger.d(TAG, "onMusicPause: ===" + mMediaInfoData);
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
|
||||
}
|
||||
@@ -188,7 +192,7 @@ public class MediaWindow2 implements IMusicView {
|
||||
|
||||
@Override
|
||||
public void onMusicStopped() {
|
||||
Logger.d(TAG, "onMusicStopped");
|
||||
Logger.d(TAG, "onMusicStopped===" + mMediaInfoData);
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
|
||||
}
|
||||
@@ -200,18 +204,16 @@ public class MediaWindow2 implements IMusicView {
|
||||
|
||||
@Override
|
||||
public void onMediaInfoChanged(MediaInfoData mediaInfoData) {
|
||||
if(!isFirstPlay) {
|
||||
mMediaInfoData = mediaInfoData;
|
||||
addWindowView();
|
||||
updateWindowUI();
|
||||
}
|
||||
isFirstPlay = false;
|
||||
Logger.d(TAG, "onMediaInfoChanged: " + mediaInfoData);
|
||||
mMediaInfoData = mediaInfoData;
|
||||
addWindowView();
|
||||
updateWindowUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMusicProgress(long current, long total) {
|
||||
// Logger.d(TAG, "onMusicProgress==current: " + current + " total: " + total);
|
||||
if(mMediaInfoData!=null) {
|
||||
if (mMediaInfoData != null) {
|
||||
mMediaInfoData.setCurTime((int) current);
|
||||
mMediaInfoData.setMaxTime((int) total);
|
||||
}
|
||||
@@ -230,9 +232,9 @@ public class MediaWindow2 implements IMusicView {
|
||||
}
|
||||
}
|
||||
|
||||
private void openAqtApp(){
|
||||
private void openAqtApp() {
|
||||
try {
|
||||
LaunchUtils.launchByPkg(mContext,"com.tencent.wecarflow");
|
||||
LaunchUtils.launchByPkg(mContext, "com.tencent.wecarflow");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.module.media.model;
|
||||
|
||||
import com.mogo.module.media.constants.MusicConstant;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class MediaInfoData implements Serializable {
|
||||
|
||||
@@ -76,7 +76,6 @@ public class WeCarFlowPresenter extends BaseMediaPresenter<IMusicView> {
|
||||
public void init(Context context) {
|
||||
this.context = context;
|
||||
currentMedia = new MediaInfoData();
|
||||
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PAUSE_OR_STOP);
|
||||
|
||||
serviceApis =
|
||||
(IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
|
||||
|
||||
Reference in New Issue
Block a user