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