Merge branch 'qa' into dev
This commit is contained in:
@@ -68,13 +68,27 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
|
||||
});
|
||||
|
||||
kwapi.registerPlayerStatusListener((playerStatus, music) -> {
|
||||
Logger.d(TAG, "onPlayerStatusListener: " + playerStatus);
|
||||
Log.d(TAG, "onPlayerStatusListener: " + playerStatus);
|
||||
Logger.d(TAG, "onPlayerStatusListener: " + playerStatus + " music: " + music.name);
|
||||
switch (playerStatus) {
|
||||
case BUFFERING:
|
||||
if (currentMedia.getMediaName() == null || !currentMedia.getMediaName().equals(music.name)) {
|
||||
// 说明是切了新歌,需要及时同步一下状态
|
||||
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PLAYING);
|
||||
currentMedia.setMediaName(music.name);
|
||||
currentMedia.setMediaImg("");
|
||||
mView.onMediaInfoChanged(currentMedia);
|
||||
mView.onMusicPlaying();
|
||||
}
|
||||
kwapi.getSongPicUrl(music, onGetSongImgUrlListener);
|
||||
break;
|
||||
case PLAYING:
|
||||
if (currentMedia.getMediaName() == null || !currentMedia.getMediaName().equals(music.name)) {
|
||||
// 说明是切了新歌,需要及时同步一下状态
|
||||
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PLAYING);
|
||||
currentMedia.setMediaName(music.name);
|
||||
currentMedia.setMediaImg("");
|
||||
mView.onMediaInfoChanged(currentMedia);
|
||||
}
|
||||
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PLAYING);
|
||||
kwapi.getSongPicUrl(music, onGetSongImgUrlListener);
|
||||
startTrackTrackProgress();
|
||||
@@ -105,6 +119,43 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
|
||||
if (!isBind) {
|
||||
// 未绑定,需要重新绑定,同时第一次绑定初始化也是在此处
|
||||
kwapi.bindAutoSdkService();
|
||||
}else if(kwapi.isKuwoRunning()){
|
||||
Music currentMusic = kwapi.getNowPlayingMusic();
|
||||
if (currentMedia.getMediaName() == null && currentMusic != null) {
|
||||
// 当前处于绑定状态,且有音乐信息,需判断是否正在播放,进行界面刷新
|
||||
Log.d(TAG, "step1==" + currentMusic.name);
|
||||
if (kwapi.getPlayerStatus() == PlayerStatus.BUFFERING || kwapi.getPlayerStatus() == PlayerStatus.PLAYING) {
|
||||
Logger.d(TAG, "当前可能正在播放音乐,需要更新=1=" + currentMusic.name);
|
||||
currentMedia.setMediaName(currentMusic.name);
|
||||
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PLAYING);
|
||||
mView.onMediaInfoChanged(currentMedia);
|
||||
mView.onMusicPlaying();
|
||||
kwapi.getSongPicUrl(currentMusic, onGetSongImgUrlListener);
|
||||
} else if (kwapi.getPlayerStatus() == PlayerStatus.INIT) {
|
||||
Logger.d(TAG, "当前可能正在播放音乐,需要更新=3=" + currentMusic.name);
|
||||
currentMedia.setMediaName(currentMusic.name);
|
||||
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PAUSE_OR_STOP);
|
||||
mView.onMediaInfoChanged(currentMedia);
|
||||
mView.onMusicStopped();
|
||||
}
|
||||
} else if (currentMedia.getMediaName() != null && currentMusic != null && !currentMedia.getMediaName().equals(currentMusic.name)) {
|
||||
Log.d(TAG, "step2==media: " + currentMedia.getMediaName() + " " +
|
||||
"musicName: " + currentMusic.name + " status: " + kwapi.getPlayerStatus());
|
||||
if (kwapi.getPlayerStatus() == PlayerStatus.BUFFERING || kwapi.getPlayerStatus() == PlayerStatus.PLAYING) {
|
||||
Logger.d(TAG, "当前可能正在播放音乐,需要更新=2=" + currentMusic.name);
|
||||
currentMedia.setMediaName(currentMusic.name);
|
||||
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PLAYING);
|
||||
mView.onMediaInfoChanged(currentMedia);
|
||||
mView.onMusicPlaying();
|
||||
kwapi.getSongPicUrl(currentMusic, onGetSongImgUrlListener);
|
||||
}else if (kwapi.getPlayerStatus() == PlayerStatus.INIT) {
|
||||
Logger.d(TAG, "当前可能正在播放音乐,需要更新=4=" + currentMusic.name);
|
||||
currentMedia.setMediaName(currentMusic.name);
|
||||
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PAUSE_OR_STOP);
|
||||
mView.onMediaInfoChanged(currentMedia);
|
||||
mView.onMusicStopped();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.NinePatchDrawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
@@ -32,7 +33,8 @@ public class AnimCircleImageView extends ImageView {
|
||||
int savedDegree;
|
||||
boolean isRotateEnable;
|
||||
boolean isRotating;
|
||||
private int delayMilliseconds = 450;
|
||||
// private int delayMilliseconds = 450;
|
||||
private int delayMilliseconds = 2000;
|
||||
private int mRotateAngleStep = 3;
|
||||
|
||||
public AnimCircleImageView(Context context) {
|
||||
@@ -79,6 +81,7 @@ public class AnimCircleImageView extends ImageView {
|
||||
}
|
||||
|
||||
public void startAnim() {
|
||||
Log.d("AnimCircle", "startAnim====" + isRotating);
|
||||
if (isRotating){
|
||||
return;
|
||||
}
|
||||
@@ -86,9 +89,12 @@ public class AnimCircleImageView extends ImageView {
|
||||
isRotating = true;
|
||||
currentDegree = savedDegree;
|
||||
invalidate();
|
||||
Log.d("AnimCircle", "invalidate==");
|
||||
}
|
||||
|
||||
public void stopAnim() {
|
||||
Log.d("AnimCircle", "stopAnim===");
|
||||
removeCallbacks(loopInvalidate);
|
||||
isRotating = false;
|
||||
isRotateEnable = false;
|
||||
savedDegree = currentDegree;
|
||||
@@ -100,7 +106,7 @@ public class AnimCircleImageView extends ImageView {
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
|
||||
Log.d("AnimCircle", "onDraw====");
|
||||
try {
|
||||
if (mDrawbleSrc == null)
|
||||
return;
|
||||
@@ -146,7 +152,9 @@ public class AnimCircleImageView extends ImageView {
|
||||
canvas.drawBitmap(output, defaultWidth / 2 - radius, defaultHeight / 2 - radius, null);
|
||||
canvas.restore();
|
||||
if (isRotateEnable) {
|
||||
postInvalidateDelayed(delayMilliseconds);
|
||||
removeCallbacks(loopInvalidate);
|
||||
postDelayed(loopInvalidate, delayMilliseconds);
|
||||
// postInvalidateDelayed(delayMilliseconds);
|
||||
}
|
||||
} else {
|
||||
canvas.save();
|
||||
@@ -161,6 +169,8 @@ public class AnimCircleImageView extends ImageView {
|
||||
|
||||
}
|
||||
|
||||
private Runnable loopInvalidate = this::invalidate;
|
||||
|
||||
private Bitmap getCuttedPicture(Drawable DrawbleSrc) {
|
||||
Bitmap mBitmapOrigin = ((BitmapDrawable) DrawbleSrc).getBitmap();
|
||||
int mWidth = mBitmapOrigin.getWidth();
|
||||
|
||||
@@ -184,10 +184,14 @@ public class MediaWindow2 implements IMusicView {
|
||||
}
|
||||
|
||||
if (mCircleImg != null) {
|
||||
com.bumptech.glide.request.RequestOptions options =
|
||||
new com.bumptech.glide.request.RequestOptions()
|
||||
.placeholder(R.drawable.module_media_default_music_img);
|
||||
GlideApp.with(mContext).applyDefaultRequestOptions(options).load(mMediaInfoData.getMediaImg()).into(mCircleImg);
|
||||
if(mMediaInfoData!=null&&mMediaInfoData.getMediaImg()!=null&&!mMediaInfoData.getMediaImg().isEmpty()) {
|
||||
com.bumptech.glide.request.RequestOptions options =
|
||||
new com.bumptech.glide.request.RequestOptions()
|
||||
.placeholder(R.drawable.module_media_default_music_img);
|
||||
GlideApp.with(mContext).applyDefaultRequestOptions(options).load(mMediaInfoData.getMediaImg()).into(mCircleImg);
|
||||
}else{
|
||||
mCircleImg.setImageResource(R.drawable.module_media_default_music_img);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -474,10 +474,10 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
|
||||
private void stopAutoRefreshStrategy() {
|
||||
stopAutoRefreshStrategy(true);
|
||||
stopAutoRefreshStrategy( true );
|
||||
}
|
||||
|
||||
private void stopAutoRefreshStrategy(boolean stopOnlineCarRefresh) {
|
||||
private void stopAutoRefreshStrategy( boolean stopOnlineCarRefresh ) {
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
@@ -714,6 +714,13 @@ public class MogoServices implements IMogoMapListener,
|
||||
case ACC_STATUS:
|
||||
if ( isTrue ) {
|
||||
mADASController.showADAS();
|
||||
refreshStrategy();
|
||||
} else {
|
||||
try {
|
||||
MarkerServiceHandler.getApis().getMapServiceApi().getMarkerManager( mContext ).removeMarkers();
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -756,7 +763,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
Logger.w( TAG, "ignore refresh request case time < 0" );
|
||||
return;
|
||||
}
|
||||
stopAutoRefreshStrategy(stopOnlineCarRefresh);
|
||||
stopAutoRefreshStrategy( stopOnlineCarRefresh );
|
||||
mRefreshRemainingTime = time;
|
||||
long delay = ServiceConst.DECREASE_INTERVAL;
|
||||
if ( mRefreshRemainingTime < ServiceConst.DECREASE_INTERVAL ) {
|
||||
|
||||
@@ -349,8 +349,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
}
|
||||
int size = getAppropriateSize( maxAmount, exploreWayList );
|
||||
Map< String, IMogoMarker > existCarMap = purgeMarkerData( exploreWayList, ModuleNames.CARD_TYPE_ROAD_CONDITION );
|
||||
Logger.i( TAG, "existCarMap: size = %d", existCarMap.size() );
|
||||
for ( int i = 0; i < size; i++ ) {
|
||||
Logger.i( TAG, "existCarMap: size = %d", existCarMap.size() );for ( int i = 0; i < size; i++ ) {
|
||||
MarkerExploreWay markerExploreWay = exploreWayList.get( i );
|
||||
if ( !markerExploreWay.getCanLive() ) {
|
||||
MarkerLocation markerLocation = markerExploreWay.getLocation();
|
||||
|
||||
Reference in New Issue
Block a user