Merge remote-tracking branch 'origin/feature/v1.0.1' into feature/v1.0.1
This commit is contained in:
2
.idea/misc.xml
generated
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="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -27,6 +27,11 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.mogo.commons.network.Constants;
|
||||
import com.mogo.commons.network.ParamsUtil;
|
||||
import com.mogo.commons.network.X509TrustManagerImpl;
|
||||
import com.mogo.commons.storage.SpStorage;
|
||||
import com.mogo.utils.ThreadPoolService;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.NetConfig;
|
||||
@@ -56,7 +57,11 @@ public class AbsMogoApplication extends Application {
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
syncInit();
|
||||
asyncInit();
|
||||
}
|
||||
|
||||
private void syncInit(){
|
||||
// 初始化埋点
|
||||
Analytics.getInstance().start( sApp );
|
||||
Analytics.getInstance().setAppKey( "6bbe7e0e1ecd8e2f8dc336e1678a2791" );
|
||||
@@ -72,9 +77,6 @@ public class AbsMogoApplication extends Application {
|
||||
}
|
||||
ARouter.init( sApp );
|
||||
|
||||
// 初始化toast
|
||||
TipToast.init( sApp, null );
|
||||
|
||||
initNetConfig();
|
||||
initAccountSdk();
|
||||
}
|
||||
@@ -117,6 +119,14 @@ public class AbsMogoApplication extends Application {
|
||||
return sc;
|
||||
}
|
||||
|
||||
private void asyncInit(){
|
||||
ThreadPoolService.execute( ()->{
|
||||
initAccountSdk();
|
||||
// 初始化toast
|
||||
TipToast.init( sApp, null );
|
||||
} );
|
||||
}
|
||||
|
||||
private static void initAccountSdk() {
|
||||
AccountClientManager.init( sApp, DebugConfig.getNetMode(), NetEnvironManager.OS_2C, "os2.0-launcher" );
|
||||
AccountClientManager.getTicket( new TicketInfoCallback() {
|
||||
|
||||
@@ -21,6 +21,8 @@ import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.main.assist.MapBroadCastHelper;
|
||||
import com.mogo.module.main.cards.CardModulesAdapter;
|
||||
import com.mogo.module.main.cards.MogoModulesHandler;
|
||||
@@ -30,6 +32,7 @@ import com.mogo.module.main.cards.OrientedViewPager;
|
||||
import com.mogo.module.main.cards.VerticalStackTransformer;
|
||||
import com.mogo.module.main.constants.MainConstants;
|
||||
import com.mogo.module.main.windowview.WindowViewHandler;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
@@ -214,7 +217,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
WindowViewHandler.init( mFloatingLayout );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 卡片展示时长埋点
|
||||
*
|
||||
@@ -273,7 +275,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
protected void onCreate( @Nullable Bundle savedInstanceState ) {
|
||||
super.onCreate( savedInstanceState );
|
||||
|
||||
// MogoModulePaths.addModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) );
|
||||
MogoModulePaths.addModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) );
|
||||
|
||||
mMogoModuleHandler = new MogoModulesManager( this );
|
||||
mMogoMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation();
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
android:layout_below="@+id/block_up_iv"
|
||||
android:layout_marginTop="@dimen/share_module_tv_margin_top"
|
||||
android:gravity="center"
|
||||
android:text="拥堵"
|
||||
android:text="上报拥堵"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/share_module_item"
|
||||
android:textStyle="bold" />
|
||||
@@ -70,7 +70,7 @@
|
||||
android:layout_below="@+id/oil_price_iv"
|
||||
android:layout_marginTop="@dimen/share_module_tv_margin_top"
|
||||
android:gravity="center"
|
||||
android:text="油价"
|
||||
android:text="分享油价"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/share_module_item"
|
||||
android:textStyle="bold" />
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/traffic_check_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="@dimen/share_module_image_width_second"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/share_module_margin_left"
|
||||
android:layout_toRightOf="@+id/oil_price_layout">
|
||||
@@ -87,16 +87,17 @@
|
||||
android:id="@+id/traffic_check_iv"
|
||||
android:layout_width="@dimen/share_module_image_width"
|
||||
android:layout_height="@dimen/share_module_image_width"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:src="@drawable/share_traffic_check" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/traffic_check_tv"
|
||||
android:layout_width="@dimen/share_module_image_width"
|
||||
android:layout_width="@dimen/share_module_image_width_second"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/traffic_check_iv"
|
||||
android:layout_marginTop="@dimen/share_module_tv_margin_top"
|
||||
android:gravity="center"
|
||||
android:text="交通检查"
|
||||
android:text="上报交通检查"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/share_module_item"
|
||||
android:textStyle="bold" />
|
||||
@@ -122,7 +123,7 @@
|
||||
android:layout_below="@+id/road_closure_iv"
|
||||
android:layout_marginTop="@dimen/share_module_tv_margin_top"
|
||||
android:gravity="center"
|
||||
android:text="封路"
|
||||
android:text="上报封路"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/share_module_item"
|
||||
android:textStyle="bold" />
|
||||
@@ -135,7 +136,7 @@
|
||||
android:layout_below="@+id/btn_block_layout"
|
||||
android:layout_marginTop="@dimen/share_module_bottom_margin_top"
|
||||
android:gravity="center"
|
||||
android:text="可以对小智说:上报路况、分享油价、交通检查、交通管制"
|
||||
android:text="可以对小智说:上报拥堵、分享油价、上报交通检查、上报封路"
|
||||
android:textColor="@color/white_40"
|
||||
android:textSize="@dimen/share_module_bottom_size"
|
||||
android:textStyle="bold" />
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<dimen name="share_module_margin_left">64px</dimen>
|
||||
<dimen name="share_module_tv_margin_top">15px</dimen>
|
||||
<dimen name="share_module_image_width">85px</dimen>
|
||||
<dimen name="share_module_image_width_second">110px</dimen>
|
||||
<dimen name="share_module_bottom_margin_top">28px</dimen>
|
||||
|
||||
<!--字体-->
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<dimen name="share_module_margin_left">120px</dimen>
|
||||
<dimen name="share_module_tv_margin_top">30px</dimen>
|
||||
<dimen name="share_module_image_width">160px</dimen>
|
||||
<dimen name="share_module_image_width_second">198px</dimen>
|
||||
<dimen name="share_module_bottom_margin_top">55px</dimen>
|
||||
|
||||
<!--字体-->
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<dimen name="share_module_margin_left">120px</dimen>
|
||||
<dimen name="share_module_tv_margin_top">30px</dimen>
|
||||
<dimen name="share_module_image_width">160px</dimen>
|
||||
<dimen name="share_module_image_width_second">198px</dimen>
|
||||
<dimen name="share_module_bottom_margin_top">55px</dimen>
|
||||
|
||||
<!--字体-->
|
||||
|
||||
@@ -13,6 +13,8 @@ public class TanluConstants {
|
||||
public static final String MODEL_NAME = "CARD_TYPE_ROAD_CONDITION";
|
||||
|
||||
public static final String[] CMD_PLAY_ROAD_CONDITION = {"播放路况"};
|
||||
public static final String[] CMD_THE_PREVIOUS = {"上一条"};
|
||||
public static final String[] CMD_THE_NEXT = {"下一条"};
|
||||
|
||||
//上报路况
|
||||
public static final String UPLOAD_ROAD_CONDITION = "command_upload_roadcondition";
|
||||
@@ -21,6 +23,11 @@ public class TanluConstants {
|
||||
//播放
|
||||
public static final String PLAY_VIDEO = "com.zhidao.tanlu.play";
|
||||
|
||||
//上一条
|
||||
public static final String THE_PREVIOUS = "com.zhidao.tanlu.previous";
|
||||
//下一条
|
||||
public static final String THE_NEXT = "com.zhidao.tanlu.next";
|
||||
|
||||
//分享封路
|
||||
public static final String SHARE_ROAD_CLOSURE = "com.zhidao.share.road.closure";
|
||||
//分享交通检查
|
||||
|
||||
@@ -495,6 +495,10 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
|
||||
.build(simpleCoverVideoPlayer);
|
||||
simpleCoverVideoPlayer.getStartButton().performClick();
|
||||
traceVideoPlayStatusData();
|
||||
} else if (cmd.equals(TanluConstants.THE_PREVIOUS)) { //上一条
|
||||
handlePrevious();
|
||||
} else if (cmd.equals(TanluConstants.THE_NEXT)) { //下一条
|
||||
handleNext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -584,35 +588,48 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R.id.tv_previous_res) { //上一个
|
||||
//判断是图片还是视频,第一个时,上一个不可点击
|
||||
Log.e(TAG, " tv_previous_res --1-> currentPosition = " + currentPosition + " >> size= " + markerExploreWayList.size());
|
||||
if (currentPosition < 0) {
|
||||
currentPosition = markerExploreWayList.size();
|
||||
}
|
||||
currentPosition--;
|
||||
Log.d(TAG, " tv_previous_res --2-> currentPosition = " + currentPosition + " >> size= " + markerExploreWayList.size());
|
||||
if (markerExploreWayList.size() > currentPosition && currentPosition >= 0) {
|
||||
handleMarkerExploreWay(markerExploreWayList.get(currentPosition));
|
||||
moveToMarcker(markerExploreWayList.get(currentPosition).getLocation().getLat(), markerExploreWayList.get(currentPosition).getLocation().getLon());
|
||||
}
|
||||
handlePrevious();
|
||||
} else if (id == R.id.tv_next_res) { //下一个
|
||||
//判断是图片还是视频,最后一个时,下一个不可点击
|
||||
Log.e(TAG, " tv_next_res --1-> currentPosition = " + currentPosition + " >> size= " + markerExploreWayList.size());
|
||||
if (currentPosition >= markerExploreWayList.size()) {
|
||||
currentPosition = 0;
|
||||
}
|
||||
currentPosition++;
|
||||
Log.d(TAG, " tv_next_res --2-> currentPosition = " + currentPosition + " >> size= " + markerExploreWayList.size());
|
||||
if (markerExploreWayList.size() > currentPosition) {
|
||||
handleMarkerExploreWay(markerExploreWayList.get(currentPosition));
|
||||
moveToMarcker(markerExploreWayList.get(currentPosition).getLocation().getLat(), markerExploreWayList.get(currentPosition).getLocation().getLon());
|
||||
}
|
||||
handleNext();
|
||||
|
||||
} else if (id == R.id.tv_main_empty) { //上报路况
|
||||
sendShareReceiver("1");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上一条逻辑
|
||||
*/
|
||||
private void handlePrevious() {
|
||||
//判断是图片还是视频,第一个时,上一个不可点击
|
||||
Log.e(TAG, " tv_previous_res --1-> currentPosition = " + currentPosition + " >> size= " + markerExploreWayList.size());
|
||||
if (currentPosition < 0) {
|
||||
currentPosition = markerExploreWayList.size();
|
||||
}
|
||||
currentPosition--;
|
||||
Log.d(TAG, " tv_previous_res --2-> currentPosition = " + currentPosition + " >> size= " + markerExploreWayList.size());
|
||||
if (markerExploreWayList.size() > currentPosition && currentPosition >= 0) {
|
||||
handleMarkerExploreWay(markerExploreWayList.get(currentPosition));
|
||||
moveToMarcker(markerExploreWayList.get(currentPosition).getLocation().getLat(), markerExploreWayList.get(currentPosition).getLocation().getLon());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下一条逻辑
|
||||
*/
|
||||
private void handleNext() {
|
||||
//判断是图片还是视频,最后一个时,下一个不可点击
|
||||
Log.d(TAG, " tv_next_res --1-> currentPosition = " + currentPosition + " >> size= " + markerExploreWayList.size());
|
||||
if (currentPosition >= markerExploreWayList.size()) {
|
||||
currentPosition = 0;
|
||||
}
|
||||
currentPosition++;
|
||||
Log.d(TAG, " tv_next_res --2-> currentPosition = " + currentPosition + " >> size= " + markerExploreWayList.size());
|
||||
if (markerExploreWayList.size() > currentPosition) {
|
||||
handleMarkerExploreWay(markerExploreWayList.get(currentPosition));
|
||||
moveToMarcker(markerExploreWayList.get(currentPosition).getLocation().getLat(), markerExploreWayList.get(currentPosition).getLocation().getLon());
|
||||
}
|
||||
}
|
||||
|
||||
private void moveToMarcker(double lat, double lon) {
|
||||
MogoLatLng latLng = new MogoLatLng(lat, lon);
|
||||
@@ -763,6 +780,10 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
|
||||
//免唤醒
|
||||
AIAssist.getInstance(getActivity()).registerUnWakeupCommand(TanluConstants.PLAY_VIDEO,
|
||||
TanluConstants.CMD_PLAY_ROAD_CONDITION, mogoVoiceListener);
|
||||
AIAssist.getInstance(getActivity()).registerUnWakeupCommand(TanluConstants.THE_PREVIOUS,
|
||||
TanluConstants.CMD_THE_PREVIOUS, mogoVoiceListener);
|
||||
AIAssist.getInstance(getActivity()).registerUnWakeupCommand(TanluConstants.THE_NEXT,
|
||||
TanluConstants.CMD_THE_NEXT, mogoVoiceListener);
|
||||
|
||||
isCurrentPage = true;
|
||||
Logger.d(TAG, "tanlu卡片 onPerform 有效 ---->");
|
||||
@@ -873,6 +894,8 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
|
||||
}
|
||||
|
||||
AIAssist.getInstance(getActivity()).unregisterUnWakeupCommand(TanluConstants.PLAY_VIDEO);
|
||||
AIAssist.getInstance(getActivity()).unregisterUnWakeupCommand(TanluConstants.THE_PREVIOUS);
|
||||
AIAssist.getInstance(getActivity()).unregisterUnWakeupCommand(TanluConstants.THE_NEXT);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user