Merge remote-tracking branch 'origin/feature/v1.0.0' into feature/v1.0.0
This commit is contained in:
@@ -71,6 +71,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.carcallprovider
|
||||
implementation rootProject.ext.dependencies.carcall
|
||||
implementation rootProject.ext.dependencies.modulemedia
|
||||
implementation rootProject.ext.dependencies.modulefreshnews
|
||||
|
||||
implementation rootProject.ext.dependencies.modulepush,{
|
||||
exclude group:'com.mogo.module',module:'module-common'
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.auto.zhidao.logsdk.CrashSystem;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.launcher.news.FreshNewsConstants;
|
||||
import com.mogo.module.adcard.AdCardConstants;
|
||||
import com.mogo.module.carchatting.card.CallChatConstant;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
@@ -49,6 +50,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addModule(new MogoModule(TanluConstants.TAG, TanluConstants.MODEL_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule(MediaConstants.TAG, MediaConstants.MODULE_TYPE));
|
||||
MogoModulePaths.addModule(new MogoModule( FreshNewsConstants.TAG, FreshNewsConstants.MODULE_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule(PushUIConstants.TAG, PushUIConstants.TAG));
|
||||
}
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@ ext {
|
||||
modulepush : "com.mogo.module:module-push:${MOGO_MODULE_PUSH_VERSION}",
|
||||
//运营位卡片
|
||||
moduleadcard : "com.mogo.module:module-adcard:${MOGO_MODULE_AD_CARD_VERSION}",
|
||||
modulefreshnews : "com.mogo.module:module-freshnews:${MOGO_MODULE_FRESH_NEWS_VERSION}",
|
||||
// 长链
|
||||
socketsdk : 'com.zhidao.socketsdk:socketsdk:2.1.0',
|
||||
socketsdkconnsvrprotoco : 'com.zhidao.ptech:connsvr-protoco:0.1.23',
|
||||
|
||||
@@ -53,5 +53,6 @@ MOGO_MODULE_MEDIA_VERSION=1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_PUSH_VERSION=1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_SEARCH_VERSION=1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_AD_CARD_VERSION=1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_FRESH_NEWS_VERSION=1.0.0-SNAPSHOT
|
||||
|
||||
|
||||
|
||||
@@ -108,6 +108,13 @@ public class AppsFragment extends MvpFragment< AppsView, AppsPresenter > impleme
|
||||
mLoadingView.setVisibility( View.GONE );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exit() {
|
||||
if ( mExit != null ) {
|
||||
mExit.performClick();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Animation onCreateAnimation( int transit, boolean enter, int nextAnim ) {
|
||||
TranslateAnimation animation = null;
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package com.mogo.module.apps;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.module.apps.applaunch.AppLaunchFilter;
|
||||
import com.mogo.module.apps.applaunch.AppLauncher;
|
||||
import com.mogo.module.apps.applaunch.CardAppLauncher;
|
||||
import com.mogo.module.apps.model.AppInfo;
|
||||
import com.mogo.module.apps.model.AppsModel;
|
||||
import com.mogo.module.apps.utils.LaunchUtils;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.utils.ThreadPoolService;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -30,9 +30,16 @@ public class AppsPresenter extends Presenter< AppsView > {
|
||||
private static final String TAG = "AppsPresenter";
|
||||
|
||||
private IMogoAnalytics mAnalytics;
|
||||
private AppLaunchFilter mLauncher;
|
||||
|
||||
private IMogoCardManager mCardManager;
|
||||
|
||||
public AppsPresenter( AppsView view ) {
|
||||
super( view );
|
||||
mCardManager = ( IMogoCardManager ) ARouter.getInstance().build( MogoServicePaths.PATH_CARD_MANAGER ).navigation( getContext() );
|
||||
CardAppLauncher cardAppLauncher = new CardAppLauncher( this, mCardManager );
|
||||
cardAppLauncher.setNext( new AppLauncher() );
|
||||
mLauncher = cardAppLauncher;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,9 +75,9 @@ public class AppsPresenter extends Presenter< AppsView > {
|
||||
|
||||
trackAppClicked( appInfo );
|
||||
try {
|
||||
LaunchUtils.launchByPkg( getContext(), appInfo.getPackageName() );
|
||||
mLauncher.launch( getContext(), appInfo );
|
||||
} catch ( Exception e ) {
|
||||
TipToast.shortTip( R.string.module_apps_str_no_app );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,5 +99,12 @@ public class AppsPresenter extends Presenter< AppsView > {
|
||||
super.onDestroy( owner );
|
||||
AppsListChangedLiveData.getInstance().release();
|
||||
mView = null;
|
||||
mLauncher.destroy();
|
||||
}
|
||||
|
||||
public void exit() {
|
||||
if ( mView != null ) {
|
||||
mView.exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,4 +20,9 @@ public interface AppsView extends IView {
|
||||
* @param appInfos
|
||||
*/
|
||||
void renderApps( Map< Integer, List< AppInfo > > appInfos );
|
||||
|
||||
/**
|
||||
* 退出列表页面
|
||||
*/
|
||||
void exit();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.mogo.module.apps.applaunch;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.module.apps.model.AppInfo;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-02-09
|
||||
* <p>
|
||||
* 按指定方式启动指定的app
|
||||
*/
|
||||
public interface AppLaunchFilter {
|
||||
|
||||
void launch( Context context, AppInfo appInfo );
|
||||
|
||||
void destroy();
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.mogo.module.apps.applaunch;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.module.apps.R;
|
||||
import com.mogo.module.apps.model.AppInfo;
|
||||
import com.mogo.module.apps.utils.LaunchUtils;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-02-09
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class AppLauncher extends BaseAppLauncher {
|
||||
|
||||
private static final String TAG = "AppLauncher";
|
||||
|
||||
@Override
|
||||
public void launch( Context context, AppInfo appInfo ) {
|
||||
try {
|
||||
LaunchUtils.launchByPkg( context, appInfo.getPackageName() );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
TipToast.shortTip( R.string.module_apps_str_no_app );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
if ( getNext() != null ) {
|
||||
getNext().destroy();
|
||||
setNext( null );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mogo.module.apps.applaunch;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-02-09
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public abstract class BaseAppLauncher implements AppLaunchFilter {
|
||||
|
||||
private AppLaunchFilter mNext;
|
||||
|
||||
public AppLaunchFilter getNext() {
|
||||
return mNext;
|
||||
}
|
||||
|
||||
public void setNext( AppLaunchFilter next ) {
|
||||
this.mNext = next;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.mogo.module.apps.applaunch;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.module.apps.AppsPresenter;
|
||||
import com.mogo.module.apps.model.AppInfo;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-02-09
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class CardAppLauncher extends BaseAppLauncher {
|
||||
|
||||
private static Map< String, String > sCardApps = new HashMap<>();
|
||||
|
||||
static {
|
||||
sCardApps.put( "com.zhidao.roadcondition.split", "CARD_TYPE_ROAD_CONDITION" );
|
||||
sCardApps.put( "com.zhidao.roadcondition", "CARD_TYPE_ROAD_CONDITION" );
|
||||
sCardApps.put( "com.zhidao.imdemo", "CARD_TYPE_CARS_CHATTING" );
|
||||
}
|
||||
|
||||
private AppsPresenter mAppsPresenter;
|
||||
private IMogoCardManager mCardManager;
|
||||
|
||||
public CardAppLauncher( AppsPresenter mAppsPresenter, IMogoCardManager mCardManager ) {
|
||||
this.mAppsPresenter = mAppsPresenter;
|
||||
this.mCardManager = mCardManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void launch( Context context, AppInfo appInfo ) {
|
||||
if ( sCardApps.containsKey( appInfo.getPackageName() ) ) {
|
||||
mCardManager.switch2( sCardApps.get( appInfo.getPackageName() ) );
|
||||
mAppsPresenter.exit();
|
||||
} else {
|
||||
if ( getNext() != null ) {
|
||||
getNext().launch( context, appInfo );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
mAppsPresenter = null;
|
||||
mCardManager = null;
|
||||
if ( getNext() != null ) {
|
||||
getNext().destroy();
|
||||
setNext( null );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.mogo.module.apps.model;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-02-09
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class CardAppInfo extends AppInfo {
|
||||
|
||||
private String mCardType;
|
||||
|
||||
public CardAppInfo( AppInfo app, String cardType ) {
|
||||
super( app.getName(), app.getPackageName(), app.getVersionName(), app.getVersionCode(), app.getIcon() );
|
||||
this.mCardType = cardType;
|
||||
}
|
||||
}
|
||||
@@ -406,6 +406,8 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
// 部分非用户操作导致地图视图变化:绘线、圈点等不触发用户刷新
|
||||
// 消费状态
|
||||
if ( mStatusManager.isUserInteracted() ) {
|
||||
mLastCustomRefreshCenterLocation = latLng;
|
||||
mLastZoomLevel = zoom;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user