Merge branch 'dev' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into dev
2
.idea/misc.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -93,14 +93,20 @@ android {
|
||||
// f系列-分体机全系列,未细分
|
||||
f8xx{
|
||||
dimension "product"
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType','2'
|
||||
}
|
||||
// e系列
|
||||
e8xx {
|
||||
dimension "product"
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType','2'
|
||||
}
|
||||
// d系列
|
||||
d8xx {
|
||||
dimension "product"
|
||||
// 使用同行者语音
|
||||
buildConfigField 'int', 'AIType','1'
|
||||
}
|
||||
qa {
|
||||
dimension "env"
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.mogo.module.media.MediaConstants;
|
||||
import com.mogo.module.push.PushUIConstants;
|
||||
import com.mogo.module.tanlu.constant.TanluConstants;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.utils.logger.LogLevel;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -36,6 +37,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
public void onCreate() {
|
||||
DebugConfig.setNetMode(BuildConfig.NET_ENV);
|
||||
DebugConfig.setDebug(BuildConfig.DEBUG);
|
||||
DebugConfig.setAIType(BuildConfig.AIType);
|
||||
super.onCreate();
|
||||
// Crash 日志收集
|
||||
final long start = System.currentTimeMillis();
|
||||
@@ -55,6 +57,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addModule(new MogoModule(TanluConstants.TAG, TanluConstants.MODEL_NAME));
|
||||
|
||||
MogoModulePaths.addModule(new MogoModule( V2XConst.PATH_V2X_UI, V2XConst.PATH_V2X_UI));
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_SHARE, "ShareControl"));
|
||||
// 暂时去掉推送
|
||||
// MogoModulePaths.addModule(new MogoModule(PushUIConstants.TAG, PushUIConstants.TAG));
|
||||
Log.i("timer", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.commons.debug;
|
||||
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
@@ -51,6 +53,17 @@ public class DebugConfig {
|
||||
|
||||
private static int sNetMode = NET_MODE_RELEASE;
|
||||
|
||||
/**
|
||||
* 语音使用同行者
|
||||
*/
|
||||
public static final int AI_TYPE_TXZ = 1;
|
||||
/**
|
||||
* 语音使用思必驰
|
||||
*/
|
||||
public static final int AI_TYPE_SPEECH = 2;
|
||||
|
||||
private static int sAIType = AI_TYPE_TXZ;
|
||||
|
||||
/**
|
||||
* 获取网络环境类型
|
||||
*
|
||||
@@ -100,6 +113,22 @@ public class DebugConfig {
|
||||
DebugConfig.sUseCustomNavi = sUseCustomNavi;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置使用哪个语音助手
|
||||
* @param aiType {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
|
||||
*/
|
||||
public static void setAIType(int aiType){
|
||||
Logger.d("DebugConfig", "setAiType: " + aiType);
|
||||
sAIType = aiType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用哪个语音助手 {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
|
||||
*/
|
||||
public static int getAIType(){
|
||||
return sAIType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否作为launcher运行
|
||||
*/
|
||||
|
||||
@@ -380,6 +380,9 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
||||
if ( isProcessRunning( context, getPackageUid( context, "com.zhidao.speech" ) )
|
||||
&& isProcessRunning( context, getPackageUid( context, "com.zhidao.speech.adapter" ) ) ) {
|
||||
return true;
|
||||
} else if (isProcessRunning(context, getPackageUid(context, "com.txznet.txz")) && isProcessRunning(context, getPackageUid(context, "com.txznet.adapter"))) {
|
||||
Logger.d(TAG, "txz is voiceServiceReady");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -16,14 +16,12 @@ public class NavigatorApps {
|
||||
private static AppInfo app = new AppInfo( "导航", "com.mogo.launcher.navi.search", "", 0, null, R.drawable.module_apps_ic_navigator_navi, 1 );
|
||||
private static AppInfo app_ = new AppInfo( "导航", "com.mogo.launcher.navi.search", "", 0, null, R.drawable.module_apps_ic_navigator_navi_disable, 1 );
|
||||
private static AppInfo app2 = new AppInfo( "音乐", "com.pvetec.musics", "", 0, null, R.drawable.module_apps_ic_navigator_media, 2 );
|
||||
private static AppInfo app3 = new AppInfo( "个人中心", "com.zhidao.auto.personal", "", 0, null, R.drawable.module_apps_ic_navigator_personcenter, 3 );
|
||||
private static AppInfo app4 = new AppInfo( "全部应用", "com.mogo.launcher.applist", "", 0, null, R.drawable.module_apps_ic_navigator_applist, 4 );
|
||||
|
||||
public static List< AppInfo > getApps() {
|
||||
List< AppInfo > sApps = new ArrayList<>();
|
||||
sApps.add( app );
|
||||
sApps.add( app2 );
|
||||
// sApps.add( app3 );
|
||||
sApps.add( app4 );
|
||||
return sApps;
|
||||
}
|
||||
@@ -32,7 +30,6 @@ public class NavigatorApps {
|
||||
List< AppInfo > sApps = new ArrayList<>();
|
||||
sApps.add( app );
|
||||
sApps.add( app2 );
|
||||
// sApps.add( app3 );
|
||||
sApps.add( app4 );
|
||||
return sApps;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
@@ -51,7 +51,7 @@ dependencies {
|
||||
api rootProject.ext.dependencies.mogoserviceapi
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
implementation rootProject.ext.dependencies.moduleshare
|
||||
implementation rootProject.ext.dependencies.mogomoduleauth
|
||||
// implementation rootProject.ext.dependencies.mogomoduleauth
|
||||
} else {
|
||||
api project(":libraries:mogo-map")
|
||||
api project(":libraries:mogo-map-api")
|
||||
@@ -60,7 +60,7 @@ dependencies {
|
||||
api project(':services:mogo-service-api')
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':modules:mogo-module-share')
|
||||
implementation project(':modules:mogo-module-authorize')
|
||||
// implementation project(':modules:mogo-module-authorize')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.module.extensions.userinfo.UserInfo;
|
||||
import com.mogo.utils.LaunchUtils;
|
||||
@@ -54,6 +55,7 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
|
||||
mUserHeadImg = findViewById(R.id.ivUserHeadImg);
|
||||
|
||||
mMsgContainer = findViewById( R.id.module_ext_id_msg );
|
||||
|
||||
mMsgContainer.setOnClickListener( view -> {
|
||||
ARouter.getInstance().build( "/push/ui/message" ).navigation( getContext() );
|
||||
} );
|
||||
@@ -65,6 +67,8 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
|
||||
Logger.e(TAG, e, "打开个人中心Exception");
|
||||
}
|
||||
});
|
||||
|
||||
mUserHeadImg.setVisibility(DebugConfig.isLauncher()?View.VISIBLE:View.GONE);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
||||
@@ -125,8 +125,12 @@ public class ExtensionsPresenter extends Presenter< ExtensionsView > implements
|
||||
@Override
|
||||
public void onSuccess(UserInfoResponse userInfoBaseResponse) {
|
||||
userInfo = userInfoBaseResponse.getResult();
|
||||
Logger.d(TAG, "获取个人信息成功: " + userInfo);
|
||||
mView.renderUserInfo(userInfo);
|
||||
if(userInfo!=null) {
|
||||
Logger.d(TAG, "获取个人信息成功: " + userInfo);
|
||||
mView.renderUserInfo(userInfo);
|
||||
}else{
|
||||
Logger.e(TAG,"获取个人信息失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
@@ -30,9 +29,6 @@ import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.navi.MogoTraffic;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
|
||||
import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListener;
|
||||
import com.mogo.module.authorize.authprovider.module.IMogoAuthorizeModuleManager;
|
||||
import com.mogo.module.common.dialog.WMDialog;
|
||||
import com.mogo.module.common.map.CustomNaviInterrupter;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
@@ -40,9 +36,7 @@ import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.extensions.ExtensionsModuleConst;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.navi.NaviInfoView;
|
||||
import com.mogo.module.extensions.userinfo.UserInfo;
|
||||
import com.mogo.module.extensions.utils.TopViewAnimHelper;
|
||||
import com.mogo.module.share.ShareControl;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
@@ -56,14 +50,12 @@ import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -71,12 +63,11 @@ import static com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerCons
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresenter >
|
||||
public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresenter>
|
||||
implements EntranceView,
|
||||
IMogoNaviListener,
|
||||
IMogoMapListener,
|
||||
IMogoAimlessModeListener,
|
||||
IMogoAcquireAuthorizeListener,
|
||||
IMogoStatusChangedListener {
|
||||
|
||||
private static final String TAG = "EntranceFragment";
|
||||
@@ -107,7 +98,6 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
private IMogoAnalytics mAnalytics;
|
||||
private IMogoStatusManager mMogoStatusManager;
|
||||
private EntrancePresenter mEntrancePresenter;
|
||||
private IMogoAuthorizeModuleManager mIMogoAuthorizeModuleManager;
|
||||
private IMogoStatusManager mStatusManager;
|
||||
|
||||
|
||||
@@ -176,10 +166,10 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
private Runnable mLockCarRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if ( !mStatusManager.isDisplayOverview() ) {
|
||||
if (!mStatusManager.isDisplayOverview()) {
|
||||
return;
|
||||
}
|
||||
mStatusManager.setDisplayOverview( TAG, false );
|
||||
mStatusManager.setDisplayOverview(TAG, false);
|
||||
mMApUIController.recoverLockMode();
|
||||
}
|
||||
};
|
||||
@@ -189,23 +179,21 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
return R.layout.module_ext_layout_entrance;
|
||||
}
|
||||
|
||||
private List< View > demoCache = new ArrayList<>();
|
||||
private List<View> demoCache = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( getContext() );
|
||||
mIMogoAuthorizeModuleManager = ( IMogoAuthorizeModuleManager ) ARouter.getInstance().build( AuthorizeConstant.PROVIDER_MODULE ).navigation( getContext() );
|
||||
mIMogoAuthorizeModuleManager.registerAuthorizeListener( AUTHORIZE_TYPE_LAUNCHER_SHARE, this );
|
||||
mApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(getContext());
|
||||
|
||||
mEntrancePresenter = new EntrancePresenter( getContext(), this, mIMogoAuthorizeModuleManager );
|
||||
mEntrancePresenter = new EntrancePresenter(getContext(), this);
|
||||
mMogoFragmentManager = mApis.getFragmentManagerApi();
|
||||
|
||||
mStatusManager = mApis.getStatusManagerApi();
|
||||
|
||||
mUploadRoadCondition = findViewById( R.id.module_entrance_id_upload_road_condition );
|
||||
mUpload = findViewById( R.id.module_entrance_id_upload );
|
||||
mUploading = findViewById( R.id.module_entrance_id_uploading );
|
||||
mUploadRoadCondition.setOnClickListener( view -> {
|
||||
mUploadRoadCondition = findViewById(R.id.module_entrance_id_upload_road_condition);
|
||||
mUpload = findViewById(R.id.module_entrance_id_upload);
|
||||
mUploading = findViewById(R.id.module_entrance_id_uploading);
|
||||
mUploadRoadCondition.setOnClickListener(view -> {
|
||||
// // todo 测试动画
|
||||
// View v = LayoutInflater.from(getContext()).inflate(R.layout.demo_top, null);
|
||||
// TextView tv = v.findViewById(R.id.tvIndex);
|
||||
@@ -224,25 +212,25 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
// });
|
||||
// 原始逻辑
|
||||
showShareDialog();
|
||||
} );
|
||||
});
|
||||
|
||||
mDisplayOverview = findViewById( R.id.module_ext_id_display_overview );
|
||||
mDisplayOverviewText = findViewById( R.id.module_ext_id_display_overview_text );
|
||||
mDisplayOverviewIcon = findViewById( R.id.module_ext_id_display_overview_icon );
|
||||
mDisplayOverview.setOnClickListener( view -> {
|
||||
if ( !mStatusManager.isDisplayOverview() ) {
|
||||
mMApUIController.displayOverview( mDisplayOverviewBounds );
|
||||
UiThreadHandler.removeCallbacks( mLockCarRunnable );
|
||||
UiThreadHandler.postDelayed( mLockCarRunnable, 20_000 );
|
||||
mDisplayOverview = findViewById(R.id.module_ext_id_display_overview);
|
||||
mDisplayOverviewText = findViewById(R.id.module_ext_id_display_overview_text);
|
||||
mDisplayOverviewIcon = findViewById(R.id.module_ext_id_display_overview_icon);
|
||||
mDisplayOverview.setOnClickListener(view -> {
|
||||
if (!mStatusManager.isDisplayOverview()) {
|
||||
mMApUIController.displayOverview(mDisplayOverviewBounds);
|
||||
UiThreadHandler.removeCallbacks(mLockCarRunnable);
|
||||
UiThreadHandler.postDelayed(mLockCarRunnable, 20_000);
|
||||
} else {
|
||||
mMApUIController.recoverLockMode();
|
||||
UiThreadHandler.removeCallbacks( mLockCarRunnable );
|
||||
UiThreadHandler.removeCallbacks(mLockCarRunnable);
|
||||
}
|
||||
mStatusManager.setDisplayOverview( TAG, !mStatusManager.isDisplayOverview() );
|
||||
} );
|
||||
mStatusManager.setDisplayOverview(TAG, !mStatusManager.isDisplayOverview());
|
||||
});
|
||||
|
||||
mMove2CurrentLocation = findViewById( R.id.module_entrance_id_move2_current_location );
|
||||
mMove2CurrentLocation.setOnClickListener( view -> {
|
||||
mMove2CurrentLocation = findViewById(R.id.module_entrance_id_move2_current_location);
|
||||
mMove2CurrentLocation.setOnClickListener(view -> {
|
||||
// // todo 测试动画
|
||||
// if(!toggle) {
|
||||
// TopViewAnimHelper.getInstance().showNaviView();
|
||||
@@ -258,102 +246,109 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
// }
|
||||
// 原始逻辑
|
||||
final MogoLocation location = mMogoLocationClient.getLastKnowLocation();
|
||||
if ( location != null ) {
|
||||
if ( !mMogoStatusManager.isV2XShow() ) {
|
||||
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
mMApUIController.setLockZoom( 16 );
|
||||
mMApUIController.changeZoom( 16.0f );
|
||||
if (location != null) {
|
||||
if (!mMogoStatusManager.isV2XShow()) {
|
||||
mMogoStatusManager.setUserInteractionStatus(TAG, true, false);
|
||||
mMApUIController.setLockZoom(16);
|
||||
mMApUIController.changeZoom(16.0f);
|
||||
}
|
||||
if ( mStatusManager.isDisplayOverview() ) {
|
||||
mMogoStatusManager.setDisplayOverview( TAG, false );
|
||||
UiThreadHandler.removeCallbacks( mLockCarRunnable );
|
||||
if (mStatusManager.isDisplayOverview()) {
|
||||
mMogoStatusManager.setDisplayOverview(TAG, false);
|
||||
UiThreadHandler.removeCallbacks(mLockCarRunnable);
|
||||
}
|
||||
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
mMogoStatusManager.setUserInteractionStatus(TAG, true, false);
|
||||
mMApUIController.recoverLockMode();
|
||||
}
|
||||
} );
|
||||
});
|
||||
|
||||
// mNaviInfo = findViewById( R.id.module_entrance_id_navi_info_panel );
|
||||
ConstraintLayout rootView = findViewById( R.id.module_entrance_id_top_motion_layout );
|
||||
if ( rootView != null ) {
|
||||
TopViewAnimHelper.getInstance().init( rootView );
|
||||
ConstraintLayout rootView = findViewById(R.id.module_entrance_id_top_motion_layout);
|
||||
if (rootView != null) {
|
||||
TopViewAnimHelper.getInstance().init(rootView);
|
||||
}
|
||||
|
||||
mExitNavi = findViewById( R.id.module_entrance_id_exit_navi );
|
||||
mExitNavi.setOnClickListener( view -> {
|
||||
if ( mMogoNavi != null ) {
|
||||
if ( mIsLock ) {
|
||||
new WMDialog.Builder( getContext() )
|
||||
.setOkButton( R.string.module_commons_button_ok, ( dlg, which ) -> {
|
||||
mExitNavi = findViewById(R.id.module_entrance_id_exit_navi);
|
||||
mExitNavi.setOnClickListener(view -> {
|
||||
if (mMogoNavi != null) {
|
||||
if (mIsLock) {
|
||||
new WMDialog.Builder(getContext())
|
||||
.setOkButton(R.string.module_commons_button_ok, (dlg, which) -> {
|
||||
dlg.dismiss();
|
||||
mMogoNavi.stopNavi();
|
||||
} )
|
||||
.setCancelButton( R.string.module_commons_button_cancel, ( dlg, which ) -> {
|
||||
})
|
||||
.setCancelButton(R.string.module_commons_button_cancel,
|
||||
(dlg, which) -> {
|
||||
dlg.dismiss();
|
||||
} )
|
||||
.setContent( R.string.module_commons_exit_navi_content )
|
||||
})
|
||||
.setContent(R.string.module_commons_exit_navi_content)
|
||||
.build()
|
||||
.show();
|
||||
} else {
|
||||
MapCenterPointStrategy.setMapCenterPointByScene( mMApUIController, Scene.NAVI );
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mMApUIController, Scene.NAVI);
|
||||
mMApUIController.recoverLockMode();
|
||||
}
|
||||
}
|
||||
} );
|
||||
});
|
||||
|
||||
mCameraMode = findViewById( R.id.module_ext_id_north );
|
||||
mCameraMode.setOnClickListener( view -> {
|
||||
if ( mCameraMode.isSelected() ) {
|
||||
mMApUIController.changeMapMode( EnumMapUI.CarUp_2D );
|
||||
mCameraMode = findViewById(R.id.module_ext_id_north);
|
||||
mCameraMode.setOnClickListener(view -> {
|
||||
if (mCameraMode.isSelected()) {
|
||||
mMApUIController.changeMapMode(EnumMapUI.CarUp_2D);
|
||||
} else {
|
||||
mMApUIController.changeMapMode( EnumMapUI.NorthUP_2D );
|
||||
mMApUIController.changeMapMode(EnumMapUI.NorthUP_2D);
|
||||
}
|
||||
mCameraMode.setSelected( !mCameraMode.isSelected() );
|
||||
mCameraMode.setText( getString( mCameraMode.isSelected() ? R.string.mode_car_up : R.string.mode_north_up ) );
|
||||
} );
|
||||
mCameraMode.setSelected(!mCameraMode.isSelected());
|
||||
mCameraMode.setText(getString(mCameraMode.isSelected() ? R.string.mode_car_up :
|
||||
R.string.mode_north_up));
|
||||
});
|
||||
|
||||
|
||||
mApis.getIntentManagerApi().registerIntentListener( AUTONAVI_STANDARD_BROADCAST_RECV, new IMogoIntentListener() {
|
||||
mApis.getIntentManagerApi().registerIntentListener(AUTONAVI_STANDARD_BROADCAST_RECV,
|
||||
new IMogoIntentListener() {
|
||||
@Override
|
||||
public void onIntentReceived( String intentStr, Intent intent ) {
|
||||
int key_type = intent.getIntExtra( "KEY_TYPE", 0 );
|
||||
int type = intent.getIntExtra( "EXTRA_TYPE", -1 );
|
||||
int opera_type = intent.getIntExtra( "EXTRA_OPERA", -1 );
|
||||
if ( key_type == 10027 ) {
|
||||
if ( opera_type == 0 ) {
|
||||
mCameraMode.setSelected( false );
|
||||
} else if ( opera_type == 1 ) {
|
||||
mCameraMode.setSelected( true );
|
||||
public void onIntentReceived(String intentStr, Intent intent) {
|
||||
int key_type = intent.getIntExtra("KEY_TYPE", 0);
|
||||
int type = intent.getIntExtra("EXTRA_TYPE", -1);
|
||||
int opera_type = intent.getIntExtra("EXTRA_OPERA", -1);
|
||||
if (key_type == 10027) {
|
||||
if (opera_type == 0) {
|
||||
mCameraMode.setSelected(false);
|
||||
} else if (opera_type == 1) {
|
||||
mCameraMode.setSelected(true);
|
||||
}
|
||||
mCameraMode.setText( getString( mCameraMode.isSelected() ? R.string.mode_car_up : R.string.mode_north_up ) );
|
||||
mCameraMode.setText(getString(mCameraMode.isSelected() ?
|
||||
R.string.mode_car_up : R.string.mode_north_up));
|
||||
}
|
||||
}
|
||||
} );
|
||||
MogoEntranceButtons.save( ButtonIndex.BUTTON1, findViewById( R.id.module_entrance_id_button1 ) );
|
||||
MogoEntranceButtons.save( ButtonIndex.BUTTON2, findViewById( R.id.module_entrance_id_button2 ) );
|
||||
});
|
||||
MogoEntranceButtons.save(ButtonIndex.BUTTON1,
|
||||
findViewById(R.id.module_entrance_id_button1));
|
||||
MogoEntranceButtons.save(ButtonIndex.BUTTON2,
|
||||
findViewById(R.id.module_entrance_id_button2));
|
||||
|
||||
mDisplayOverviewBounds = new Rect(
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_display_overview_left_margin ),
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_display_overview_top_margin ),
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_display_overview_right_margin ),
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_display_overview_bottom_margin )
|
||||
ResourcesHelper.getDimensionPixelSize(getContext(),
|
||||
R.dimen.module_map_display_overview_left_margin),
|
||||
ResourcesHelper.getDimensionPixelSize(getContext(),
|
||||
R.dimen.module_map_display_overview_top_margin),
|
||||
ResourcesHelper.getDimensionPixelSize(getContext(),
|
||||
R.dimen.module_map_display_overview_right_margin),
|
||||
ResourcesHelper.getDimensionPixelSize(getContext(),
|
||||
R.dimen.module_map_display_overview_bottom_margin)
|
||||
);
|
||||
|
||||
mNaviInfo = new NaviInfoView();
|
||||
mNaviInfo.inflate( rootView );
|
||||
mNaviInfo.inflate(rootView);
|
||||
}
|
||||
|
||||
public void showShareDialog() {
|
||||
isClickShare = true;
|
||||
if ( mIMogoAuthorizeModuleManager.needAuthorize( AUTHORIZE_TYPE_LAUNCHER_SHARE ) ) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization( AUTHORIZE_TYPE_LAUNCHER_SHARE );
|
||||
} else {
|
||||
mApis.getShareManager().showShareDialog();
|
||||
traceData( "1" );
|
||||
}
|
||||
mApis.getShareManager().showShareDialog();
|
||||
traceData("1");
|
||||
}
|
||||
|
||||
private static final String AUTONAVI_STANDARD_BROADCAST_RECV = "AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
private static final String AUTONAVI_STANDARD_BROADCAST_RECV =
|
||||
"AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
@@ -362,165 +357,142 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated( @Nullable Bundle savedInstanceState ) {
|
||||
super.onActivityCreated( savedInstanceState );
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
mService = mApis.getMapServiceApi();
|
||||
mMogoRegisterCenter = mApis.getRegisterCenterApi();
|
||||
mMApUIController = mService.getMapUIController();
|
||||
mMogoLocationClient = mService.getSingletonLocationClient( getContext() );
|
||||
mMogoNavi = mService.getNavi( getContext() );
|
||||
mMogoLocationClient = mService.getSingletonLocationClient(getContext());
|
||||
mMogoNavi = mService.getNavi(getContext());
|
||||
mAnalytics = mApis.getAnalyticsApi();
|
||||
mMogoStatusManager = mApis.getStatusManagerApi();
|
||||
|
||||
mMogoRegisterCenter.registerMogoNaviListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
|
||||
mMogoRegisterCenter.registerMogoMapListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
|
||||
mMogoRegisterCenter.registerMogoAimlessModeListener( TAG, this );
|
||||
mMogoRegisterCenter.registerMogoNaviListener(ExtensionsModuleConst.TYPE_ENTRANCE, this);
|
||||
mMogoRegisterCenter.registerMogoMapListener(ExtensionsModuleConst.TYPE_ENTRANCE, this);
|
||||
mMogoRegisterCenter.registerMogoAimlessModeListener(TAG, this);
|
||||
|
||||
mMogoMarkerManager = mService.getMarkerManager( getContext() );
|
||||
mMogoMarkerManager = mService.getMarkerManager(getContext());
|
||||
|
||||
mMogoStatusManager.registerStatusChangedListener( TAG, StatusDescriptor.UPLOADING, this );
|
||||
mMogoStatusManager.registerStatusChangedListener( TAG, StatusDescriptor.DISPLAY_OVERVIEW, this );
|
||||
mMogoStatusManager.registerStatusChangedListener(TAG, StatusDescriptor.UPLOADING, this);
|
||||
mMogoStatusManager.registerStatusChangedListener(TAG, StatusDescriptor.DISPLAY_OVERVIEW,
|
||||
this);
|
||||
|
||||
TopViewAnimHelper.getInstance().setIMogoMapUIController( mMApUIController );
|
||||
TopViewAnimHelper.getInstance().setIMogoMapUIController(mMApUIController);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
if ( mEntrancePresenter != null ) {
|
||||
mEntrancePresenter.unregisterUnWake();
|
||||
}
|
||||
|
||||
isClickShare = false;
|
||||
mIMogoAuthorizeModuleManager.unregisterAuthorizeListener( AUTHORIZE_TYPE_LAUNCHER_SHARE );
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void authorizeSuccess() {
|
||||
Log.d( TAG, "authorizeSuccess --------> isClickShare = " + isClickShare );
|
||||
if ( isClickShare ) {
|
||||
mApis.getShareManager().showShareDialog();
|
||||
traceData( "1" );
|
||||
} else {
|
||||
mEntrancePresenter.handleNeedAuthorizeCmd();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void authorizeFailed( String errorMsg ) {
|
||||
Log.e( TAG, "authorizeFailed --------> errorMsg = " + errorMsg + " >> isClickShare = " + isClickShare );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forbiddenVoiceWhenAuthorize( String cmd ) {
|
||||
Log.d( TAG, "forbiddenVoiceWhenAuthorize --------> cmd = " + cmd );
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate( MogoNaviInfo naviinfo ) {
|
||||
if ( naviinfo == null ) {
|
||||
public void onNaviInfoUpdate(MogoNaviInfo naviinfo) {
|
||||
if (naviinfo == null) {
|
||||
return;
|
||||
}
|
||||
if ( mExitNavi.getVisibility() == View.GONE ) {
|
||||
if (mExitNavi.getVisibility() == View.GONE) {
|
||||
// 避免先导航,后启动app导致无法显示控件
|
||||
onStartNavi();
|
||||
}
|
||||
mNaviInfo.notifyChanged( naviinfo );
|
||||
mNaviInfo.notifyChanged(naviinfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartNavi() {
|
||||
TopViewAnimHelper.getInstance().showNaviView();
|
||||
mMApUIController.changeMapMode( mCameraMode.isSelected() ? EnumMapUI.NorthUP_2D : EnumMapUI.CarUp_2D );
|
||||
MapCenterPointStrategy.setMapCenterPointBySceneAndDelay( mMApUIController, Scene.NAVI, 500, () -> {
|
||||
mMApUIController.changeMapMode(mCameraMode.isSelected() ? EnumMapUI.NorthUP_2D :
|
||||
EnumMapUI.CarUp_2D);
|
||||
MapCenterPointStrategy.setMapCenterPointBySceneAndDelay(mMApUIController, Scene.NAVI, 500
|
||||
, () -> {
|
||||
return !mMogoNavi.isNaviing();
|
||||
} );
|
||||
if(CustomNaviInterrupter.getInstance().interrupt()){
|
||||
});
|
||||
if (CustomNaviInterrupter.getInstance().interrupt()) {
|
||||
mDisplayOverview.setVisibility(View.GONE);
|
||||
mCameraMode.setVisibility(View.GONE);
|
||||
mExitNavi.setVisibility( View.GONE );
|
||||
}else {
|
||||
mExitNavi.setVisibility( View.VISIBLE );
|
||||
mExitNavi.setVisibility(View.GONE);
|
||||
} else {
|
||||
mExitNavi.setVisibility(View.VISIBLE);
|
||||
mDisplayOverview.setVisibility(View.VISIBLE);
|
||||
mCameraMode.setVisibility( View.VISIBLE );
|
||||
mCameraMode.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mApis.getAnalyticsApi().track( "Navigation_begin", new HashMap<>() );
|
||||
mApis.getAnalyticsApi().track("Navigation_begin", new HashMap<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopNavi() {
|
||||
TopViewAnimHelper.getInstance().hideNaviView();
|
||||
mExitNavi.setVisibility( View.GONE );
|
||||
mMApUIController.changeMapMode( EnumMapUI.NorthUP_2D );
|
||||
mDisplayOverview.setVisibility( View.GONE );
|
||||
mCameraMode.setVisibility( View.GONE );
|
||||
MapCenterPointStrategy.setMapCenterPointByScene( mMApUIController, Scene.AIMLESS );
|
||||
mExitNavi.setVisibility(View.GONE);
|
||||
mMApUIController.changeMapMode(EnumMapUI.NorthUP_2D);
|
||||
mDisplayOverview.setVisibility(View.GONE);
|
||||
mCameraMode.setVisibility(View.GONE);
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mMApUIController, Scene.AIMLESS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateTraffic2( MogoTraffic traffic ) {
|
||||
if ( traffic == null ) {
|
||||
public void onUpdateTraffic2(MogoTraffic traffic) {
|
||||
if (traffic == null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockMap( boolean isLock ) {
|
||||
public void onLockMap(boolean isLock) {
|
||||
mIsLock = isLock;
|
||||
if ( isLock ) {
|
||||
mExitNavi.setText( R.string.module_ext_str_exit_navi );
|
||||
if ( mMogoStatusManager.isDisplayOverview() ) {
|
||||
mMogoStatusManager.setDisplayOverview( TAG, false );
|
||||
if (isLock) {
|
||||
mExitNavi.setText(R.string.module_ext_str_exit_navi);
|
||||
if (mMogoStatusManager.isDisplayOverview()) {
|
||||
mMogoStatusManager.setDisplayOverview(TAG, false);
|
||||
}
|
||||
} else {
|
||||
mExitNavi.setText( R.string.module_ext_str_continue_navi );
|
||||
mExitNavi.setText(R.string.module_ext_str_continue_navi);
|
||||
}
|
||||
}
|
||||
|
||||
private void traceData( String from ) {
|
||||
Map< String, Object > properties = new HashMap<>();
|
||||
properties.put( "from", from );
|
||||
mAnalytics.track( "Launcher_Share_Click", properties );
|
||||
private void traceData(String from) {
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("from", from);
|
||||
mAnalytics.track("Launcher_Share_Click", properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ) {
|
||||
if ( mUploadRoadCondition == null ) {
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
if (mUploadRoadCondition == null) {
|
||||
return;
|
||||
}
|
||||
if ( descriptor == StatusDescriptor.UPLOADING ) {
|
||||
if ( isTrue ) {
|
||||
mUploading.setVisibility( View.VISIBLE );
|
||||
mUpload.setVisibility( View.GONE );
|
||||
if ( mUploadFrameAnimHandler != null ) {
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_STOP_ANIM );
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
|
||||
if (descriptor == StatusDescriptor.UPLOADING) {
|
||||
if (isTrue) {
|
||||
mUploading.setVisibility(View.VISIBLE);
|
||||
mUpload.setVisibility(View.GONE);
|
||||
if (mUploadFrameAnimHandler != null) {
|
||||
mUploadFrameAnimHandler.removeMessages(MSG_STOP_ANIM);
|
||||
mUploadFrameAnimHandler.removeMessages(MSG_FRAME_ANIM);
|
||||
}
|
||||
doFrameAnimOnUploadButton();
|
||||
} else {
|
||||
mCurrentUploadFrame = 0;
|
||||
if ( mUploadFrameAnimHandler != null ) {
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
|
||||
if (mUploadFrameAnimHandler != null) {
|
||||
mUploadFrameAnimHandler.removeMessages(MSG_FRAME_ANIM);
|
||||
}
|
||||
mUploading.setVisibility( View.GONE );
|
||||
mUpload.setVisibility( View.VISIBLE );
|
||||
mUploading.setVisibility(View.GONE);
|
||||
mUpload.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else if ( descriptor == StatusDescriptor.DISPLAY_OVERVIEW ) {
|
||||
if ( !mMogoNavi.isNaviing() ) {
|
||||
} else if (descriptor == StatusDescriptor.DISPLAY_OVERVIEW) {
|
||||
if (!mMogoNavi.isNaviing()) {
|
||||
return;
|
||||
}
|
||||
if ( isTrue ) {
|
||||
mDisplayOverviewText.setText( "退出全览" );
|
||||
mDisplayOverviewText.setTextSize( TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize( R.dimen.module_ext_display_overview_textSize ) );
|
||||
mCameraMode.setVisibility( View.GONE );
|
||||
if (isTrue) {
|
||||
mDisplayOverviewText.setText("退出全览");
|
||||
mDisplayOverviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX,
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_display_overview_textSize));
|
||||
mCameraMode.setVisibility(View.GONE);
|
||||
} else {
|
||||
mDisplayOverviewText.setText( "全览" );
|
||||
mDisplayOverviewText.setTextSize( TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize( R.dimen.module_ext_display_overview_textSize_large ) );
|
||||
if(CustomNaviInterrupter.getInstance().interrupt()){
|
||||
mDisplayOverviewText.setText("全览");
|
||||
mDisplayOverviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX,
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_display_overview_textSize_large));
|
||||
if (CustomNaviInterrupter.getInstance().interrupt()) {
|
||||
mCameraMode.setVisibility(View.GONE);
|
||||
}else {
|
||||
} else {
|
||||
mCameraMode.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
@@ -528,40 +500,41 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
}
|
||||
|
||||
private void doFrameAnimOnUploadButton() {
|
||||
if ( mUploadFrameAnimHandler == null ) {
|
||||
mUploadFrameAnimHandler = new Handler( Looper.getMainLooper() ) {
|
||||
if (mUploadFrameAnimHandler == null) {
|
||||
mUploadFrameAnimHandler = new Handler(Looper.getMainLooper()) {
|
||||
@Override
|
||||
public void handleMessage( Message msg ) {
|
||||
super.handleMessage( msg );
|
||||
if ( msg.what == MSG_FRAME_ANIM ) {
|
||||
if ( mUploadingFrameRes == null || mUploadingFrameRes.length == 0 ) {
|
||||
if ( mUploading != null ) {
|
||||
mUploading.setVisibility( View.GONE );
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
if (msg.what == MSG_FRAME_ANIM) {
|
||||
if (mUploadingFrameRes == null || mUploadingFrameRes.length == 0) {
|
||||
if (mUploading != null) {
|
||||
mUploading.setVisibility(View.GONE);
|
||||
}
|
||||
if ( mUpload != null ) {
|
||||
mUpload.setVisibility( View.VISIBLE );
|
||||
if (mUpload != null) {
|
||||
mUpload.setVisibility(View.VISIBLE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ( !mMogoStatusManager.isUploading() ) {
|
||||
if (!mMogoStatusManager.isUploading()) {
|
||||
mCurrentUploadFrame = 0;
|
||||
return;
|
||||
}
|
||||
if ( mUploading != null ) {
|
||||
if ( mCurrentUploadFrame == mUploadingFrameRes.length ) {
|
||||
if (mUploading != null) {
|
||||
if (mCurrentUploadFrame == mUploadingFrameRes.length) {
|
||||
mCurrentUploadFrame = 12;
|
||||
}
|
||||
mUploading.setImageResource( mUploadingFrameRes[mCurrentUploadFrame++ % mUploadingFrameRes.length] );
|
||||
mUploading.setImageResource(mUploadingFrameRes[mCurrentUploadFrame++ % mUploadingFrameRes.length]);
|
||||
}
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_FRAME_ANIM, TIME_FRAME_INTERVAL_TIME );
|
||||
} else if ( msg.what == MSG_STOP_ANIM ) {
|
||||
mStatusManager.setUploadingStatus( TAG, false );
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed(MSG_FRAME_ANIM,
|
||||
TIME_FRAME_INTERVAL_TIME);
|
||||
} else if (msg.what == MSG_STOP_ANIM) {
|
||||
mStatusManager.setUploadingStatus(TAG, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
mUploadFrameAnimHandler.sendEmptyMessage( MSG_FRAME_ANIM );
|
||||
mUploadFrameAnimHandler.sendEmptyMessage(MSG_FRAME_ANIM);
|
||||
// 30s 后无论成功与否,停止动画
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_STOP_ANIM, 30_000 );
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed(MSG_STOP_ANIM, 30_000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,51 +1,11 @@
|
||||
package com.mogo.module.extensions.entrance;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.util.ArrayMap;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.module.authorize.authprovider.module.IMogoAuthorizeModuleManager;
|
||||
import com.mogo.module.extensions.ExtensionsModuleConst;
|
||||
import com.mogo.module.extensions.net.UserInfoNetApiServices;
|
||||
import com.mogo.module.extensions.userinfo.UserInfo;
|
||||
import com.mogo.module.extensions.userinfo.UserInfoConstant;
|
||||
import com.mogo.module.extensions.userinfo.UserInfoResponse;
|
||||
import com.mogo.module.extensions.utils.ExtensionsConfig;
|
||||
import com.mogo.module.share.ShareControl;
|
||||
import com.mogo.module.share.manager.ServiceApisManager;
|
||||
import com.mogo.module.share.manager.UploadHelper;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.digest.DigestUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.auto.platform.util.DeviceUtil;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import static com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -54,353 +14,22 @@ import static com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerCons
|
||||
* 描述
|
||||
*/
|
||||
public class EntrancePresenter extends Presenter<EntranceView> {
|
||||
private static final String REPORT_TANLU_BLOCK = "10007";
|
||||
private static final String REPORT_TANLU_TRAFFIC_CHECK = "10002";
|
||||
private static final String REPORT_TANLU_CLOSURE = "10003";
|
||||
|
||||
private Context mContext;
|
||||
private IMogoAnalytics mAnalytics;
|
||||
private static final String TAG = "EntranceFragment";
|
||||
private IMogoIntentManager mogoIntentManager;
|
||||
private IMogoAuthorizeModuleManager mIMogoAuthorizeModuleManager;
|
||||
private String mVoiceCmdType; //一级命令
|
||||
private String mVoiceCmdShareType; //对某些一级命令里面细分的类型做处理
|
||||
private IMogoStatusManager mStatusManager;
|
||||
|
||||
public EntrancePresenter(Context context, EntranceView view,
|
||||
IMogoAuthorizeModuleManager authorizeModuleManager) {
|
||||
public EntrancePresenter(Context context, EntranceView view) {
|
||||
super(view);
|
||||
mContext = context;
|
||||
IMogoServiceApis apis =
|
||||
(IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(mContext);
|
||||
mAnalytics = apis.getAnalyticsApi();
|
||||
mogoIntentManager = apis.getIntentManagerApi();
|
||||
mIMogoAuthorizeModuleManager = authorizeModuleManager;
|
||||
mStatusManager = apis.getStatusManagerApi();
|
||||
|
||||
registerUnWake();
|
||||
registerAwakeVoice();
|
||||
}
|
||||
|
||||
private void registerUnWake() {
|
||||
// AIAssist.getInstance( mContext ).registerUnWakeupCommand( ExtensionsModuleConst.CLOSE,
|
||||
// ExtensionsModuleConst.CMD_CLOSE, mogoVoiceListener );
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.CANCLE_SHARE
|
||||
, ExtensionsModuleConst.CMD_CANCLE_SHARE, mogoVoiceListener);
|
||||
//探路相关上报
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.UPLOAD_ROAD_BLOCK, ExtensionsModuleConst.CMD_UPLOAD_BLOCK, mogoVoiceListener);
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.UPLOAD_TRAFFIC_CHECK, ExtensionsModuleConst.CMD_TRAFFIC_CHECK, mogoVoiceListener);
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.UPLOAD_ROAD_CLOSURE, ExtensionsModuleConst.CMD_ROAD_CLOSURE, mogoVoiceListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume(@NonNull LifecycleOwner owner) {
|
||||
super.onResume(owner);
|
||||
}
|
||||
|
||||
/**
|
||||
* 免唤醒语音监听
|
||||
*/
|
||||
private IMogoVoiceCmdCallBack mogoVoiceListener = new IMogoVoiceCmdCallBack() {
|
||||
@Override
|
||||
public void onCmdSelected(String cmd) {
|
||||
Log.d(TAG,
|
||||
"免唤醒 mogoVoiceListener needAuthorize = " + mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE) + " >>>cmd = " + cmd);
|
||||
mVoiceCmdType = cmd;
|
||||
if (cmd.equals(ExtensionsModuleConst.CANCLE_SHARE)
|
||||
/*|| cmd.equals( ExtensionsModuleConst.CLOSE ) */) { //取消分享,关闭页面
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
}
|
||||
} else if (cmd.equals(ExtensionsModuleConst.UPLOAD_ROAD_BLOCK)) { //上报拥堵
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
uploadRoadCondition();
|
||||
}
|
||||
} else if (cmd.equals(ExtensionsModuleConst.UPLOAD_TRAFFIC_CHECK)) { //上报交通检查
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
uploadTrfficCheck();
|
||||
}
|
||||
} else if (cmd.equals(ExtensionsModuleConst.UPLOAD_ROAD_CLOSURE)) { //上报封路
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
uploadRoadClosed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCmdAction(String speakText) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCmdCancel(String speakText) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSpeakEnd(String speakText) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSpeakSelectTimeOut(String speakText) {
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onCreate(@NonNull LifecycleOwner owner) {
|
||||
super.onCreate(owner);
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册唤醒命令
|
||||
*/
|
||||
private void registerAwakeVoice() {
|
||||
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION,
|
||||
mogoIntentListener);
|
||||
|
||||
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.GO_TO_SHARE,
|
||||
mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.SHARE_DIALOG_CLOSE,
|
||||
mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION_AWAKEN, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.NO_REPLY_SHARE_DIALOG_CLOSE, mogoIntentListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* 唤醒语音
|
||||
*/
|
||||
private IMogoIntentListener mogoIntentListener = new IMogoIntentListener() {
|
||||
@Override
|
||||
public void onIntentReceived(String intentStr, Intent intent) {
|
||||
mVoiceCmdType = intentStr;
|
||||
EntranceFragment.isClickShare = false;
|
||||
|
||||
String data = intent.getStringExtra("data");
|
||||
Log.d(TAG, "唤醒 mogoIntentListener intentStr =" + intentStr + ">>data =" + data + " " +
|
||||
">>> needAuthorize = " + mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE));
|
||||
if (intentStr.equals(ExtensionsModuleConst.GO_TO_SHARE)) { //我要分享 --ok
|
||||
String conditionData = intent.getStringExtra("data");
|
||||
Log.d(TAG,
|
||||
"唤醒 mogoIntentListener intentStr =" + intentStr + ">>conditionData =" + conditionData);
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(data);
|
||||
String typeString = jsonObject.get("ob").toString();
|
||||
Log.d(TAG, "mogoIntentListener specified typeString = " + typeString);
|
||||
mVoiceCmdShareType = typeString;
|
||||
if (!TextUtils.isEmpty(typeString)) {
|
||||
if (typeString.equals("封路")) {
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
Log.d(TAG, "mogoIntentListener 封路 -------> ");
|
||||
uploadRoadClosed();
|
||||
}
|
||||
} else if (typeString.equals("油价")) {
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
Log.d(TAG, "mogoIntentListener 油价 -------> ");
|
||||
shareOilPrice();
|
||||
}
|
||||
} else if (typeString.equals("交通检查")) {
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
Log.d(TAG, "mogoIntentListener 交通检查 -------> ");
|
||||
uploadTrfficCheck();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
Log.d(TAG, "mogoIntentListener 我要分享 ----> ");
|
||||
traceData("2");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (intentStr.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION_AWAKEN)) {
|
||||
//分享路况/上报路况/上报拥堵 唤醒
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
JSONObject jsonObject = null;
|
||||
try {
|
||||
jsonObject = new JSONObject(data);
|
||||
String typeString = jsonObject.get("obj").toString();
|
||||
Logger.d(TAG, "mogiIntentListener 准备上报拥堵: " + typeString);
|
||||
if ("拥堵".equals(typeString)) {
|
||||
uploadRoadCondition();
|
||||
Log.d(TAG, "mogoIntentListener 上报拥堵 唤醒 ----> ");
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
} else if (intentStr.equals(ExtensionsModuleConst.SHARE_DIALOG_CLOSE)) { //关闭分享框 唤醒
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
Log.d(TAG, "mogoIntentListener 关闭分享框 唤醒 ----> ");
|
||||
}
|
||||
} else if (intentStr.equals(ExtensionsModuleConst.NO_REPLY_SHARE_DIALOG_CLOSE)) {
|
||||
// 两次未回复关闭对话框
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
Logger.d(TAG, "mogoIntentListener 两次未回复关闭对话框");
|
||||
}
|
||||
} else if (intentStr.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION)) { //上报路况
|
||||
// 免唤醒 --ok
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
uploadRoadCondition();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 处理需要授权的命令 TODO
|
||||
*/
|
||||
public void handleNeedAuthorizeCmd() {
|
||||
Log.e(TAG, "handleNeedAuthorizeCmd mVoiceCmdType = " + mVoiceCmdType + " >>> " +
|
||||
"mVoiceCmdShareType = " + mVoiceCmdShareType);
|
||||
if (!TextUtils.isEmpty(mVoiceCmdType)) {
|
||||
if (mVoiceCmdType.equals(ExtensionsModuleConst.CANCLE_SHARE) || mVoiceCmdType.equals(ExtensionsModuleConst.CLOSE)
|
||||
|| mVoiceCmdType.equals(ExtensionsModuleConst.SHARE_DIALOG_CLOSE) || mVoiceCmdType.equals(ExtensionsModuleConst.NO_REPLY_SHARE_DIALOG_CLOSE)) { //关闭分享弹框
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
} else if (mVoiceCmdType.equals(ExtensionsModuleConst.GO_TO_SHARE)) { //打开分享弹框
|
||||
if (!TextUtils.isEmpty(mVoiceCmdShareType)) {
|
||||
if (mVoiceCmdShareType.equals("封路")) {
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 封路 -------> ");
|
||||
uploadRoadClosed();
|
||||
} else if (mVoiceCmdShareType.equals("油价")) {
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 油价 -------> ");
|
||||
shareOilPrice();
|
||||
} else if (mVoiceCmdShareType.equals("交通检查")) {
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 交通检查 -------> ");
|
||||
uploadTrfficCheck();
|
||||
}
|
||||
} else {
|
||||
ServiceApisManager.serviceApis.getShareManager().showShareDialog();
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 我要分享 ----> ");
|
||||
traceData("2");
|
||||
}
|
||||
} else if (mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_TRAFFIC_CHECK)) { //上报交通检查
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 上报交通检查 ----> ");
|
||||
uploadTrfficCheck();
|
||||
} else if (mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_CLOSURE)) { //上报封路
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 上报封路 ----> ");
|
||||
uploadRoadClosed();
|
||||
} else if (mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_BLOCK)
|
||||
|| mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION_AWAKEN)
|
||||
|| mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION)) {
|
||||
//上报拥堵, 分享路况, 上报路况
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 上报路况 ----> ");
|
||||
uploadRoadCondition();
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "handleNeedAuthorizeCmd mVoiceCmdType == null ");
|
||||
}
|
||||
}
|
||||
|
||||
private void uploadRoadCondition() {
|
||||
mStatusManager.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true);
|
||||
|
||||
traceTanluData("2");
|
||||
sendShareReceiver(REPORT_TANLU_BLOCK);
|
||||
Logger.d("EntrancePresenter", "mogoIntentListener 上报路况 ----> ");
|
||||
traceTypeData("1");
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
}
|
||||
|
||||
private void uploadTrfficCheck() {
|
||||
mStatusManager.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true);
|
||||
sendShareReceiver(REPORT_TANLU_TRAFFIC_CHECK);
|
||||
Logger.d("EntrancePresenter", "mogoIntentListener 分享交通检查 ----> ");
|
||||
traceTypeData("3");
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
}
|
||||
|
||||
private void uploadRoadClosed() {
|
||||
mStatusManager.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true);
|
||||
sendShareReceiver(REPORT_TANLU_CLOSURE);
|
||||
Logger.d("EntrancePresenter", "mogoIntentListener 分享封路 ----> ");
|
||||
traceTypeData("4");
|
||||
ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分享/上报按钮点击 from=1 手动点击 from=2 语音打开
|
||||
*
|
||||
* @param from
|
||||
*/
|
||||
private void traceData(String from) {
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("from", from);
|
||||
mAnalytics.track(ExtensionsModuleConst.LAUNCHER_SHARE_CLICK, properties);
|
||||
}
|
||||
|
||||
private void shareOilPrice() {
|
||||
// Intent intent = new Intent();
|
||||
// intent.setData(Uri.parse("freshthing://com.zhidao.fresh.things/shareOilPrice"));
|
||||
// getContext().startActivity(intent);
|
||||
// traceTypeData("2");
|
||||
// ServiceApisManager.serviceApis.getShareManager().dismissShareDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送广播 上报路况
|
||||
*/
|
||||
private void sendShareReceiver(String type) {
|
||||
Logger.d("EntrancePresenter", "TanluCardViewFragment sendShareReceiver ---->");
|
||||
UploadHelper.INSTANCE.upload(getContext(),type);
|
||||
}
|
||||
|
||||
/**
|
||||
* type=1 路况
|
||||
* <p>
|
||||
* type=2 油价
|
||||
* <p>
|
||||
* type=3 交通检查
|
||||
* <p>
|
||||
* type=4 封路
|
||||
*
|
||||
* @param type
|
||||
*/
|
||||
private void traceTypeData(String type) {
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
mAnalytics.track(ExtensionsModuleConst.LAUNCHER_SHARE_TYPE, properties);
|
||||
}
|
||||
|
||||
private void traceTanluData(String type) {
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
mAnalytics.track(ExtensionsModuleConst.CARNET_USER_UPLOAD, properties);
|
||||
}
|
||||
|
||||
|
||||
public void unregisterUnWake() {
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.CANCLE_SHARE);
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.CLOSE);
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.UPLOAD_ROAD_BLOCK);
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.UPLOAD_TRAFFIC_CHECK);
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.UPLOAD_ROAD_CLOSURE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.mogo.module.extensions.net;
|
||||
|
||||
import com.mogo.module.authorize.model.BaseResponse;
|
||||
import com.mogo.module.extensions.userinfo.UserInfo;
|
||||
import com.mogo.module.extensions.userinfo.UserInfoResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -141,7 +141,6 @@ public class MediaCardViewFragment extends MvpFragment<MediaView, MediaPresenter
|
||||
private ImageView mWindowPlayNext;
|
||||
private MediaShareDialogFragment mShareDilogFragment;
|
||||
private MediaMogoVoiceListener mMediaVoiceListener;
|
||||
private LinearLayout mWindowMediaCenter;
|
||||
private TextView mWindowCurrTime;
|
||||
private TextView mWindowMaxTime;
|
||||
private NoScrollSeekBar mWindowProgress;
|
||||
@@ -626,7 +625,6 @@ public class MediaCardViewFragment extends MvpFragment<MediaView, MediaPresenter
|
||||
mScrollText = mWindowView.findViewById(R.id.window_scroll_txt);
|
||||
mWindowPlayPause = mWindowView.findViewById(R.id.window_play_pause);
|
||||
mWindowPlayNext = mWindowView.findViewById(R.id.window_music_next);
|
||||
mWindowMediaCenter = mWindowView.findViewById(R.id.window_media_center);
|
||||
mWindowCurrTime = mWindowView.findViewById(R.id.window_current_time);
|
||||
mWindowMaxTime = mWindowView.findViewById(R.id.window_max_time);
|
||||
mWindowProgress = mWindowView.findViewById(R.id.window_progress_bar);
|
||||
@@ -637,7 +635,7 @@ public class MediaCardViewFragment extends MvpFragment<MediaView, MediaPresenter
|
||||
int xPos = getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location_x);
|
||||
ServiceMediaHandler.getMogoWindowManager().addView( mWindowView, xPos, yPos, false);
|
||||
updateWindowUI(true);
|
||||
mWindowMediaCenter.setOnClickListener(new NoDoubleClickListener() {
|
||||
mWindowView.setOnClickListener(new NoDoubleClickListener() {
|
||||
@Override
|
||||
public void onClicks(View view) {
|
||||
if (mMediaInfoData != null) {
|
||||
|
||||
@@ -57,7 +57,6 @@ public class MediaWindow implements MediaView{
|
||||
private ScrollingTextView mScrollText;
|
||||
private ImageView mWindowPlayPause;
|
||||
private ImageView mWindowPlayNext;
|
||||
private LinearLayout mWindowMediaCenter;
|
||||
private TextView mWindowCurrTime;
|
||||
private TextView mWindowMaxTime;
|
||||
private NoScrollSeekBar mWindowProgress;
|
||||
@@ -112,7 +111,6 @@ public class MediaWindow implements MediaView{
|
||||
mScrollText = mWindowView.findViewById(R.id.window_scroll_txt);
|
||||
mWindowPlayPause = mWindowView.findViewById(R.id.window_play_pause);
|
||||
mWindowPlayNext = mWindowView.findViewById(R.id.window_music_next);
|
||||
mWindowMediaCenter = mWindowView.findViewById(R.id.window_media_center);
|
||||
mWindowCurrTime = mWindowView.findViewById(R.id.window_current_time);
|
||||
mWindowMaxTime = mWindowView.findViewById(R.id.window_max_time);
|
||||
mWindowProgress = mWindowView.findViewById(R.id.window_progress_bar);
|
||||
@@ -123,7 +121,7 @@ public class MediaWindow implements MediaView{
|
||||
int xPos = getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location_x);
|
||||
ServiceMediaHandler.getMogoWindowManager().addView( mWindowView, xPos, yPos, false);
|
||||
updateWindowUI(true);
|
||||
mWindowMediaCenter.setOnClickListener(new NoDoubleClickListener() {
|
||||
mWindowView.setOnClickListener(new NoDoubleClickListener() {
|
||||
@Override
|
||||
public void onClicks(View view) {
|
||||
if (mMediaInfoData != null) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.mogo.module.media;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
@@ -42,7 +43,6 @@ public class MediaWindow2 implements IMusicView {
|
||||
private ScrollingTextView mScrollText;
|
||||
private ImageView mWindowPlayPause;
|
||||
private ImageView mWindowPlayNext;
|
||||
private LinearLayout mWindowMediaCenter;
|
||||
private TextView mWindowCurrTime;
|
||||
private TextView mWindowMaxTime;
|
||||
private NoScrollSeekBar mWindowProgress;
|
||||
@@ -85,7 +85,6 @@ public class MediaWindow2 implements IMusicView {
|
||||
mScrollText = mWindowView.findViewById(R.id.window_scroll_txt);
|
||||
mWindowPlayPause = mWindowView.findViewById(R.id.window_play_pause);
|
||||
mWindowPlayNext = mWindowView.findViewById(R.id.window_music_next);
|
||||
mWindowMediaCenter = mWindowView.findViewById(R.id.window_media_center);
|
||||
mWindowCurrTime = mWindowView.findViewById(R.id.window_current_time);
|
||||
mWindowMaxTime = mWindowView.findViewById(R.id.window_max_time);
|
||||
mWindowProgress = mWindowView.findViewById(R.id.window_progress_bar);
|
||||
@@ -96,9 +95,13 @@ public class MediaWindow2 implements IMusicView {
|
||||
getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location);
|
||||
int xPos =
|
||||
getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location_x);
|
||||
ServiceMediaHandler.getMogoWindowManager().addView(mWindowView, xPos, yPos, false);
|
||||
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;
|
||||
params.topMargin = yPos;
|
||||
ServiceMediaHandler.getMogoWindowManager().addView(mWindowView, params, false);
|
||||
updateWindowUI(true);
|
||||
mWindowMediaCenter.setOnClickListener(new NoDoubleClickListener() {
|
||||
mWindowView.setOnClickListener(new NoDoubleClickListener() {
|
||||
@Override
|
||||
public void onClicks(View view) {
|
||||
openAqtApp();
|
||||
|
||||
|
Before Width: | Height: | Size: 459 B |
|
Before Width: | Height: | Size: 440 B |
|
Before Width: | Height: | Size: 288 B |
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,14 @@
|
||||
<?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">
|
||||
<solid android:color="#42435A" />
|
||||
<corners android:bottomRightRadius="@dimen/module_media_window_corner" android:topRightRadius="@dimen/module_media_window_corner" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#00000000" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 518 B After Width: | Height: | Size: 518 B |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 520 B After Width: | Height: | Size: 520 B |
|
Before Width: | Height: | Size: 879 B After Width: | Height: | Size: 879 B |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 454 B After Width: | Height: | Size: 454 B |
|
After Width: | Height: | Size: 384 B |
|
Before Width: | Height: | Size: 703 B After Width: | Height: | Size: 703 B |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,13 @@
|
||||
<?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">
|
||||
<solid android:color="#42435A" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#00000000" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 885 B After Width: | Height: | Size: 885 B |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:angle="180"
|
||||
android:startColor="#5E6079"
|
||||
android:endColor="#3F4057"
|
||||
android:type="linear" />
|
||||
|
||||
|
After Width: | Height: | Size: 355 B |
|
After Width: | Height: | Size: 181 B |
@@ -1,87 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/module_media_pop_window_width"
|
||||
android:layout_height="@dimen/module_media_pop_window_height"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
tools:layout_marginLeft="@dimen/module_media_music_state_location_x"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_marginTop="@dimen/module_media_music_state_location"
|
||||
android:background="@drawable/module_media_window_alert_bg">
|
||||
<LinearLayout
|
||||
android:layout_width="@dimen/module_media_pop_window_width"
|
||||
android:layout_height="@dimen/module_media_pop_window_inner_height"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/module_media_pop_window_inner_padding"
|
||||
android:paddingRight="@dimen/module_media_pop_window_inner_padding">
|
||||
android:background="@drawable/module_media_window_alert_bg"
|
||||
tools:layout_marginLeft="@dimen/module_media_music_state_location_x">
|
||||
|
||||
<com.mogo.module.media.widget.AnimCircleImageView
|
||||
android:id="@+id/window_circle_img"
|
||||
android:layout_width="@dimen/module_media_pop_window_anim_img_size"
|
||||
android:layout_height="@dimen/module_media_pop_window_anim_img_size"
|
||||
android:src="@drawable/module_media_play"/>
|
||||
<com.mogo.module.media.widget.AnimCircleImageView
|
||||
android:id="@+id/window_circle_img"
|
||||
android:layout_width="@dimen/module_media_pop_window_anim_img_size"
|
||||
android:layout_height="@dimen/module_media_pop_window_anim_img_size"
|
||||
android:src="@drawable/module_media_default_music_img"
|
||||
android:layout_marginStart="@dimen/module_media_pop_window_inner_padding"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/window_media_center"
|
||||
android:layout_width="@dimen/module_media_pop_window_text_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/module_media_pop_window_text_margin"
|
||||
android:layout_marginRight="@dimen/module_media_pop_window_text_margin"
|
||||
android:orientation="vertical">
|
||||
<com.mogo.module.media.widget.ScrollingTextView
|
||||
android:id="@+id/window_scroll_txt"
|
||||
android:layout_width="@dimen/module_media_pop_window_text_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="is my life"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/module_media_pop_window_text_top_size"
|
||||
android:ellipsize="end"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"/>
|
||||
<com.mogo.module.media.widget.ScrollingTextView
|
||||
android:id="@+id/window_scroll_txt"
|
||||
android:layout_width="@dimen/module_media_pop_window_text_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:text="is my life"
|
||||
android:textColor="#ffffff"
|
||||
android:layout_marginStart="@dimen/module_media_pop_window_text_margin"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintBottom_toTopOf="@+id/window_current_time"
|
||||
app:layout_constraintLeft_toRightOf="@+id/window_circle_img"
|
||||
android:textSize="@dimen/module_media_pop_window_text_top_size" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/window_current_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/module_media_pop_window_text_bottom_size"
|
||||
android:textColor="#7aFFFFFF"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/module_media_pop_window_text_bottom_size"
|
||||
android:textColor="#7aFFFFFF"
|
||||
android:text="/"/>
|
||||
<TextView
|
||||
android:id="@+id/window_current_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#7aFFFFFF"
|
||||
tools:text="00:00"
|
||||
app:layout_constraintTop_toBottomOf="@+id/window_scroll_txt"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/window_scroll_txt"
|
||||
android:textSize="@dimen/module_media_pop_window_text_bottom_size" />
|
||||
<TextView
|
||||
android:id="@+id/window_divide"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="/"
|
||||
android:textColor="#7aFFFFFF"
|
||||
app:layout_constraintTop_toTopOf="@+id/window_current_time"
|
||||
app:layout_constraintLeft_toRightOf="@+id/window_current_time"
|
||||
android:textSize="@dimen/module_media_pop_window_text_bottom_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/window_max_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/module_media_pop_window_text_bottom_size"
|
||||
android:textColor="#7aFFFFFF" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/window_max_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#7aFFFFFF"
|
||||
tools:text = "06:50"
|
||||
app:layout_constraintTop_toTopOf="@+id/window_divide"
|
||||
app:layout_constraintLeft_toRightOf="@+id/window_divide"
|
||||
android:textSize="@dimen/module_media_pop_window_text_bottom_size" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/window_play_pause"
|
||||
android:layout_width="@dimen/module_media_pop_window_control_img_size"
|
||||
android:layout_height="@dimen/module_media_pop_window_control_img_size"
|
||||
android:layout_marginRight="@dimen/module_media_pop_window_control_margin_right"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/module_media_window_pop_play"/>
|
||||
<ImageView
|
||||
android:id="@+id/window_play_pause"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="center"
|
||||
app:layout_constraintLeft_toRightOf="@+id/window_scroll_txt"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/window_music_next"
|
||||
android:background="@drawable/module_media_play_bg_selector"
|
||||
android:src="@drawable/module_media_window_pop_play" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/window_music_next"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="center"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/window_play_pause"
|
||||
android:background="@drawable/module_media_next_bg_selector"
|
||||
android:src="@drawable/module_media_next_song" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/window_music_next"
|
||||
android:layout_width="@dimen/module_media_pop_window_control_img_size"
|
||||
android:layout_height="@dimen/module_media_pop_window_control_img_size"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/module_media_next_song"/>
|
||||
</LinearLayout>
|
||||
<com.mogo.module.media.widget.NoScrollSeekBar
|
||||
android:id="@+id/window_progress_bar"
|
||||
android:layout_width="match_parent"
|
||||
@@ -89,13 +99,14 @@
|
||||
android:layout_marginLeft="@dimen/module_media_pop_window_radius_margin"
|
||||
android:layout_marginRight="@dimen/module_media_pop_window_radius_margin"
|
||||
android:max="100"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:progress="50"
|
||||
android:progressDrawable="@drawable/module_media_window_progress_bar"
|
||||
android:splitTrack="false"
|
||||
android:thumbOffset="0dp"
|
||||
android:thumb="@drawable/module_media_progress_pop_bg"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"/>
|
||||
</LinearLayout>
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:thumbOffset="0dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#008577</color>
|
||||
<color name="colorPrimaryDark">#00574B</color>
|
||||
<color name="colorAccent">#D81B60</color>
|
||||
</resources>
|
||||
@@ -1,123 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="module_media_music_state_location">483px</dimen>
|
||||
<dimen name="module_media_music_state_location_x">573px</dimen>
|
||||
|
||||
<!-- lcc start-->
|
||||
<dimen name="module_media_back_width">352px</dimen>
|
||||
<dimen name="module_media_back_height">352px</dimen>
|
||||
<dimen name="module_media_back_radius">10.67px</dimen>
|
||||
<dimen name="module_media_share_full_screen_back_top">12px</dimen>
|
||||
<dimen name="module_media_share_share_icon_width">36px</dimen>
|
||||
<dimen name="module_media_share_full_screen_width">36px</dimen>
|
||||
<dimen name="module_media_share_full_screen_height">36px</dimen>
|
||||
<dimen name="module_media_share_full_screen_pading">5px</dimen>
|
||||
<dimen name="module_media_share_full_screen_margin_left_right">12px</dimen>
|
||||
<dimen name="module_media_share_back_top">62px</dimen>
|
||||
<dimen name="module_media_share_user_back_margin_left_right">16px</dimen>
|
||||
<dimen name="module_media_share_user_back_margin_height">78px</dimen>
|
||||
<dimen name="module_media_share_user_back_radius">10.6px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_left">16px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_width">48px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_height">48px</dimen>
|
||||
<dimen name="module_media_share_user_name_back_margin_left">11px</dimen>
|
||||
<dimen name="module_media_share_user_name_back_margin_right">12px</dimen>
|
||||
<dimen name="module_media_share_user_from_size">12px</dimen>
|
||||
<dimen name="module_media_share_user_name_size">14px</dimen>
|
||||
<dimen name="module_media_share_user_of_share_size">16px</dimen>
|
||||
<dimen name="module_media_share_user_like_back_margin_right">8px</dimen>
|
||||
<dimen name="module_media_share_user_like_width">36px</dimen>
|
||||
<dimen name="module_media_share_user_like_height">36px</dimen>
|
||||
<dimen name="module_media_share_user_like_size">12px</dimen>
|
||||
<dimen name="module_media_share_media_back_top">18px</dimen>
|
||||
<dimen name="module_media_share_media_back_margin_left">30px</dimen>
|
||||
<dimen name="module_media_share_media_back_margin_right">30px</dimen>
|
||||
<dimen name="module_media_share_media_back_height">67.2px</dimen>
|
||||
<dimen name="module_media_share_media_image_radius">3px</dimen>
|
||||
<dimen name="module_media_share_media_image_height">62px</dimen>
|
||||
<dimen name="module_media_share_media_image_width">62px</dimen>
|
||||
<dimen name="module_media_share_media_name_back_left">12px</dimen>
|
||||
<dimen name="module_media_share_media_song_name_size">20px</dimen>
|
||||
<dimen name="module_media_share_media_singer_name_size">15px</dimen>
|
||||
<!-- lcc end-->
|
||||
|
||||
<!-- lidongxiu start-->
|
||||
<dimen name="module_media_share_fragment_width">421px</dimen>
|
||||
<dimen name="module_media_share_fragment_height">280px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding_top">28px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding_left">32.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_bg_radius">11.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_img_size">72.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_img_right">10.7px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_height">72.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding">10px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_scroll_tv1_size">22px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_scroll_tv2_size">16px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_text_size">18px</dimen>
|
||||
<dimen name="module_media_share_fragment_btn_size">22px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_margin_top">32px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_margin_bottom">51px</dimen>
|
||||
<dimen name="module_media_share_fragment_btn_height">68px</dimen>
|
||||
<dimen name="module_media_share_fragment_tv2_margin_top">2px</dimen>
|
||||
<dimen name="module_media_share_fragment_img_radius">3.2px</dimen>
|
||||
|
||||
<dimen name="module_media_pop_window_width">322px</dimen>
|
||||
<dimen name="module_media_pop_window_height">66.7px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_height">60px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_padding">12px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size">48px</dimen>
|
||||
<dimen name="module_media_pop_window_text_width">123px</dimen>
|
||||
<dimen name="module_media_pop_window_text_margin">13px</dimen>
|
||||
<dimen name="module_media_pop_window_text_top_size">18px</dimen>
|
||||
<dimen name="module_media_pop_window_text_bottom_size">14px</dimen>
|
||||
<dimen name="module_media_pop_window_control_img_size">30px</dimen>
|
||||
<dimen name="module_media_pop_window_control_margin_right">21px</dimen>
|
||||
<dimen name="module_media_pop_window_progress_height">4px</dimen>
|
||||
<dimen name="module_media_pop_window_radius">8px</dimen>
|
||||
<dimen name="module_media_pop_window_radius_margin">7px</dimen>
|
||||
|
||||
<dimen name="module_media_toast_share_width">267px</dimen>
|
||||
<dimen name="module_media_toast_share_height">187px</dimen>
|
||||
<dimen name="module_media_toast_share_bg_radius">10px</dimen>
|
||||
<dimen name="module_media_toast_share_img_size">64px</dimen>
|
||||
<dimen name="module_media_toast_share_text_size">18px</dimen>
|
||||
<dimen name="module_media_toast_share_margin_top">11px</dimen>
|
||||
|
||||
<dimen name="module_media_card_width">352px</dimen>
|
||||
<dimen name="module_media_card_height">352px</dimen>
|
||||
<dimen name="module_media_card_radius">10.5px</dimen>
|
||||
<dimen name="module_media_card_radius_blur">11px</dimen>
|
||||
<dimen name="module_media_card_share_full_margin_top">11.5px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_width">175px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_height">175px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_img_width">114px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_img_height">114px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_top_title_size">20px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_bottom_title_size">15px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_top_title_margin">4px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_bottom_title_margin">2px</dimen>
|
||||
<dimen name="module_media_card_progress_height">6px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_size">12px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_margin_left">11px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_margin_bottom">4px</dimen>
|
||||
<dimen name="module_media_card_control_icon_margin_bottom">1px</dimen>
|
||||
|
||||
<dimen name="module_media_card_control_icon_left_padding">8px</dimen>
|
||||
<dimen name="module_media_card_control_icon_size">44px</dimen>
|
||||
<dimen name="module_media_card_control_play_icon_size">62px</dimen>
|
||||
<dimen name="module_media_card_control_play_icon_margin">28px</dimen>
|
||||
<dimen name="module_media_card_progress_margin">1px</dimen>
|
||||
<dimen name="module_media_card_no_share_title_margin">35px</dimen>
|
||||
<dimen name="module_media_card_progress_bg_drawable_width">3.2px</dimen>
|
||||
<dimen name="module_media_card_progress_bg_drawable_height">6.4px</dimen>
|
||||
<dimen name="module_media_card_progress_pop_bg_drawable_width">3px</dimen>
|
||||
<dimen name="module_media_card_progress_pop_bg_drawable_height">4px</dimen>
|
||||
<dimen name="module_media_card_share_user_text_width_max">96px</dimen>
|
||||
|
||||
<dimen name="module_media_draw_rect_map_bottom">32px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_left">400px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_right">80px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_top">150px</dimen>
|
||||
<dimen name="module_media_window_corner">16px</dimen>
|
||||
<!-- lidongxiu end-->
|
||||
</resources>
|
||||
@@ -1,3 +0,0 @@
|
||||
<resources>
|
||||
<string name="app_name">mogo-module-media</string>
|
||||
</resources>
|
||||
@@ -1,11 +0,0 @@
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -1,123 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="module_media_music_state_location">881px</dimen>
|
||||
<dimen name="module_media_music_state_location_x">1067px</dimen>
|
||||
<dimen name="module_media_music_state_location">483px</dimen>
|
||||
<dimen name="module_media_music_state_location_x">573px</dimen>
|
||||
|
||||
<!-- lcc start-->
|
||||
<dimen name="module_media_back_width">660px</dimen>
|
||||
<dimen name="module_media_back_height">660px</dimen>
|
||||
<dimen name="module_media_back_radius">20px</dimen>
|
||||
<dimen name="module_media_share_full_screen_back_top">23px</dimen>
|
||||
<dimen name="module_media_share_share_icon_width">67.5px</dimen>
|
||||
<dimen name="module_media_share_full_screen_width">67.5px</dimen>
|
||||
<dimen name="module_media_share_full_screen_height">67.5px</dimen>
|
||||
<dimen name="module_media_share_full_screen_pading">10px</dimen>
|
||||
<dimen name="module_media_share_full_screen_margin_left_right">23px</dimen>
|
||||
<dimen name="module_media_share_back_top">116px</dimen>
|
||||
<dimen name="module_media_share_user_back_margin_left_right">30px</dimen>
|
||||
<dimen name="module_media_share_user_back_margin_height">145px</dimen>
|
||||
<dimen name="module_media_share_user_back_radius">20px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_left">30px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_width">90px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_height">90px</dimen>
|
||||
<dimen name="module_media_share_user_name_back_margin_left">21px</dimen>
|
||||
<dimen name="module_media_share_user_name_back_margin_right">24px</dimen>
|
||||
<dimen name="module_media_share_user_from_size">23px</dimen>
|
||||
<dimen name="module_media_share_user_name_size">26px</dimen>
|
||||
<dimen name="module_media_share_user_of_share_size">30px</dimen>
|
||||
<dimen name="module_media_share_user_like_back_margin_right">16px</dimen>
|
||||
<dimen name="module_media_share_user_like_width">68px</dimen>
|
||||
<dimen name="module_media_share_user_like_height">68px</dimen>
|
||||
<dimen name="module_media_share_user_like_size">23px</dimen>
|
||||
<dimen name="module_media_share_media_back_top">35px</dimen>
|
||||
<dimen name="module_media_share_media_back_margin_left">56px</dimen>
|
||||
<dimen name="module_media_share_media_back_margin_right">56px</dimen>
|
||||
<dimen name="module_media_share_media_back_height">126px</dimen>
|
||||
<dimen name="module_media_back_width">352px</dimen>
|
||||
<dimen name="module_media_back_height">352px</dimen>
|
||||
<dimen name="module_media_back_radius">10.67px</dimen>
|
||||
<dimen name="module_media_share_full_screen_back_top">12px</dimen>
|
||||
<dimen name="module_media_share_share_icon_width">36px</dimen>
|
||||
<dimen name="module_media_share_full_screen_width">36px</dimen>
|
||||
<dimen name="module_media_share_full_screen_height">36px</dimen>
|
||||
<dimen name="module_media_share_full_screen_pading">5px</dimen>
|
||||
<dimen name="module_media_share_full_screen_margin_left_right">12px</dimen>
|
||||
<dimen name="module_media_share_back_top">62px</dimen>
|
||||
<dimen name="module_media_share_user_back_margin_left_right">16px</dimen>
|
||||
<dimen name="module_media_share_user_back_margin_height">78px</dimen>
|
||||
<dimen name="module_media_share_user_back_radius">10.6px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_left">16px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_width">48px</dimen>
|
||||
<dimen name="module_media_share_user_head_image_height">48px</dimen>
|
||||
<dimen name="module_media_share_user_name_back_margin_left">11px</dimen>
|
||||
<dimen name="module_media_share_user_name_back_margin_right">12px</dimen>
|
||||
<dimen name="module_media_share_user_from_size">12px</dimen>
|
||||
<dimen name="module_media_share_user_name_size">14px</dimen>
|
||||
<dimen name="module_media_share_user_of_share_size">16px</dimen>
|
||||
<dimen name="module_media_share_user_like_back_margin_right">8px</dimen>
|
||||
<dimen name="module_media_share_user_like_width">36px</dimen>
|
||||
<dimen name="module_media_share_user_like_height">36px</dimen>
|
||||
<dimen name="module_media_share_user_like_size">12px</dimen>
|
||||
<dimen name="module_media_share_media_back_top">18px</dimen>
|
||||
<dimen name="module_media_share_media_back_margin_left">30px</dimen>
|
||||
<dimen name="module_media_share_media_back_margin_right">30px</dimen>
|
||||
<dimen name="module_media_share_media_back_height">67.2px</dimen>
|
||||
<dimen name="module_media_share_media_image_radius">3px</dimen>
|
||||
<dimen name="module_media_share_media_image_height">116px</dimen>
|
||||
<dimen name="module_media_share_media_image_width">116px</dimen>
|
||||
<dimen name="module_media_share_media_name_back_left">22px</dimen>
|
||||
<dimen name="module_media_share_media_song_name_size">37.5px</dimen>
|
||||
<dimen name="module_media_share_media_singer_name_size">28px</dimen>
|
||||
<dimen name="module_media_share_media_image_height">62px</dimen>
|
||||
<dimen name="module_media_share_media_image_width">62px</dimen>
|
||||
<dimen name="module_media_share_media_name_back_left">12px</dimen>
|
||||
<dimen name="module_media_share_media_song_name_size">20px</dimen>
|
||||
<dimen name="module_media_share_media_singer_name_size">15px</dimen>
|
||||
<!-- lcc end-->
|
||||
|
||||
<!-- lidongxiu start-->
|
||||
<dimen name="module_media_share_fragment_width">790px</dimen>
|
||||
<dimen name="module_media_share_fragment_height">525px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding_top">55px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding_left">61px</dimen>
|
||||
<dimen name="module_media_share_fragment_bg_radius">20px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_img_size">136px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_img_right">20px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_height">136px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding">34px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_scroll_tv1_size">40px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_scroll_tv2_size">30px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_text_size">34px</dimen>
|
||||
<dimen name="module_media_share_fragment_btn_size">40px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_margin_top">60px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_margin_bottom">96px</dimen>
|
||||
<dimen name="module_media_share_fragment_btn_height">130px</dimen>
|
||||
<dimen name="module_media_share_fragment_tv2_margin_top">4px</dimen>
|
||||
<dimen name="module_media_share_fragment_img_radius">6px</dimen>
|
||||
<dimen name="module_media_share_fragment_width">421px</dimen>
|
||||
<dimen name="module_media_share_fragment_height">280px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding_top">28px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding_left">32.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_bg_radius">11.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_img_size">72.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_img_right">10.7px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_height">72.5px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_padding">10px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_scroll_tv1_size">22px</dimen>
|
||||
<dimen name="module_media_share_fragment_title_scroll_tv2_size">16px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_text_size">18px</dimen>
|
||||
<dimen name="module_media_share_fragment_btn_size">22px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_margin_top">32px</dimen>
|
||||
<dimen name="module_media_share_fragment_center_margin_bottom">51px</dimen>
|
||||
<dimen name="module_media_share_fragment_btn_height">68px</dimen>
|
||||
<dimen name="module_media_share_fragment_tv2_margin_top">2px</dimen>
|
||||
<dimen name="module_media_share_fragment_img_radius">3.2px</dimen>
|
||||
|
||||
<dimen name="module_media_pop_window_width">580px</dimen>
|
||||
<dimen name="module_media_pop_window_height">120px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_height">112px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_padding">20px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size">90px</dimen>
|
||||
<dimen name="module_media_pop_window_text_width">230px</dimen>
|
||||
<dimen name="module_media_pop_window_text_margin">20px</dimen>
|
||||
<dimen name="module_media_pop_window_text_top_size">35px</dimen>
|
||||
<dimen name="module_media_pop_window_text_bottom_size">24px</dimen>
|
||||
<dimen name="module_media_pop_window_control_img_size">56px</dimen>
|
||||
<dimen name="module_media_pop_window_control_margin_right">40px</dimen>
|
||||
<dimen name="module_media_pop_window_progress_height">8px</dimen>
|
||||
<dimen name="module_media_pop_window_radius">16px</dimen>
|
||||
<dimen name="module_media_pop_window_radius_margin">16px</dimen>
|
||||
<dimen name="module_media_toast_share_width">500px</dimen>
|
||||
<dimen name="module_media_toast_share_height">350px</dimen>
|
||||
<dimen name="module_media_toast_share_bg_radius">20px</dimen>
|
||||
<dimen name="module_media_toast_share_img_size">120px</dimen>
|
||||
<dimen name="module_media_toast_share_text_size">36px</dimen>
|
||||
<dimen name="module_media_toast_share_margin_top">20px</dimen>
|
||||
<dimen name="module_media_pop_window_width">322px</dimen>
|
||||
<dimen name="module_media_pop_window_height">66.7px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_height">60px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_padding">12px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size">48px</dimen>
|
||||
<dimen name="module_media_pop_window_text_width">123px</dimen>
|
||||
<dimen name="module_media_pop_window_text_margin">13px</dimen>
|
||||
<dimen name="module_media_pop_window_text_top_size">18px</dimen>
|
||||
<dimen name="module_media_pop_window_text_bottom_size">14px</dimen>
|
||||
<dimen name="module_media_pop_window_control_img_size">30px</dimen>
|
||||
<dimen name="module_media_pop_window_control_margin_right">21px</dimen>
|
||||
<dimen name="module_media_pop_window_progress_height">4px</dimen>
|
||||
<dimen name="module_media_pop_window_radius">8px</dimen>
|
||||
<dimen name="module_media_pop_window_radius_margin">7px</dimen>
|
||||
|
||||
<dimen name="module_media_card_width">660px</dimen>
|
||||
<dimen name="module_media_card_height">660px</dimen>
|
||||
<dimen name="module_media_card_radius">20px</dimen>
|
||||
<dimen name="module_media_card_radius_blur">22px</dimen>
|
||||
<dimen name="module_media_card_share_full_margin_top">22px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_width">348px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_height">348px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_img_width">226px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_img_height">226px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_top_title_size">36px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_bottom_title_size">28px</dimen>
|
||||
<dimen name="module_media_toast_share_width">267px</dimen>
|
||||
<dimen name="module_media_toast_share_height">187px</dimen>
|
||||
<dimen name="module_media_toast_share_bg_radius">10px</dimen>
|
||||
<dimen name="module_media_toast_share_img_size">64px</dimen>
|
||||
<dimen name="module_media_toast_share_text_size">18px</dimen>
|
||||
<dimen name="module_media_toast_share_margin_top">11px</dimen>
|
||||
|
||||
<dimen name="module_media_card_width">352px</dimen>
|
||||
<dimen name="module_media_card_height">352px</dimen>
|
||||
<dimen name="module_media_card_radius">10.5px</dimen>
|
||||
<dimen name="module_media_card_radius_blur">11px</dimen>
|
||||
<dimen name="module_media_card_share_full_margin_top">11.5px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_width">175px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_height">175px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_img_width">114px</dimen>
|
||||
<dimen name="module_media_card_no_share_anim_img_height">114px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_top_title_size">20px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_bottom_title_size">15px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_top_title_margin">4px</dimen>
|
||||
<dimen name="module_media_card_no_share_music_bottom_title_margin">2px</dimen>
|
||||
<dimen name="module_media_card_progress_height">11px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_size">22px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_margin_left">21px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_margin_right">4px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_margin_bottom">6px</dimen>
|
||||
<dimen name="module_media_card_control_icon_margin_bottom">2px</dimen>
|
||||
<dimen name="module_media_card_progress_height">6px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_size">12px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_margin_left">11px</dimen>
|
||||
<dimen name="module_media_card_progress_time_text_margin_bottom">4px</dimen>
|
||||
<dimen name="module_media_card_control_icon_margin_bottom">1px</dimen>
|
||||
|
||||
<dimen name="module_media_card_control_icon_left_padding">15px</dimen>
|
||||
<dimen name="module_media_card_control_icon_size">78px</dimen>
|
||||
<dimen name="module_media_card_control_play_icon_size">107px</dimen>
|
||||
<dimen name="module_media_card_control_play_icon_margin">53px</dimen>
|
||||
<dimen name="module_media_card_progress_margin">2px</dimen>
|
||||
<dimen name="module_media_card_no_share_title_margin">64px</dimen>
|
||||
<dimen name="module_media_card_progress_bg_drawable_width">6px</dimen>
|
||||
<dimen name="module_media_card_progress_bg_drawable_height">12px</dimen>
|
||||
<dimen name="module_media_card_progress_pop_bg_drawable_width">6px</dimen>
|
||||
<dimen name="module_media_card_progress_pop_bg_drawable_height">8px</dimen>
|
||||
<dimen name="module_media_card_share_user_text_width_max">180px</dimen>
|
||||
<dimen name="module_media_card_control_icon_left_padding">8px</dimen>
|
||||
<dimen name="module_media_card_control_icon_size">44px</dimen>
|
||||
<dimen name="module_media_card_control_play_icon_size">62px</dimen>
|
||||
<dimen name="module_media_card_control_play_icon_margin">28px</dimen>
|
||||
<dimen name="module_media_card_progress_margin">1px</dimen>
|
||||
<dimen name="module_media_card_no_share_title_margin">35px</dimen>
|
||||
<dimen name="module_media_card_progress_bg_drawable_width">3.2px</dimen>
|
||||
<dimen name="module_media_card_progress_bg_drawable_height">6.4px</dimen>
|
||||
<dimen name="module_media_card_progress_pop_bg_drawable_width">3px</dimen>
|
||||
<dimen name="module_media_card_progress_pop_bg_drawable_height">4px</dimen>
|
||||
<dimen name="module_media_card_share_user_text_width_max">96px</dimen>
|
||||
|
||||
<dimen name="module_media_draw_rect_map_bottom">60px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_left">750px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_right">120px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_top">270px</dimen>
|
||||
<dimen name="module_media_window_corner">30px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_bottom">32px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_left">400px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_right">80px</dimen>
|
||||
<dimen name="module_media_draw_rect_map_top">150px</dimen>
|
||||
<dimen name="module_media_window_corner">16px</dimen>
|
||||
<!-- lidongxiu end-->
|
||||
</resources>
|
||||
@@ -46,10 +46,12 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
implementation rootProject.ext.dependencies.mogomoduleauth
|
||||
} else {
|
||||
implementation project(":foudations:mogo-utils")
|
||||
api project(":foudations:mogo-commons")
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':modules:mogo-module-authorize')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,10 +2,5 @@
|
||||
package="com.mogo.module.share" >
|
||||
<application>
|
||||
<service android:name=".VoiceCmdService" />
|
||||
<receiver android:name=".ShareVoiceCmdReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.zhidao.speech.awake.notify" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
@@ -1,31 +1,108 @@
|
||||
package com.mogo.module.share;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant;
|
||||
import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListener;
|
||||
import com.mogo.module.authorize.authprovider.module.IMogoAuthorizeModuleManager;
|
||||
import com.mogo.module.share.bean.StepAfterAuth;
|
||||
import com.mogo.module.share.bean.StepAfterAuthKt;
|
||||
import com.mogo.module.share.constant.ShareConstants;
|
||||
import com.mogo.module.share.dialog.LaucherShareDialog;
|
||||
import com.mogo.module.share.manager.ServiceApisManager;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.module.share.manager.UploadHelper;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.share.IMogoShareManager;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import static com.mogo.module.share.bean.StepAfterAuthKt.STEP_AFTER_AUTH_TYPE_SEEK_HELP;
|
||||
import static com.mogo.module.share.bean.StepAfterAuthKt.STEP_AFTER_AUTH_TYPE_SHOW_DIALOG;
|
||||
import static com.mogo.module.share.bean.StepAfterAuthKt.STEP_AFTER_AUTH_TYPE_UPLOAD;
|
||||
import static com.mogo.module.share.constant.ShareConstants.CMD_CANCEL_SHARE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.CMD_ROAD_CLOSURE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.CMD_TRAFFIC_CHECK;
|
||||
import static com.mogo.module.share.constant.ShareConstants.CMD_UPLOAD_ACCIDENT;
|
||||
import static com.mogo.module.share.constant.ShareConstants.CMD_UPLOAD_BLOCK;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_ACCIDENT;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_BLOCK;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_CLOSURE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_DENSE_FOG;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_REAL_TIME_TRAFFIC;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_ROAD_CONSTRUCTION;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_ROAD_ICY;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_STAGNANT_WATER;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_TRAFFIC_CHECK;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_CANCEL_SHARE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_ACCIDENT;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_DENSE_FOG;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_REAL_TIME_TRAFFIC;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_ROAD_BLOCK;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_ROAD_CLOSURE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_ROAD_CONDITION;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_ROAD_CONSTRUCTION;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_ROAD_ICY;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_SEEK_HELP;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_STAGNANT_WATER;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UNWAKE_UPLOAD_TRAFFIC_CHECK;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UPLOAD_DENSE_FOG;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UPLOAD_REAL_TIME_TRAFFIC;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UPLOAD_ROAD_CONSTRUCTION;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UPLOAD_ROAD_ICY;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UPLOAD_SEEK_HELP;
|
||||
import static com.mogo.module.share.constant.ShareConstants.UPLOAD_STAGNANT_WATER;
|
||||
import static com.mogo.module.share.constant.ShareConstants.VOICE_CMD_GO_TO_SHARE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.VOICE_CMD_NO_REPLY_SHARE_DIALOG_CLOSE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.VOICE_CMD_PUB_ROAD_CONDITION;
|
||||
import static com.mogo.module.share.constant.ShareConstants.VOICE_CMD_PUB_TROUBLE_HELP;
|
||||
import static com.mogo.module.share.constant.ShareConstants.VOICE_CMD_SHARE_DIALOG_CLOSE;
|
||||
|
||||
/**
|
||||
* 分享框的逻辑都放到这里吧
|
||||
*
|
||||
* @author lixiaopeng
|
||||
* @description 分享弹框接口
|
||||
* @since 2020-01-10
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_SHARE)
|
||||
public class ShareControl implements IMogoShareManager {
|
||||
public class ShareControl implements IMogoShareManager, IMogoIntentListener, IMogoVoiceCmdCallBack {
|
||||
private static final String TAG = "ShareControl";
|
||||
|
||||
private Context mContext;
|
||||
private LaucherShareDialog mShareDialog;
|
||||
|
||||
private IMogoAuthorizeModuleManager authorizeModuleManager;
|
||||
private IMogoIntentManager intentManager;
|
||||
|
||||
@Override
|
||||
public void showShareDialog() {
|
||||
mShareDialog = new LaucherShareDialog(mContext);
|
||||
mShareDialog.show();
|
||||
if (authorizeModuleManager.needAuthorize(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE)) {
|
||||
authorizeModuleManager.invokeAuthorization(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
realShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -35,9 +112,366 @@ public class ShareControl implements IMogoShareManager {
|
||||
}
|
||||
}
|
||||
|
||||
private void realShowDialog() {
|
||||
if (mShareDialog == null) {
|
||||
mShareDialog = new LaucherShareDialog(mContext);
|
||||
}
|
||||
mShareDialog.show();
|
||||
}
|
||||
|
||||
private StepAfterAuth stepAfterAuth = new StepAfterAuth(-1, "");
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Logger.d(TAG,"start init====");
|
||||
mContext = context;
|
||||
ServiceApisManager.INSTANCE.init(context);
|
||||
authorizeModuleManager =
|
||||
(IMogoAuthorizeModuleManager) ARouter.getInstance().build(AuthorizeConstant.PROVIDER_MODULE).navigation(context);
|
||||
authorizeModuleManager.registerAuthorizeListener(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE, new IMogoAcquireAuthorizeListener() {
|
||||
@Override
|
||||
public void authorizeSuccess() {
|
||||
switch (stepAfterAuth.getType()) {
|
||||
case STEP_AFTER_AUTH_TYPE_SHOW_DIALOG:
|
||||
realShowDialog();
|
||||
break;
|
||||
case STEP_AFTER_AUTH_TYPE_UPLOAD:
|
||||
UploadHelper.INSTANCE.upload(mContext, stepAfterAuth.getUploadType());
|
||||
dismissShareDialog();
|
||||
break;
|
||||
case STEP_AFTER_AUTH_TYPE_SEEK_HELP:
|
||||
seekHelp();
|
||||
dismissShareDialog();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void authorizeFailed(@NotNull String errorMsg) {
|
||||
TipToast.tip("未授权,无法分享");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forbiddenVoiceWhenAuthorize(@NotNull String cmd) {
|
||||
TipToast.tip("未授权,无法分享");
|
||||
}
|
||||
});
|
||||
intentManager = ServiceApisManager.serviceApis.getIntentManagerApi();
|
||||
intentManager.registerIntentListener(VOICE_CMD_GO_TO_SHARE, this);
|
||||
intentManager.registerIntentListener(VOICE_CMD_PUB_TROUBLE_HELP, this);
|
||||
intentManager.registerIntentListener(VOICE_CMD_PUB_ROAD_CONDITION, this);
|
||||
intentManager.registerIntentListener(VOICE_CMD_SHARE_DIALOG_CLOSE, this);
|
||||
intentManager.registerIntentListener(VOICE_CMD_NO_REPLY_SHARE_DIALOG_CLOSE, this);
|
||||
intentManager.registerIntentListener(UNWAKE_UPLOAD_ROAD_CONDITION, this);
|
||||
|
||||
// 免唤醒词注册
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ROAD_BLOCK,
|
||||
CMD_UPLOAD_BLOCK, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_TRAFFIC_CHECK,
|
||||
CMD_TRAFFIC_CHECK, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ROAD_CLOSURE,
|
||||
CMD_ROAD_CLOSURE, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_CANCEL_SHARE,
|
||||
CMD_CANCEL_SHARE, this);
|
||||
if (DebugConfig.getAIType() == DebugConfig.AI_TYPE_TXZ) {
|
||||
// 使用同行者语义你的话,增加如下免唤醒词
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ACCIDENT,
|
||||
CMD_UPLOAD_ACCIDENT, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_REAL_TIME_TRAFFIC,
|
||||
UPLOAD_REAL_TIME_TRAFFIC, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_SEEK_HELP,
|
||||
UPLOAD_SEEK_HELP, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_STAGNANT_WATER,
|
||||
UPLOAD_STAGNANT_WATER, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ROAD_ICY,
|
||||
UPLOAD_ROAD_ICY, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_DENSE_FOG,
|
||||
UPLOAD_DENSE_FOG, this);
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ROAD_CONSTRUCTION,
|
||||
UPLOAD_ROAD_CONSTRUCTION, this);
|
||||
}
|
||||
|
||||
Logger.d(TAG,"init over====");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCmdSelected(String cmd) {
|
||||
switch (cmd) {
|
||||
case UNWAKE_CANCEL_SHARE:
|
||||
dismissShareDialog();
|
||||
break;
|
||||
case UNWAKE_UPLOAD_ROAD_BLOCK:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_BLOCK);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_BLOCK);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_TRAFFIC_CHECK:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_TRAFFIC_CHECK);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_TRAFFIC_CHECK);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_ROAD_CLOSURE:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_CLOSURE);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_CLOSURE);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_ACCIDENT:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_ACCIDENT);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_ACCIDENT);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_REAL_TIME_TRAFFIC:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_REAL_TIME_TRAFFIC);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_REAL_TIME_TRAFFIC);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_SEEK_HELP:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_SEEK_HELP, TYPE_BLOCK);
|
||||
} else {
|
||||
seekHelp();
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_STAGNANT_WATER:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_STAGNANT_WATER);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_STAGNANT_WATER);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_ROAD_ICY:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_ROAD_ICY);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_ROAD_ICY);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_DENSE_FOG:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_DENSE_FOG);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_DENSE_FOG);
|
||||
}
|
||||
break;
|
||||
case UNWAKE_UPLOAD_ROAD_CONSTRUCTION:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_ROAD_CONSTRUCTION);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_ROAD_CONSTRUCTION);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIntentReceived(String intentStr, Intent intent) {
|
||||
// 此处只接受处理语音相关广播
|
||||
Logger.d(TAG, "收到唤醒词指令: " + intentStr);
|
||||
try {
|
||||
switch (intentStr) {
|
||||
case VOICE_CMD_PUB_TROUBLE_HELP:
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_SEEK_HELP, TYPE_DENSE_FOG);
|
||||
} else {
|
||||
// 开启服务,准备上报求助
|
||||
seekHelp();
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case VOICE_CMD_GO_TO_SHARE:
|
||||
String ob =
|
||||
new JSONObject(intent.getStringExtra("data")).opt("ob").toString();
|
||||
Logger.d(TAG, "ob: " + ob);
|
||||
switch (ob) {
|
||||
case "积水":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_STAGNANT_WATER);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_STAGNANT_WATER);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case "积冰":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_ROAD_ICY);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_ROAD_ICY);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case "雾":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_DENSE_FOG);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_DENSE_FOG);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case "交通事故":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_ACCIDENT);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_ACCIDENT);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case "施工":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_ROAD_CONSTRUCTION);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_ROAD_CONSTRUCTION);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case "封路":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_CLOSURE);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_CLOSURE);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case "交通检查":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_TRAFFIC_CHECK);
|
||||
} else {
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_TRAFFIC_CHECK);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
showShareDialog();
|
||||
break;
|
||||
}
|
||||
case VOICE_CMD_PUB_ROAD_CONDITION:
|
||||
String obCondition =
|
||||
new JSONObject(intent.getStringExtra("data")).opt("obj").toString();
|
||||
Logger.d(TAG, "ob:" + obCondition);
|
||||
switch (obCondition) {
|
||||
case "路况":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_REAL_TIME_TRAFFIC);
|
||||
} else {
|
||||
Logger.d(TAG, "分享框准备触发上报实时路况");
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_REAL_TIME_TRAFFIC);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
case "拥堵":
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_UPLOAD, TYPE_BLOCK);
|
||||
} else {
|
||||
Logger.d(TAG, "分享框准备触发上报拥堵");
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_BLOCK);
|
||||
dismissShareDialog();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case VOICE_CMD_SHARE_DIALOG_CLOSE:
|
||||
dismissShareDialog();
|
||||
break;
|
||||
case VOICE_CMD_NO_REPLY_SHARE_DIALOG_CLOSE:
|
||||
dismissShareDialog();
|
||||
break;
|
||||
case UNWAKE_UPLOAD_ROAD_CONDITION:
|
||||
Logger.d(TAG, "免唤醒准备触发上报拥堵");
|
||||
UploadHelper.INSTANCE.upload(mContext, TYPE_BLOCK);
|
||||
dismissShareDialog();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logger.e(TAG, e, "ShareControl exception");
|
||||
}
|
||||
}
|
||||
|
||||
private void seekHelp() {
|
||||
Intent seekHelp = new Intent(mContext, VoiceCmdService.class);
|
||||
seekHelp.putExtra(ShareConstants.VOICE_CMD_SERVICE_EVENT_KEY,
|
||||
ShareConstants.VOICE_CMD_SERVICE_SEEK_HELP);
|
||||
mContext.startService(seekHelp);
|
||||
}
|
||||
|
||||
private boolean needAuth() {
|
||||
return authorizeModuleManager.needAuthorize(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
}
|
||||
|
||||
private void goAuth(int type, String uploadType) {
|
||||
stepAfterAuth.setType(type);
|
||||
stepAfterAuth.setUploadType(uploadType);
|
||||
authorizeModuleManager.invokeAuthorization(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment createFragment(Context context, Bundle data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView(Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return "ShareControl";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoModuleLifecycle getCardLifecycle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapListener getMapListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoNaviListener getNaviListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoLocationListener getLocationListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMarkerClickListener getMarkerClickListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppPackage() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppName() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
package com.mogo.module.share
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.module.share.constant.ShareConstants
|
||||
import com.mogo.module.share.constant.ShareConstants.*
|
||||
import com.mogo.module.share.manager.ServiceApisManager
|
||||
import com.mogo.module.share.manager.UploadHelper
|
||||
import com.mogo.utils.logger.Logger
|
||||
import org.json.JSONObject
|
||||
|
||||
/**
|
||||
* 用于接收唤醒词指令,现在只接收 com.zhidao.speech.awake.notify 这一条广播
|
||||
*/
|
||||
class ShareVoiceCmdReceiver : BroadcastReceiver() {
|
||||
private val TAG = "ShareVoiceCmdReceiver"
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
// 接收唤醒词指令
|
||||
val command = intent.getStringExtra("command")?:""
|
||||
Logger.d(TAG, "收到唤醒词指令: $command")
|
||||
when (command) {
|
||||
VOICE_CMD_PUB_TROUBLE_HELP -> {
|
||||
// 开启服务,准备上报求助
|
||||
val seekHelp = Intent(context, VoiceCmdService::class.java)
|
||||
seekHelp.putExtra(ShareConstants.VOICE_CMD_SERVICE_EVENT_KEY, ShareConstants.VOICE_CMD_SERVICE_SEEK_HELP)
|
||||
context.startService(seekHelp)
|
||||
ServiceApisManager.serviceApis.shareManager.dismissShareDialog()
|
||||
// ShareControl.getInstance(context).dismissDialog()
|
||||
}
|
||||
VOICE_CMD_GO_TO_SHARE ->{
|
||||
val ob = JSONObject(intent.getStringExtra("data") ?: "").opt("ob")
|
||||
Logger.d(TAG, "ob: $ob")
|
||||
when (ob) {
|
||||
"积水"->{
|
||||
UploadHelper.upload(context, TYPE_STAGNANT_WATER)
|
||||
ServiceApisManager.serviceApis.shareManager.dismissShareDialog()
|
||||
// ShareControl.getInstance(context).dismissDialog()
|
||||
}
|
||||
"积冰"->{
|
||||
UploadHelper.upload(context, TYPE_ROAD_ICY)
|
||||
ServiceApisManager.serviceApis.shareManager.dismissShareDialog()
|
||||
// ShareControl.getInstance(context).dismissDialog()
|
||||
}
|
||||
"雾"->{
|
||||
UploadHelper.upload(context, TYPE_DENSE_FOG)
|
||||
ServiceApisManager.serviceApis.shareManager.dismissShareDialog()
|
||||
// ShareControl.getInstance(context).dismissDialog()
|
||||
}
|
||||
"交通事故"->{
|
||||
UploadHelper.upload(context, TYPE_ACCIDENT)
|
||||
ServiceApisManager.serviceApis.shareManager.dismissShareDialog()
|
||||
// ShareControl.getInstance(context).dismissDialog()
|
||||
}
|
||||
"施工"->{
|
||||
UploadHelper.upload(context, TYPE_ROAD_CONSTRUCTION)
|
||||
ServiceApisManager.serviceApis.shareManager.dismissShareDialog()
|
||||
// ShareControl.getInstance(context).dismissDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
VOICE_CMD_PUB_ROAD_CONDITION->{
|
||||
val ob = JSONObject(intent.getStringExtra("data") ?: "").opt("obj")
|
||||
Logger.d(TAG, "ob: $ob")
|
||||
if(ob == "路况") {
|
||||
// 上报实时路况
|
||||
Logger.d(TAG, "分享框准备触发上报实时路况")
|
||||
UploadHelper.upload(context, TYPE_REAL_TIME_TRAFFIC)
|
||||
ServiceApisManager.serviceApis.shareManager.dismissShareDialog()
|
||||
// ShareControl.getInstance(context).dismissDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.mogo.module.share.bean
|
||||
|
||||
/**
|
||||
* 授权完成后,下一步要做的事情
|
||||
*/
|
||||
class StepAfterAuth(var type:Int,var uploadType:String)
|
||||
|
||||
const val STEP_AFTER_AUTH_TYPE_SHOW_DIALOG = 1
|
||||
const val STEP_AFTER_AUTH_TYPE_UPLOAD = 2
|
||||
const val STEP_AFTER_AUTH_TYPE_SEEK_HELP = 3
|
||||
@@ -8,24 +8,80 @@ package com.mogo.module.share.constant;
|
||||
*/
|
||||
public class ShareConstants {
|
||||
|
||||
//埋点数据
|
||||
//分享分类
|
||||
/**
|
||||
* 分享分类
|
||||
*/
|
||||
public static final String LAUNCHER_SHARE_TYPE = "Launcher_Share_type";
|
||||
//分享/上报按钮点击
|
||||
/**
|
||||
* 分享/上报按钮点击
|
||||
*/
|
||||
public static final String LAUNCHER_SHARE_CLICK = "Launcher_Share_Click";
|
||||
//
|
||||
public static final String CARNET_USER_UPLOAD = "CarNet_user_upload";
|
||||
|
||||
public static final String VOICE_CMD_SERVICE_EVENT_KEY = "type";
|
||||
public static final int VOICE_CMD_SERVICE_SEEK_HELP = 1;
|
||||
|
||||
// 此处只记录了事故、实时路况、道路积水、道路结冰、浓雾,至于拥堵、交通检查和封路是在extention模块里面管理
|
||||
public static final String VOICE_CMD_PUB_TROUBLE_HELP = "com.zhidao.auxiliaryDriving.pubTroubleHelp";
|
||||
|
||||
public static final String VOICE_CMD_PUB_TROUBLE_HELP = "com.zhidao.auxiliaryDriving" +
|
||||
".pubTroubleHelp";
|
||||
public static final String VOICE_CMD_GO_TO_SHARE = "com.zhidao.share";
|
||||
|
||||
/**
|
||||
* 免唤醒词上报拥堵
|
||||
*/
|
||||
public static final String UNWAKE_UPLOAD_ROAD_CONDITION = "command_upload_roadcondition";
|
||||
|
||||
/**
|
||||
* 关闭分享框 唤醒
|
||||
*/
|
||||
public static final String VOICE_CMD_SHARE_DIALOG_CLOSE = "com.zhidao.share.close";
|
||||
/**
|
||||
* 两次未回复关闭分享对话框
|
||||
*/
|
||||
public static final String VOICE_CMD_NO_REPLY_SHARE_DIALOG_CLOSE = "com.zhidao.share.dialog" +
|
||||
".close";
|
||||
|
||||
/**
|
||||
* 免唤醒上报拥堵
|
||||
*/
|
||||
public static final String UNWAKE_UPLOAD_ROAD_BLOCK = "command_upload_block";
|
||||
/**
|
||||
* 免唤醒上报交通检查
|
||||
*/
|
||||
public static final String UNWAKE_UPLOAD_TRAFFIC_CHECK = "command_upload_traffic_check";
|
||||
/**
|
||||
* 免唤醒上报封路
|
||||
*/
|
||||
public static final String UNWAKE_UPLOAD_ROAD_CLOSURE = "command_upload_road_closure";
|
||||
|
||||
public static final String UNWAKE_UPLOAD_ACCIDENT = "command_upload_accident";
|
||||
public static final String UNWAKE_UPLOAD_REAL_TIME_TRAFFIC = "command_upload_real_time_traffic";
|
||||
public static final String UNWAKE_UPLOAD_SEEK_HELP = "command_upload_seek_help";
|
||||
public static final String UNWAKE_UPLOAD_STAGNANT_WATER = "command_upload_stagnant_water";
|
||||
public static final String UNWAKE_UPLOAD_ROAD_ICY = "command_upload_road_icy";
|
||||
public static final String UNWAKE_UPLOAD_DENSE_FOG = "command_upload_dense_fog";
|
||||
public static final String UNWAKE_UPLOAD_ROAD_CONSTRUCTION = "command_upload_road_construction";
|
||||
|
||||
public static final String[] CMD_UPLOAD_BLOCK = {"上报拥堵"};
|
||||
public static final String[] CMD_TRAFFIC_CHECK = {"上报交通检查"};
|
||||
public static final String[] CMD_ROAD_CLOSURE = {"上报封路"};
|
||||
public static final String[] CMD_UPLOAD_ACCIDENT = {"上报事故", "上报交通事故"};
|
||||
public static final String[] UPLOAD_REAL_TIME_TRAFFIC = {"上报实时路况", "上报路况"};
|
||||
public static final String[] UPLOAD_SEEK_HELP = {"故障求助","发起故障求助"};
|
||||
public static final String[] UPLOAD_STAGNANT_WATER = {"上报积水"};
|
||||
public static final String[] UPLOAD_ROAD_ICY = {"上报积冰","上报道路积冰","上报结冰","上报道路结冰"};
|
||||
public static final String[] UPLOAD_DENSE_FOG = {"上报大雾", "上报浓雾"};
|
||||
public static final String[] UPLOAD_ROAD_CONSTRUCTION = {"上报施工", "上报道路施工"};
|
||||
|
||||
public static final String[] CMD_CANCEL_SHARE = {"取消分享"};
|
||||
public static final String UNWAKE_CANCEL_SHARE = "com.zhidao.launcher.cancle.share";
|
||||
|
||||
/**
|
||||
* 这个是实时路况,不是拥堵,拥堵放在了extention模块里面处理
|
||||
*/
|
||||
public static final String VOICE_CMD_PUB_ROAD_CONDITION = "com.zhidao.pathfinder.report.roadCondition";
|
||||
public static final String VOICE_CMD_PUB_ROAD_CONDITION = "com.zhidao.pathfinder.report" +
|
||||
".roadCondition";
|
||||
|
||||
public static final String TYPE_BLOCK = "10007";
|
||||
public static final String TYPE_TRAFFIC_CHECK = "10002";
|
||||
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 765 B |
|
After Width: | Height: | Size: 767 B |
@@ -25,8 +25,8 @@
|
||||
android:layout_marginTop="@dimen/share_module_title_margin_top"
|
||||
android:text="我要分享"
|
||||
android:textColor="@color/white"
|
||||
android:drawableLeft="@drawable/module_share_title_icon"
|
||||
android:drawableRight="@drawable/module_share_title_icon"
|
||||
android:drawableLeft="@drawable/module_share_title_icon_left"
|
||||
android:drawableRight="@drawable/module_share_title_icon_right"
|
||||
android:drawablePadding="@dimen/dp_40"
|
||||
android:textSize="@dimen/share_module_title_content"
|
||||
android:textStyle="bold"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.mogo.service.share;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
|
||||
/**
|
||||
* 分享框管理接口
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public interface IMogoShareManager extends IProvider {
|
||||
public interface IMogoShareManager extends IMogoModuleProvider {
|
||||
/**
|
||||
* 显示分享框
|
||||
*/
|
||||
|
||||