This commit is contained in:
unknown
2020-07-22 18:13:02 +08:00
39 changed files with 380 additions and 94 deletions

2
.idea/misc.xml generated
View File

@@ -4,7 +4,7 @@
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
<groovy codeStyle="LEGACY" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
</project>

View File

@@ -163,7 +163,7 @@ android {
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
}
// 比亚迪
byd{
bydauto{
dimension "product"
// 不使用语音
buildConfigField 'int', 'AIType','0'

View File

@@ -2,7 +2,7 @@
project.dependencies {
if (Boolean.valueOf(RELEASE)) {
bydImplementation rootProject.ext.dependencies.mogobaseservicesdk
bydautoImplementation rootProject.ext.dependencies.mogobaseservicesdk
d82xImplementation rootProject.ext.dependencies.mogobaseserviceapk
em1Implementation rootProject.ext.dependencies.mogobaseserviceapk
@@ -13,7 +13,7 @@ project.dependencies {
f8xxImplementation rootProject.ext.dependencies.mogobaseserviceapk
em3Implementation rootProject.ext.dependencies.mogobaseserviceapk
} else {
bydImplementation project(':foudations:mogo-base-services-sdk')
bydautoImplementation project(':foudations:mogo-base-services-sdk')
d82xImplementation project(':foudations:mogo-base-services-apk')
em1Implementation project(':foudations:mogo-base-services-apk')

View File

@@ -4,7 +4,7 @@ project.dependencies {
if (Boolean.valueOf(RELEASE)) {
d82xImplementation rootProject.ext.dependencies.moduleventpanelnoop
em1Implementation rootProject.ext.dependencies.moduleventpanelnoop
bydImplementation rootProject.ext.dependencies.moduleventpanelnoop
bydautoImplementation rootProject.ext.dependencies.moduleventpanelnoop
d8xxImplementation rootProject.ext.dependencies.moduleventpanel
em4Implementation rootProject.ext.dependencies.moduleventpanel
@@ -14,7 +14,7 @@ project.dependencies {
} else {
d82xImplementation project(':modules:mogo-module-event-panel-noop')
em1Implementation project(':modules:mogo-module-event-panel-noop')
bydImplementation project(':modules:mogo-module-event-panel-noop')
bydautoImplementation project(':modules:mogo-module-event-panel-noop')
d8xxImplementation project(':modules:mogo-module-event-panel')
em4Implementation project(':modules:mogo-module-event-panel')

View File

@@ -4,7 +4,7 @@ project.dependencies {
if (Boolean.valueOf(RELEASE)) {
d82xImplementation rootProject.ext.dependencies.moduleleftpanel
em1Implementation rootProject.ext.dependencies.moduleleftpanel
bydImplementation rootProject.ext.dependencies.moduleleftpanel
bydautoImplementation rootProject.ext.dependencies.moduleleftpanel
d8xxImplementation rootProject.ext.dependencies.moduleleftpanelnoop
em4Implementation rootProject.ext.dependencies.moduleleftpanelnoop
@@ -15,7 +15,7 @@ project.dependencies {
} else {
d82xImplementation project(':modules:mogo-module-left-panel')
em1Implementation project(':modules:mogo-module-left-panel')
bydImplementation project(':modules:mogo-module-left-panel')
bydautoImplementation project(':modules:mogo-module-left-panel')
d8xxImplementation project(':modules:mogo-module-left-panel-noop')
em4Implementation project(':modules:mogo-module-left-panel-noop')

View File

@@ -2,6 +2,7 @@ package com.mogo.launcher;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.util.Log;
import com.alibaba.android.arouter.launcher.ARouter;
@@ -9,6 +10,7 @@ import com.auto.zhidao.logsdk.CrashSystem;
import com.bytedance.boost_multidex.BoostMultiDex;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.storage.SpStorage;
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
import com.mogo.module.carchatting.card.CallChatConstant;
import com.mogo.module.common.MogoModule;
@@ -89,6 +91,7 @@ public class MogoApplication extends AbsMogoApplication {
DebugConfig.setLauncher( BuildConfig.IS_LAUNCHER );
DebugConfig.setActiveAIAssistFlag( BuildConfig.AI_ASSIST_ACTIVE_STAUTS );
DebugConfig.setCarMachineType( BuildConfig.CAR_MACHINE_TYPE );
DebugConfig.setProductFlavor( BuildConfig.FLAVOR_product );
}
@Override
@@ -101,6 +104,7 @@ public class MogoApplication extends AbsMogoApplication {
@Override
public void onSuccess( String ticket ) {
Logger.d( TAG, "ticket = %s", ticket );
SpStorage.setTicket( ticket );
}
@Override

View File

@@ -120,7 +120,7 @@ targetSdkVersion : 22,
mogomoduleauth : "com.mogo.module:module-authorize:${MOGO_MODULE_AUTHORIZE_VERSION}",
mogomoduleguide : "com.mogo.module:module-guide:${MOGO_MODULE_GUIDE_VERSION}",
// 长链
socketsdk : 'com.zhidao.socketsdk:socketsdk:2.1.1',
socketsdk : 'com.zhidao.socketsdk:socketsdk:2.1.4',
socketsdkconnsvrprotoco : 'com.zhidao.ptech:connsvr-protoco:0.1.23',
socketsdkprotobufjava : 'com.google.protobuf:protobuf-java:3.5.1',
// OBU

View File

@@ -87,6 +87,10 @@ public class SocketManager implements IMogoSocketManager, OnSocketReceiveCallbac
}
@Override
public void onMessageReceived( byte[] content ) {
onMessageReceived( content, 0);
}
public void onMessageReceived( byte[] content, long msgId ) {
try {
MogoConnsvr.Payload payload = MogoConnsvr.Payload.parseFrom( content );

View File

@@ -34,7 +34,7 @@ dependencies {
// 长链
implementation 'com.zhidao.socket:built-in-socket:1.0.13'
// passport
implementation 'com.zhidao.tcloginsdk:tclogin:1.0.7'
implementation 'com.zhidao.loginsdk:external:1.0.0'
annotationProcessor 'com.elegant.spi:compiler:1.0.3'

View File

@@ -11,8 +11,7 @@ import com.mogo.service.passport.IMogoTicketCallback;
import com.mogo.utils.logger.Logger;
import com.zhidao.accountsdk.manager.CarPadClientManagerImpl;
import com.zhidao.accountsdk.manager.TicketInfoCallback;
import com.zhidao.accountsdk.network.NetEnvironManager;
import com.zhidao.tcloginsdk.ToCLoginManagerImpl;
import com.zhidao.tcloginsdk.LoginManagerImpl;
public
/**
@@ -95,7 +94,8 @@ class PassportManager implements IMogoPassportManager {
// 演示环境用 qa 的
mode = DebugConfig.NET_MODE_QA;
}
ToCLoginManagerImpl.getInstance( context ).setNetEnviron( mode );
ToCLoginManagerImpl.getInstance( context ).showLoginView();
LoginManagerImpl.getInstance(mContext).setClientType(DebugConfig.getProductFlavor());
LoginManagerImpl.getInstance( context ).setNetEnviron( mode );
LoginManagerImpl.getInstance( context ).showLoginView();
}
}

View File

@@ -87,6 +87,7 @@ class SocketManager implements IMogoSocketManager, Callback {
.setEnvironment( getEnvironment() )
.setClient( Platform.getClient( Platform.car ) )
.setAppId( appId )
.setOpenAnalytics( true )
.setDebug( DebugConfig.isDebug() );
SocketMessageDispatcher.getInstance().start( context );
}

View File

@@ -82,6 +82,7 @@ public class DebugConfig {
public static final int CAR_MACHINE_TYPE_BYD = 1;
private static int sCarMachineType = CAR_MACHINE_TYPE_SELF_INNOVATE;
/**
* 获取网络环境类型
*
@@ -150,17 +151,19 @@ public class DebugConfig {
/**
* 设置当前车机类型
*
* @param type {@link #CAR_MACHINE_TYPE_SELF_INNOVATE} {@link #CAR_MACHINE_TYPE_BYD}
*/
public static void setCarMachineType(int type) {
public static void setCarMachineType( int type ) {
sCarMachineType = type;
}
/**
* 获取当前车机类型
*
* @return {@link #CAR_MACHINE_TYPE_SELF_INNOVATE} {@link #CAR_MACHINE_TYPE_BYD}
*/
public static int getCarMachineType(){
public static int getCarMachineType() {
return sCarMachineType;
}
@@ -209,4 +212,19 @@ public class DebugConfig {
public static boolean isUseMockObuData() {
return useMockObuData;
}
private static String sProductFlavor;
public static String getProductFlavor() {
return sProductFlavor;
}
/**
* 产品线
*
* @param sProductFlavor
*/
public static void setProductFlavor( String sProductFlavor ) {
DebugConfig.sProductFlavor = sProductFlavor;
}
}

View File

@@ -71,7 +71,6 @@ MOGO_MODULE_GUIDESHOW_VERSION=1.0.2-SNAPSHOT
MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.2-SNAPSHOT
# 在线车辆F
MOGO_MODULE_ONLINECAR_VERSION=1.0.3.2
# 推送
MOGO_MODULE_PUSH_VERSION=1.1.5.7
MOGO_MODULE_PUSH_BASE_VERSION=1.1.5.5

View File

@@ -10,7 +10,9 @@ import com.amap.api.maps.model.BitmapDescriptorFactory;
import com.amap.api.maps.model.LatLng;
import com.amap.api.maps.model.Marker;
import com.amap.api.maps.model.MarkerOptions;
import com.amap.api.maps.model.animation.AlphaAnimation;
import com.amap.api.maps.model.animation.Animation;
import com.amap.api.maps.model.animation.AnimationSet;
import com.amap.api.maps.model.animation.ScaleAnimation;
import com.amap.api.maps.model.animation.TranslateAnimation;
import com.amap.api.maps.utils.overlay.MovingPointOverlay;
@@ -382,6 +384,47 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
mMarker.startAnimation();
}
@Override
public void startScaleAnimationWithAlpha( float fromX, float toX, float fromY, float toY, float fromAlpha, float toAlpha, int duration, Interpolator interpolator, OnMarkerAnimationListener listener ) {
if ( isDestroyed() ) {
return;
}
ScaleAnimation animationScale = new ScaleAnimation( fromX, toX, fromY, toY );
animationScale.setFillMode( Animation.FILL_MODE_FORWARDS );
AlphaAnimation alphaAnimation = new AlphaAnimation( fromAlpha, toAlpha );
alphaAnimation.setFillMode( Animation.FILL_MODE_FORWARDS );
AnimationSet animationSet = new AnimationSet( true );
animationSet.setDuration( duration );
animationSet.setInterpolator( interpolator);
animationSet.setAnimationListener( new Animation.AnimationListener() {
@Override
public void onAnimationStart() {
if ( isDestroyed() ) {
return;
}
if ( listener != null ) {
listener.onAnimStart();
}
}
@Override
public void onAnimationEnd() {
if ( isDestroyed() ) {
return;
}
if ( listener != null ) {
listener.onAnimEnd();
}
}
} );
mMarker.setAnimation( animationSet );
mMarker.startAnimation();
}
@Override
public void startJumpAnimation( float high, long duration, Interpolator interpolator, OnMarkerAnimationListener listener ) {
if ( isDestroyed() || high <= 0.0f || interpolator == null || duration < 0 ) {

View File

@@ -267,9 +267,33 @@ public interface IMogoMarker {
Interpolator interpolator,
OnMarkerAnimationListener listener );
/**
* 缩放动画
*
* @param fromX
* @param toX
* @param fromY
* @param toY
* @param fromAlpha
* @param toAlpha
* @param duration
* @param interpolator
* @param listener
*/
void startScaleAnimationWithAlpha( float fromX,
float toX,
float fromY,
float toY,
float fromAlpha,
float toAlpha,
int duration,
Interpolator interpolator,
OnMarkerAnimationListener listener );
/**
* 弹跳动画
*
* @param high
* @param duration
* @param interpolator
@@ -278,7 +302,7 @@ public interface IMogoMarker {
void startJumpAnimation( float high,
long duration,
Interpolator interpolator,
OnMarkerAnimationListener listener);
OnMarkerAnimationListener listener );
/**
* 是否是否可点击

View File

@@ -0,0 +1,36 @@
package com.mogo.module.common.wm;
import android.app.Dialog;
import android.content.Context;
import com.mogo.module.common.dialog.BaseFloatDialog;
import com.mogo.utils.logger.Logger;
/**
* 采用Dialog实现接口
*/
class DialogImpl implements IWindowManagerView {
private Dialog dialog;
@Override
public void init(WindowManagerView.WMViewParams params) {
Logger.d("DialogImpl", "init====");
dialog = new BaseFloatDialog(params.mContext);
dialog.setContentView(params.mContentView);
}
@Override
public boolean isShowing() {
return dialog.isShowing();
}
@Override
public void show() {
dialog.show();
}
@Override
public void hide() {
dialog.dismiss();
}
}

View File

@@ -0,0 +1,25 @@
package com.mogo.module.common.wm;
interface IWindowManagerView {
/**
* 初始化
* @param params contentView包装类
*/
void init(WindowManagerView.WMViewParams params);
/**
* 是否显示
* @return true - 显示中
*/
boolean isShowing();
/**
* 显示
*/
void show();
/**
* 隐藏
*/
void hide();
}

View File

@@ -0,0 +1,67 @@
package com.mogo.module.common.wm;
import android.content.Context;
import android.graphics.PixelFormat;
import android.os.Build;
import android.view.Gravity;
import android.view.WindowManager;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.utils.WindowUtils;
/**
* 采用windowManager实现接口
*/
class WindowManagerImpl implements IWindowManagerView {
private WindowManager mWindowManager;
private WindowManager.LayoutParams mLayoutParams;
private WindowManagerView.WMViewParams mParams;
private boolean isShowing;
@Override
public void init(WindowManagerView.WMViewParams params) {
mParams = params;
mWindowManager = (WindowManager) mParams.mContext.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
mLayoutParams = new WindowManager.LayoutParams();
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
mLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
} else {
mLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
}
mLayoutParams.format = PixelFormat.TRANSLUCENT;
mLayoutParams.gravity = Gravity.CENTER;
mLayoutParams.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
mLayoutParams.width = 1920;
mLayoutParams.height = 1080;
} else {
mLayoutParams.width = WindowUtils.getScreenWidth( mParams.mContext );
mLayoutParams.height = WindowUtils.getScreenHeight( mParams.mContext );
}
mLayoutParams.dimAmount = 0.5f;
mLayoutParams.x = 0;
mLayoutParams.y = 0;
}
@Override
public boolean isShowing() {
return isShowing;
}
@Override
public void show() {
if(!isShowing){
isShowing = true;
mWindowManager.addView(mParams.mContentView,mLayoutParams);
}
}
@Override
public void hide() {
if (isShowing && mParams != null) {
mWindowManager.removeView(mParams.mContentView);
isShowing = false;
}
}
}

View File

@@ -11,6 +11,7 @@ import android.view.WindowManager;
import androidx.annotation.IdRes;
import androidx.annotation.LayoutRes;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.utils.WindowUtils;
@@ -23,89 +24,57 @@ import com.mogo.utils.WindowUtils;
public class WindowManagerView {
private WMViewParams mParams;
private boolean mIsShowing;
private WindowManager mWindowManager;
private WindowManager.LayoutParams mLayoutParams;
private WindowManagerView( WMViewParams params ) {
private IWindowManagerView managerView;
private WindowManagerView(WMViewParams params) {
this.mParams = params;
init();
}
private void init() {
mWindowManager = ( WindowManager ) mParams.mContext.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
mLayoutParams = new WindowManager.LayoutParams();
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
mLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
} else {
mLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
}
mLayoutParams.format = PixelFormat.TRANSLUCENT;
mLayoutParams.gravity = Gravity.CENTER;
mLayoutParams.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
mLayoutParams.width = 1920;
mLayoutParams.height = 1080;
} else {
mLayoutParams.width = WindowUtils.getScreenWidth( mParams.mContext );
mLayoutParams.height = WindowUtils.getScreenHeight( mParams.mContext );
}
mLayoutParams.dimAmount = 0.5f;
mLayoutParams.x = 0;
mLayoutParams.y = 0;
managerView = new DialogImpl();
managerView.init(params);
// init();
}
public boolean isShowing() {
return mIsShowing;
return managerView.isShowing();
}
public < T extends View > T findViewById( @IdRes int id ) {
return mParams.mContentView.findViewById( id );
public <T extends View> T findViewById(@IdRes int id) {
return mParams.mContentView.findViewById(id);
}
public void show() {
if ( mIsShowing ) {
return;
}
mIsShowing = true;
mWindowManager.addView( mParams.mContentView, mLayoutParams );
managerView.show();
}
public void dismiss() {
if ( !mIsShowing ) {
return;
}
if ( mParams != null ) {
mWindowManager.removeViewImmediate( mParams.mContentView );
}
mIsShowing = false;
managerView.hide();
}
public static class Builder {
private WMViewParams mParams = null;
public Builder( Context context ) {
public Builder(Context context) {
mParams = new WMViewParams();
mParams.mContext = context;
}
public Builder contentView( View contentView ) {
public Builder contentView(View contentView) {
mParams.mContentView = contentView;
return this;
}
public Builder contentView( @LayoutRes int contentViewId ) {
mParams.mContentView = LayoutInflater.from( mParams.mContext ).inflate( contentViewId, null );
public Builder contentView(@LayoutRes int contentViewId) {
mParams.mContentView = LayoutInflater.from(mParams.mContext).inflate(contentViewId,
null);
return this;
}
public WindowManagerView build() {
if ( mParams.mContentView == null ) {
throw new NullPointerException( "WMViewParams#mContentView must not be null." );
if (mParams.mContentView == null) {
throw new NullPointerException("WMViewParams#mContentView must not be null.");
}
return new WindowManagerView( mParams );
return new WindowManagerView(mParams);
}
}

View File

@@ -1,9 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<corners android:radius="@dimen/module_ext_common_corner" />
<gradient android:angle="135" android:endColor="#1C1E28" android:startColor="#242737" />
</shape>
</item>
<item>
<shape>
<corners android:radius="@dimen/module_ext_common_corner" />
<gradient android:angle="135" android:endColor="#3F435F" android:startColor="#2E3141" />
<gradient android:angle="135" android:endColor="#48495E" android:startColor="#616381" />
</shape>
</item>
</selector>

View File

@@ -1,5 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<gradient android:angle="135" android:endColor="#ff113361" android:startColor="#ff124B98" android:type="linear" />
<corners android:radius="@dimen/module_ext_common_corner" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<gradient android:angle="135" android:endColor="#ff1e57a4" android:startColor="#ff1f7eff" android:type="linear" />

View File

@@ -21,6 +21,7 @@ import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.common.map.MapCenterPointStrategy;
import com.mogo.module.common.map.Scene;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.module.main.cards.MogoModulesManager;
import com.mogo.module.main.service.MogoMainService;
import com.mogo.module.main.windowview.FloatingViewHandler;
@@ -30,7 +31,6 @@ import com.mogo.service.fragmentmanager.IMogoFragmentManager;
import com.mogo.service.intent.IMogoIntentListener;
import com.mogo.service.map.IMogoMapService;
import com.mogo.service.module.IMogoModuleProvider;
import com.mogo.service.obu.IMogoObuManager;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.utils.logger.Logger;
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
@@ -244,12 +244,21 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
super.onPause();
mMogoStatusManager.setMainPageResumeStatus( TAG, false );
mMogoStatusManager.setMainPageLaunchedStatus( TAG, false );
if ( !mIsHomeKeyDown || !DebugConfig.isLauncher() ) {
if ( shouldCloseADASPanel() ) {
mServiceApis.getAdasControllerApi().closeADAS();
}
mIsHomeKeyDown = false;
}
private boolean shouldCloseADASPanel(){
// m4 系列因为按home键会造成页面pause后resume造成adas panel 闪烁
// f 系列加上上滑返回桌面后会走 mIsHomeKeyDown = true但是不会造成页面pause
// 独立 app 任何情况下都需要隐藏 adas
return !mIsHomeKeyDown
|| CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X
|| !DebugConfig.isLauncher();
}
@Override
protected void onStop() {
super.onStop();

View File

@@ -14,7 +14,6 @@ import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.mogo.utils.logger.Logger;
import cn.kuwo.autosdk.api.KWAPI;
import cn.kuwo.autosdk.api.OnGetSongImgUrlListener;
@@ -43,14 +42,14 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
kwapi = KWAPI.createKWAPI(context, "auto");
kwapi.registerConnectedListener(b -> {
Logger.d(TAG, "onConnected: " + b);
Log.d(TAG, "onConnected: " + b);
Log.d(TAG, "onConnected: " + b);
isBind = b;
if (!isBind) {
mView.onMusicStopped();
}else{
PlayerStatus currentState = kwapi.getPlayerStatus();
Logger.d(TAG, "check current status: " + currentState);
Log.d(TAG, "check current status: " + currentState);
Log.d(TAG, "check current status: " + currentState);
if(currentState == PlayerStatus.BUFFERING||currentState == PlayerStatus.PLAYING){
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PLAYING);
@@ -62,13 +61,13 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
});
kwapi.registerExitListener(() -> {
Logger.d(TAG, "onExit===");
Log.d(TAG, "onExit===");
Log.d(TAG, "onExit===");
mView.onAppExit();
});
kwapi.registerPlayerStatusListener((playerStatus, music) -> {
Logger.d(TAG, "onPlayerStatusListener: " + playerStatus + " music: " + music.name);
Log.d(TAG, "onPlayerStatusListener: " + playerStatus + " music: " + music.name);
switch (playerStatus) {
case BUFFERING:
if (currentMedia.getMediaName() == null || !currentMedia.getMediaName().equals(music.name)) {
@@ -113,7 +112,7 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
@Override
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
if (isTrue) {
Logger.d(TAG, "onResume, isBind: " + isBind);
Log.d(TAG, "onResume, isBind: " + isBind);
Log.d(TAG, "onResume, isBind: " + isBind);
// 需要在resume时候判断绑定关系是否正常
if (!isBind) {
@@ -125,14 +124,14 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
// 当前处于绑定状态,且有音乐信息,需判断是否正在播放,进行界面刷新
Log.d(TAG, "step1==" + currentMusic.name);
if (kwapi.getPlayerStatus() == PlayerStatus.BUFFERING || kwapi.getPlayerStatus() == PlayerStatus.PLAYING) {
Logger.d(TAG, "当前可能正在播放音乐,需要更新=1=" + currentMusic.name);
Log.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);
Log.d(TAG, "当前可能正在播放音乐,需要更新=3=" + currentMusic.name);
currentMedia.setMediaName(currentMusic.name);
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PAUSE_OR_STOP);
mView.onMediaInfoChanged(currentMedia);
@@ -142,14 +141,14 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
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);
Log.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);
Log.d(TAG, "当前可能正在播放音乐,需要更新=4=" + currentMusic.name);
currentMedia.setMediaName(currentMusic.name);
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PAUSE_OR_STOP);
mView.onMediaInfoChanged(currentMedia);
@@ -237,16 +236,18 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
private OnGetSongImgUrlListener onGetSongImgUrlListener = new OnGetSongImgUrlListener() {
@Override
public void onGetSongImgUrlSucessed(Music music, String s) {
currentMedia.setMediaName(music.name);
currentMedia.setMediaImg(s);
Logger.d(TAG,
"onGetSongImgUrlSucessed: " + currentMedia);
handler.post(() -> mView.onMediaInfoChanged(currentMedia));
if(currentMedia.getPlayState() == MusicConstant.PLAY_STATE_PLAYING) {
currentMedia.setMediaName(music.name);
currentMedia.setMediaImg(s);
Log.d(TAG,
"onGetSongImgUrlSucessed: " + currentMedia);
handler.post(() -> mView.onMediaInfoChanged(currentMedia));
}
}
@Override
public void onGetSongImgUrlFailed(Music music, int i) {
Logger.e(TAG, "onGetSongImgUrlFailed: " + i);
Log.e(TAG, "onGetSongImgUrlFailed: " + i);
}
};

View File

@@ -1,6 +1,7 @@
package com.mogo.module.media.window;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
@@ -101,6 +102,7 @@ public class MediaWindow2 implements IMusicView {
int statusBarHeight = WindowUtils.getStatusBarHeight(mContext);
Logger.d(TAG,
"yPos: " + yPos + " xPos: " + xPos + " statusBarHeight: " + statusBarHeight);
Log.d(TAG, "addMediaWindoView");
FrameLayout.LayoutParams params =
new FrameLayout.LayoutParams((int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_width), (int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_height));
params.leftMargin = xPos;
@@ -204,6 +206,7 @@ public class MediaWindow2 implements IMusicView {
@Override
public void onMusicPlaying() {
Logger.d(TAG, "onMusicPlaying===" + mMediaInfoData);
Log.d(TAG, "onMusicPlaying===" + mMediaInfoData);
isFirstPlay = false;
updateWindowUI(false);
if (mWindowPlayPause != null) {
@@ -218,6 +221,7 @@ public class MediaWindow2 implements IMusicView {
@Override
public void onMusicPause() {
Logger.d(TAG, "onMusicPause: ===" + mMediaInfoData);
Log.d(TAG, "onMusicPause: ===" + mMediaInfoData);
if (mWindowPlayPause != null) {
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
}
@@ -230,6 +234,7 @@ public class MediaWindow2 implements IMusicView {
@Override
public void onMusicStopped() {
Logger.d(TAG, "onMusicStopped===" + mMediaInfoData);
Log.d(TAG, "onMusicStopped===" + mMediaInfoData);
if (mWindowPlayPause != null) {
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
}
@@ -244,6 +249,7 @@ public class MediaWindow2 implements IMusicView {
@Override
public void onMediaInfoChanged(MediaInfoData mediaInfoData) {
Logger.d(TAG, "onMediaInfoChanged: " + mediaInfoData);
Log.d(TAG, "onMediaInfoChanged:" + mediaInfoData);
mMediaInfoData = mediaInfoData;
addWindowView();
updateWindowUI();

View File

@@ -715,6 +715,7 @@ public class MogoServices implements IMogoMapListener,
break;
case ACC_STATUS:
if ( isTrue ) {
initLocationServiceProcess( mContext );
mADASController.showADAS();
refreshStrategy();
MarkerServiceHandler.getApis().getMapServiceApi().getSingletonLocationClient( mContext ).stop();

View File

@@ -3,6 +3,8 @@ package com.mogo.module.service.marker;
import android.content.Context;
import android.graphics.Rect;
import android.text.TextUtils;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.LinearInterpolator;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
@@ -11,6 +13,7 @@ import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
import com.mogo.module.common.ModuleNames;
import com.mogo.module.common.entity.MarkerCarPois;
import com.mogo.module.common.entity.MarkerCardResult;
@@ -34,6 +37,7 @@ import com.mogo.service.module.IMogoBizActionDoneListener;
import com.mogo.utils.ResourcesHelper;
import com.mogo.utils.ThreadPoolService;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;
import org.json.JSONArray;
@@ -368,15 +372,42 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
IMogoMarker mogoMarker = existCarMap.get( sn );
if ( mogoMarker == null || mogoMarker.isDestroyed() ) {
Logger.d( TAG, "draw road condition, sn = %s", sn );
mogoMarker = drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH );
}
if ( mogoMarker != null ) {
mogoMarker.setVisible( true );
try {
post2AddAndStartAnimation( markerShowEntity, i * 100L );
} catch ( Exception e ) {
e.printStackTrace();
}
}
}
}
}
private void post2AddAndStartAnimation( MarkerShowEntity entity, long delay ) {
if ( entity == null ) {
return;
}
WorkThreadHandler.getInstance().postDelayed( () -> {
if ( entity == null ) {
return;
}
IMogoMarker marker = drawMapMarker( entity, ServiceConst.MARKER_Z_INDEX_HIGH );
marker.startScaleAnimationWithAlpha( 0, 1.2f, 0, 1.2f, 0f, 1f,300, new LinearInterpolator(), new OnMarkerAnimationListener() {
@Override
public void onAnimStart() {
Logger.d( TAG, " onAnimStart ---1----> " );
}
@Override
public void onAnimEnd() {
if ( marker.isDestroyed() ) {
return;
}
marker.startScaleAnimation( 1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null );
}
} );
}, delay );
}
/**
* S = (A ∩ B) B
* A ∩ B)作为旧列表需要保留的部分

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 941 B

After

Width:  |  Height:  |  Size: 950 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 941 B

After

Width:  |  Height:  |  Size: 950 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_service_marker_anchor_size">20dp</dimen>
<dimen name="module_service_marker_dot_marginTop">8dp</dimen>
<dimen name="module_service_marker_dot_marginTop">4dp</dimen>
<dimen name="module_service_marker_bubble_width">100px</dimen>
<dimen name="module_service_marker_bubble_height">117px</dimen>
<dimen name="module_service_marker_bubble_icon_width">60px</dimen>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_service_marker_anchor_size">16dp</dimen>
<dimen name="module_service_marker_dot_marginTop">4dp</dimen>
<dimen name="module_service_marker_dot_marginTop">2dp</dimen>
<dimen name="module_service_marker_bubble_width">56px</dimen>
<dimen name="module_service_marker_bubble_height">65px</dimen>
<dimen name="module_service_marker_bubble_icon_width">35px</dimen>

View File

@@ -64,6 +64,8 @@ public class LaucherShareDialog extends BaseFloatDialog implements View.OnClickL
public LaucherShareDialog(Context context) {
super(context);
// getWindow().setWindowAnimations(R.style.ShareDialogAnim);
this.mContext = context;
mApis = (IMogoServiceApis) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation(context);
mAnalytics = mApis.getAnalyticsApi();

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:interpolator="@android:anim/overshoot_interpolator"
android:fromXScale="0.0"
android:toXScale="1.0"
android:fromYScale="0.0"
android:toYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:fillAfter="true"
android:duration="400"/>
</set>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:interpolator="@android:anim/anticipate_overshoot_interpolator"
android:fromXScale="1.0"
android:toXScale="0.0"
android:fromYScale="1.0"
android:toYScale="0.0"
android:pivotX="50%"
android:pivotY="50%"
android:fillAfter="true"
android:duration="400"/>
</set>

View File

@@ -13,4 +13,9 @@
<item name="android:topDark">@color/all_transparent_white</item>
<item name="android:borderlessButtonStyle">@color/all_transparent_white</item>
</style>
<style name="ShareDialogAnim" parent="android:Animation" mce_bogus="1" >
<item name="android:windowEnterAnimation">@anim/module_share_dialog_enter_anim</item>
<item name="android:windowExitAnimation">@anim/module_share_dialog_exit_anim</item>
</style>
</resources>

View File

@@ -213,5 +213,8 @@ public class V2XSeekHelpScenario extends AbsV2XScenario<List<V2XMarkerEntity>> i
@Override
public void beforeViewRemoveAnim(View view) {
Logger.d(MODULE_NAME, "关闭 Window 开始");
// 重置场景提示的消息
setV2XMessageEntity(null);
clearPOI();
}
}