Merge remote-tracking branch 'origin/feature/v1.0.0' into feature/v1.0.0

This commit is contained in:
zhangyuanzhen
2020-01-17 11:14:36 +08:00
168 changed files with 325 additions and 245 deletions

View File

@@ -49,7 +49,7 @@
android:layout_marginBottom="@dimen/module_apps_indicator_marginBottom"
app:lineWidth="@dimen/module_apps_indicator_width"
app:selectedColor="#ffffffff"
app:strokeWidth="@dimen/module_apps_indicator_heigt"
app:strokeWidth="@dimen/module_apps_indicator_height"
app:unselectedColor="#33ffffff" />
<ProgressBar

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_apps_pager_marginTop">117px</dimen>
<dimen name="module_apps_indicator_heigt">2.7px</dimen>
<dimen name="module_apps_indicator_height">2.7px</dimen>
<dimen name="module_apps_indicator_width">16px</dimen>
<dimen name="module_apps_indicator_marginBottom">54.9px</dimen>
<dimen name="module_apps_navigation_icon_width">64px</dimen>

View File

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_apps_pager_marginTop">260px</dimen>
<dimen name="module_apps_indicator_heigt">5px</dimen>
<dimen name="module_apps_indicator_height">5px</dimen>
<dimen name="module_apps_indicator_width">30px</dimen>
<dimen name="module_apps_indicator_marginBottom">103px</dimen>
<dimen name="module_apps_navigation_icon_width">120px</dimen>
<dimen name="module_apps_navigation_icon_height">120px</dimen>
<dimen name="module_apps_navigation_icon_marginLeft">61px</dimen>
<dimen name="module_apps_navigation_icon_marginLeft">60px</dimen>
<dimen name="module_apps_navigation_icon_paddingBottom">60px</dimen>
<dimen name="module_apps_app_name_marginTop">32px</dimen>
<dimen name="module_apps_app_name_textSize">32px</dimen>

View File

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_apps_pager_marginTop">260px</dimen>
<dimen name="module_apps_indicator_heigt">5px</dimen>
<dimen name="module_apps_indicator_height">5px</dimen>
<dimen name="module_apps_indicator_width">30px</dimen>
<dimen name="module_apps_indicator_marginBottom">103px</dimen>
<dimen name="module_apps_navigation_icon_width">120px</dimen>
<dimen name="module_apps_navigation_icon_height">120px</dimen>
<dimen name="module_apps_navigation_icon_marginLeft">61px</dimen>
<dimen name="module_apps_navigation_icon_marginLeft">60px</dimen>
<dimen name="module_apps_navigation_icon_paddingBottom">60px</dimen>
<dimen name="module_apps_app_name_marginTop">32px</dimen>
<dimen name="module_apps_app_name_textSize">32px</dimen>

View File

@@ -27,30 +27,36 @@ public interface ModuleType {
/**
* APP 列表模块
*/
@Deprecated
int TYPE_APP_LIST = 4;
/**
* 小智语音形象
*/
@Deprecated
int TYPE_VOICE = 5;
/**
* 地图模块
*/
@Deprecated
int TYPE_MAP = 6;
/**
* 导航模块
*/
@Deprecated
int TYPE_NAVI = 7;
/**
* 小智、天气、时间等
*/
@Deprecated
int TYPE_EXTENSION = 8;
/**
* 操作快捷入口
*/
@Deprecated
int TYPE_ENTRANCE = 9;
}

View File

@@ -3,7 +3,6 @@ package com.mogo.module.extensions.anim;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BlendMode;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;

View File

@@ -13,6 +13,7 @@ import androidx.fragment.app.Fragment;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.analytics.AnalyticsUtils;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.storage.SpStorage;
import com.mogo.map.MogoLatLng;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.location.IMogoLocationClient;
@@ -53,6 +54,8 @@ import java.util.HashMap;
*/
public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresenter > implements EntranceView,
IMogoNaviListener, IMogoMapListener {
private static final String TAG = "EntranceFragment";
private View mSearch;

View File

@@ -11,59 +11,59 @@ import java.util.Map;
* @author Lzq
*/
public enum Phenomena {
Sunny( "00", "", "Sunny", R.drawable.ic_sunny ),
Cloudy( "01", "多云", "Cloudy", R.drawable.ic_cloudy ),
Overcast( "02", "", "Overcast", R.drawable.ic_overcast ),
Sunny( "00", "", "Sunny", R.drawable.module_ext_ic_sunny ),
Cloudy( "01", "多云", "Cloudy", R.drawable.module_ext_ic_cloudy ),
Overcast( "02", "", "Overcast", R.drawable.module_ext_ic_overcast ),
Shower( "03", "阵雨", "Shower", R.drawable.ic_shower ),
Thundershower( "04", "雷阵雨", "Thundershower", R.drawable.ic_thundershower ),
ThundershowerWithHail( "05", "雷阵雨伴有冰雹", "Thundershower with hail", R.drawable.ic_thundershower ),
Sleet( "06", "雨夹雪", "Sleet", R.drawable.ic_snow ),
LightRain( "07", "小雨", "Light rain", R.drawable.ic_light_rain ),
ModerateRain( "08", "中雨", "Moderate rain", R.drawable.ic_light_rain ),
HeavyRain( "09", "大雨", "Heavy rain", R.drawable.ic_heavy_rain ),
Storm( "10", "暴雨", "Storm", R.drawable.ic_heavy_rain ),
HeavyStorm( "11", "大暴雨", "Heavy storm", R.drawable.ic_heavy_rain ),
SevereStorm( "12", "特大暴雨", "Severe storm", R.drawable.ic_severe_storm ),
Shower( "03", "阵雨", "Shower", R.drawable.module_ext_ic_shower ),
Thundershower( "04", "雷阵雨", "Thundershower", R.drawable.module_ext_ic_thundershower ),
ThundershowerWithHail( "05", "雷阵雨伴有冰雹", "Thundershower with hail", R.drawable.module_ext_ic_thundershower ),
Sleet( "06", "雨夹雪", "Sleet", R.drawable.module_ext_ic_snow ),
LightRain( "07", "小雨", "Light rain", R.drawable.module_ext_ic_light_rain ),
ModerateRain( "08", "中雨", "Moderate rain", R.drawable.module_ext_ic_light_rain ),
HeavyRain( "09", "大雨", "Heavy rain", R.drawable.module_ext_ic_heavy_rain ),
Storm( "10", "暴雨", "Storm", R.drawable.module_ext_ic_heavy_rain ),
HeavyStorm( "11", "大暴雨", "Heavy storm", R.drawable.module_ext_ic_heavy_rain ),
SevereStorm( "12", "特大暴雨", "Severe storm", R.drawable.module_ext_ic_severe_storm ),
SnowFlurry( "13", "阵雪", "Snow flurry", R.drawable.ic_snow ),
LightSnow( "14", "小雪", "Light snow", R.drawable.ic_snow ),
ModerateSnow( "15", "中雪", "Moderate snow", R.drawable.ic_snow ),
HeavySnow( "16", "大雪", "Heavy snow", R.drawable.ic_snow ),
Snowstorm( "17", "暴雪", "Snowstorm", R.drawable.ic_snow ),
SnowFlurry( "13", "阵雪", "Snow flurry", R.drawable.module_ext_ic_snow ),
LightSnow( "14", "小雪", "Light snow", R.drawable.module_ext_ic_snow ),
ModerateSnow( "15", "中雪", "Moderate snow", R.drawable.module_ext_ic_snow ),
HeavySnow( "16", "大雪", "Heavy snow", R.drawable.module_ext_ic_snow ),
Snowstorm( "17", "暴雪", "Snowstorm", R.drawable.module_ext_ic_snow ),
Foggy( "18", "", "Foggy", R.drawable.ic_fog ),
IceRain( "19", "冻雨", "Ice rain", R.drawable.ic_heavy_rain ),
Duststorm( "20", "沙尘暴", "Duststorm", R.drawable.ic_duststorm ),
Foggy( "18", "", "Foggy", R.drawable.module_ext_ic_fog ),
IceRain( "19", "冻雨", "Ice rain", R.drawable.module_ext_ic_heavy_rain ),
Duststorm( "20", "沙尘暴", "Duststorm", R.drawable.module_ext_ic_duststorm ),
LightToModerateRain( "21", "小到中雨", "Light to moderate rain", R.drawable.ic_moderate_rain ),
ModerateToHeavyRain( "22", "中到大雨", "Moderate to heavy rain", R.drawable.ic_heavy_rain ),
HeavyRainToStorm( "23", "大到大雨", "Heavy rain to storm", R.drawable.ic_heavy_rain ),
StormToHeavyStorm( "24", "暴雨到大暴雨", "Storm to heavy storm", R.drawable.ic_severe_storm ),
HeavyToSevereStorm( "25", "大暴雨到特大暴雨", "Heavy to severe storm", R.drawable.ic_severe_storm ),
LightToModerateRain( "21", "小到中雨", "Light to moderate rain", R.drawable.module_ext_ic_moderate_rain ),
ModerateToHeavyRain( "22", "中到大雨", "Moderate to heavy rain", R.drawable.module_ext_ic_heavy_rain ),
HeavyRainToStorm( "23", "大到大雨", "Heavy rain to storm", R.drawable.module_ext_ic_heavy_rain ),
StormToHeavyStorm( "24", "暴雨到大暴雨", "Storm to heavy storm", R.drawable.module_ext_ic_severe_storm ),
HeavyToSevereStorm( "25", "大暴雨到特大暴雨", "Heavy to severe storm", R.drawable.module_ext_ic_severe_storm ),
LightToModerateSnow( "26", "小到中雪", "Light to moderate snow", R.drawable.ic_snow ),
ModerateToHeavySnow( "27", "中到大雪", "Moderate to heavy snow", R.drawable.ic_snow ),
HeavySnowToSnowStorm( "28", "大到暴雪", "Heavy snow to snowstorm", R.drawable.ic_snow ),
LightToModerateSnow( "26", "小到中雪", "Light to moderate snow", R.drawable.module_ext_ic_snow ),
ModerateToHeavySnow( "27", "中到大雪", "Moderate to heavy snow", R.drawable.module_ext_ic_snow ),
HeavySnowToSnowStorm( "28", "大到暴雪", "Heavy snow to snowstorm", R.drawable.module_ext_ic_snow ),
Dust( "29", "浮尘", "Dust", R.drawable.ic_dust_sand ),
Sand( "30", "扬沙", "Sand", R.drawable.ic_dust_sand ),
SandStorm( "31", "强沙尘暴", "Sandstorm", R.drawable.ic_duststorm ),
Dust( "29", "浮尘", "Dust", R.drawable.module_ext_ic_dust_sand ),
Sand( "30", "扬沙", "Sand", R.drawable.module_ext_ic_dust_sand ),
SandStorm( "31", "强沙尘暴", "Sandstorm", R.drawable.module_ext_ic_duststorm ),
Densefog( "32", "浓雾", "Dense fog", R.drawable.ic_fog ),
StrongFog( "49", "强浓雾", "Strong fog", R.drawable.ic_fog ),
DenseFog( "57", "大雾", "Dense fog", R.drawable.ic_fog ),
ExtraHeavyFog( "58", "特强浓雾", "Extra heavy fog", R.drawable.ic_fog ),
Densefog( "32", "浓雾", "Dense fog", R.drawable.module_ext_ic_fog ),
StrongFog( "49", "强浓雾", "Strong fog", R.drawable.module_ext_ic_fog ),
DenseFog( "57", "大雾", "Dense fog", R.drawable.module_ext_ic_fog ),
ExtraHeavyFog( "58", "特强浓雾", "Extra heavy fog", R.drawable.module_ext_ic_fog ),
Haze( "53", "", "Haze", R.drawable.ic_haze ),
ModerateHaze( "54", "中度霾", "Moderate haze", R.drawable.ic_haze ),
Severehaze( "55", "重度霾", "Severe haze", R.drawable.ic_haze ),
SevereHaze( "56", "严重霾", "Severe haze", R.drawable.ic_haze ),
Haze( "53", "", "Haze", R.drawable.module_ext_ic_haze ),
ModerateHaze( "54", "中度霾", "Moderate haze", R.drawable.module_ext_ic_haze ),
Severehaze( "55", "重度霾", "Severe haze", R.drawable.module_ext_ic_haze ),
SevereHaze( "56", "严重霾", "Severe haze", R.drawable.module_ext_ic_haze ),
Unknown( "99", "", "Unknown", R.drawable.ic_unknown ),
Unknown( "99", "", "Unknown", R.drawable.module_ext_ic_unknown ),
Rain( "301", "", "rain", R.drawable.ic_heavy_rain ),
Snow( "302", "", "snow", R.drawable.ic_snow );
Rain( "301", "", "rain", R.drawable.module_ext_ic_heavy_rain ),
Snow( "302", "", "snow", R.drawable.module_ext_ic_snow );
public final String id;
public final String nameCn;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 834 B

After

Width:  |  Height:  |  Size: 467 B

View File

@@ -4,7 +4,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/module_ext_height"
android:background="@drawable/module_ext_dw_shadow_frame_bkg"
android:orientation="vertical"
android:paddingLeft="@dimen/module_ext_paddingLeft"
android:paddingRight="@dimen/module_ext_paddingRight">
@@ -59,7 +58,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/module_ext_weather_marginRight"
android:gravity="bottom"
android:gravity="center"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@+id/module_ext_id_date"

View File

@@ -3,7 +3,7 @@
<!-- module_ext_layout_entrance.xml-->
<dimen name="module_ext_search_height">58px</dimen>
<dimen name="module_ext_search_marginLeft">18px</dimen>
<dimen name="module_ext_search_marginTop">8px</dimen>
<dimen name="module_ext_search_marginTop">1px</dimen>
<dimen name="module_ext_search_drawablePadding">11.2px</dimen>
<dimen name="module_ext_search_paddingLeft">10.8px</dimen>
<dimen name="module_ext_search_paddingRight">17px</dimen>
@@ -11,7 +11,7 @@
<dimen name="module_ext_common_address_height">58px</dimen>
<dimen name="module_ext_common_address_marginLeft">19px</dimen>
<dimen name="module_ext_common_address_marginTop">8px</dimen>
<dimen name="module_ext_common_address_marginTop">1px</dimen>
<dimen name="module_ext_common_address_home_width">64.2px</dimen>
<dimen name="module_ext_common_address_home_height">58px</dimen>
<dimen name="module_ext_common_address_divider_width">1px</dimen>
@@ -22,13 +22,13 @@
<dimen name="module_ext_speed_limit_width">96px</dimen>
<dimen name="module_ext_speed_limit_height">96px</dimen>
<dimen name="module_ext_speed_limit_marginTop">8px</dimen>
<dimen name="module_ext_speed_limit_marginTop">1px</dimen>
<dimen name="module_ext_speed_limit_marginRight">32px</dimen>
<dimen name="module_ext_speed_limit_value_textSize">32px</dimen>
<dimen name="module_ext_speed_limit_unit_textSize">15px</dimen>
<dimen name="module_ext_navi_panel_marginLeft">20px</dimen>
<dimen name="module_ext_navi_panel_marginTop">8px</dimen>
<dimen name="module_ext_navi_panel_marginTop">1px</dimen>
<dimen name="module_ext_operation_panel_width">58px</dimen>
<dimen name="module_ext_operation_panel_marginRight">20px</dimen>
@@ -41,7 +41,7 @@
<dimen name="module_ext_operation_panel_share_width">58px</dimen>
<dimen name="module_ext_operation_panel_share_height">58px</dimen>
<dimen name="module_ext_operation_panel_share_marginBottom">21px</dimen>
<dimen name="module_ext_operation_panel_share_textSize">14px</dimen>
<dimen name="module_ext_operation_panel_share_textSize">20px</dimen>
<dimen name="module_ext_operation_panel_share_goneMarginBottom">34.5px</dimen>
<dimen name="module_ext_operation_panel_share_goneMarginRight">20px</dimen>
@@ -53,7 +53,7 @@
<dimen name="module_ext_navi_exit_textSize">22px</dimen>
<!-- module_ext_layout_extensions.xml-->
<dimen name="module_ext_height">640px</dimen>
<dimen name="module_ext_height">64px</dimen>
<dimen name="module_ext_paddingRight">32px</dimen>
<dimen name="module_ext_paddingLeft">32px</dimen>
<dimen name="module_ext_voice_icon_width">64px</dimen>

View File

@@ -10,6 +10,7 @@ import androidx.viewpager.widget.ViewPager;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.mvp.MvpActivity;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.location.IMogoLocationClient;
import com.mogo.map.location.IMogoLocationListener;
import com.mogo.map.location.MogoLocation;
@@ -18,7 +19,6 @@ 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.extensions.ExtensionsModuleConst;
import com.mogo.module.main.cards.CardModulesAdapter;
import com.mogo.module.main.cards.MogoModulesHandler;
import com.mogo.module.main.cards.MogoModulesManager;
@@ -31,7 +31,6 @@ import com.mogo.service.MogoServicePaths;
import com.mogo.service.analytics.IMogoAnalytics;
import com.mogo.service.cardmanager.IMogoCardManager;
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
import com.mogo.service.impl.fragmentmanager.FragmentStack;
import com.mogo.service.map.IMogoMapService;
import com.mogo.service.module.IMogoModuleProvider;
import com.mogo.utils.logger.Logger;
@@ -66,7 +65,8 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
private View mApps;
private View mEntrance;
private FrameLayout mFloatingLayout;
private View mShadowFrame;
private View mLeftShadowFrame;
private View mTopShadowFrame;
/**
* 主模块管控定位,可以向各个模块发送统一定位信息
@@ -104,7 +104,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
mCurrentPosition = position;
provider = mCardModulesAdapter.getProvider( mCurrentPosition );
mMogoModuleHandler.setEnable( provider.getModuleName() );
mMogoModuleHandler.setModuleEnable( provider.getModuleName() );
if ( !isClickMarker ) {
mMogoCardManager.invoke( position, mMogoModuleHandler.getCurrentModuleName() );
}
@@ -163,9 +163,9 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
mMogoFragmentManager.init( this, R.id.module_main_id_search_fragment );
mMogoFragmentManager.registerMainFragmentStackTransactionListener( ( size ) -> {
if ( size == 0 ) {
show();
showLayout();
} else if ( size == 1 ) {
hide();
hideLayout();
}
} );
mHeader = findViewById( R.id.module_main_id_header_fragment_container );
@@ -173,38 +173,37 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
mApps = findViewById( R.id.module_main_id_apps_fragment_container );
mEntrance = findViewById( R.id.module_main_id_entrance_fragment_container );
mFloatingLayout = findViewById( R.id.module_main_id_floating_view );
mShadowFrame = findViewById( R.id.module_main_id_map_shadow_frame );
mLeftShadowFrame = findViewById( R.id.module_main_id_map_left_shadow_frame );
mTopShadowFrame = findViewById( R.id.module_main_id_map_top_shadow_frame );
WindowViewHandler.init( mFloatingLayout );
}
private void hide() {
// 隐藏布局
private void hideLayout() {
mHeader.setVisibility( View.GONE );
mCards.setVisibility( View.GONE );
mApps.setVisibility( View.GONE );
mEntrance.setVisibility( View.GONE );
mFloatingLayout.setVisibility( View.GONE );
mShadowFrame.setVisibility( View.GONE );
mLeftShadowFrame.setVisibility( View.GONE );
}
private void show() {
// 显示布局
private void showLayout() {
mHeader.setVisibility( View.VISIBLE );
mCards.setVisibility( View.VISIBLE );
mApps.setVisibility( View.VISIBLE );
mEntrance.setVisibility( View.VISIBLE );
mFloatingLayout.setVisibility( View.VISIBLE );
mShadowFrame.setVisibility( View.VISIBLE );
mLeftShadowFrame.setVisibility( View.VISIBLE );
}
@Override
protected void onCreate( @Nullable Bundle savedInstanceState ) {
super.onCreate( savedInstanceState );
MogoModulePaths.addModule( new MogoModule( MogoModulePaths.PATH_MODULE_APPS, MogoModulePaths.PATH_MODULE_APPS ) );
MogoModulePaths.addModule( new MogoModule( MogoModulePaths.PATH_MODULE_MAP, MogoModulePaths.PATH_MODULE_MAP ) );
MogoModulePaths.addModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) );
MogoModulePaths.addModule( new MogoModule( ExtensionsModuleConst.PATH_EXTENSION, ExtensionsModuleConst.TYPE ) );
MogoModulePaths.addModule( new MogoModule( ExtensionsModuleConst.PATH_ENTRANCE, ExtensionsModuleConst.TYPE_ENTRANCE ) );
mMogoModuleHandler = new MogoModulesManager( this );
mMogoMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation();
@@ -214,30 +213,43 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
mMogoMapService.getHostListenerRegister().registerMarkerClickListener( this );
}
mMogoMapUIController = mMogoMapService.getMapUIController();
mMogoModuleHandler.loadModules();
mMogoModuleHandler.onMapLoadedCallback( () -> {
mMogoModuleHandler.setMapLoadedCallback( () -> {
Logger.d( TAG, "map loaded." + Thread.currentThread().getName() );
loadModules();
mShadowFrame.setVisibility( View.VISIBLE );
mMogoMapUIController.setPointToCenter( 0.66145, 0.590688 );
} );
// 加载地图,触发地图加载完毕回调,在初始化其他卡片模块,保证卡片模块可以正确获取地图相关服务。
mMogoModuleHandler.loadMap( R.id.module_main_id_map_fragment_container );
mMogoModuleHandler.loadAppsList( R.id.module_main_id_apps_fragment_container );
mMogoModuleHandler.loadExtensions( R.id.module_main_id_header_fragment_container );
mMogoModuleHandler.loadEntrances( R.id.module_main_id_entrance_fragment_container );
// 加载地图,触发地图加载完毕回调,在初始化其他卡片模块,保证卡片模块可以正确获取地图相关服务。
mMogoModuleHandler.loadModules();
loadContainerModules();
loadCardModules();
mLocationClient = mMogoMapService.getSingletonLocationClient( getApplicationContext() );
mLocationClient.addLocationListener( this );
mLocationClient.start();
// 显示左边遮罩
mLeftShadowFrame.setVisibility( View.VISIBLE );
mTopShadowFrame.setVisibility( View.VISIBLE );
// 右移地图中心点
mMogoMapUIController = mMogoMapService.getMapUIController();
mMogoMapUIController.setPointToCenter( 0.66145, 0.590688 );
// 开启定位
startLocation();
} );
mMogoModuleHandler.loadMapModule( R.id.module_main_id_map_fragment_container );
mMogoCardManager = ( IMogoCardManager ) ARouter.getInstance().build( MogoServicePaths.PATH_CARD_MANAGER ).navigation( this );
mAnalytics = ( IMogoAnalytics ) ARouter.getInstance().build( MogoServicePaths.PATH_UTILS_ANALYTICS ).navigation( this );
}
private void loadModules() {
private void startLocation() {
mLocationClient = mMogoMapService.getSingletonLocationClient( getApplicationContext() );
mLocationClient.addLocationListener( this );
mLocationClient.start();
}
private void loadContainerModules() {
mMogoModuleHandler.loadAppsListModule( R.id.module_main_id_apps_fragment_container );
mMogoModuleHandler.loadExtensionsModule( R.id.module_main_id_header_fragment_container );
mMogoModuleHandler.loadEntrancesModule( R.id.module_main_id_entrance_fragment_container );
}
private void loadCardModules() {
List< IMogoModuleProvider > providers = mMogoModuleHandler.loadCardsModule();
mCardModulesAdapter = new CardModulesAdapter( this, providers );
@@ -268,7 +280,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
isClickMarker = true;
switch2( marker.getOwner() );
if ( mMogoModuleHandler != null ) {
mMogoModuleHandler.onMarkerReceive( marker );
mMogoModuleHandler.onMarkerClicked( marker );
}
isClickMarker = false;
return false;
@@ -291,10 +303,12 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
@Override
public void onBackPressed() {
if ( FragmentStack.getInstance().isEmpty() ) {
if ( mMogoFragmentManager.getStackSize() == 0 ) {
return;
}
FragmentStack.getInstance().pop();
if ( mMogoFragmentManager != null ) {
mMogoFragmentManager.pop();
}
}
@Override
@@ -305,10 +319,15 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
mLocationClient.destroy();
}
mLocationClient = null;
mMogoMapService = null;
if ( mMogoModuleHandler != null ) {
mMogoModuleHandler.destroy();
mMogoModuleHandler = null;
}
mMogoModuleHandler = null;
mMogoMapService = null;
mMogoMapUIController = null;
mMogoCardManager = null;
mMogoFragmentManager = null;
AIAssist.getInstance( this ).release();
}
}

View File

@@ -21,10 +21,19 @@ import javax.security.auth.callback.Callback;
*/
public interface MogoModulesHandler extends IMogoMapListener,
IMogoNaviListener,
IMogoLocationListener {
IMogoLocationListener,
IMogoMarkerClickListener {
void onMapLoadedCallback( Runnable callback );
/**
* 地图加载完成回调
*
* @param callback
*/
void setMapLoadedCallback( Runnable callback );
/**
* 加载模块
*/
void loadModules();
/**
@@ -39,49 +48,41 @@ public interface MogoModulesHandler extends IMogoMapListener,
*
* @param containerId 容器id
*/
void loadMap( int containerId );
void loadMapModule( int containerId );
/**
* 加载所有应用
*
* @param containerId 容器id
*/
void loadAppsList( int containerId );
void loadAppsListModule( int containerId );
/**
* 加载头部信息
*
* @param containerId
*/
void loadExtensions( int containerId );
void loadExtensionsModule( int containerId );
/**
* 加载快捷操作
*
* @param containerId
*/
void loadEntrances( int containerId );
void loadEntrancesModule( int containerId );
/**
* 设置某一个module可用
*
* @param module
*/
void setEnable( String module );
void setModuleEnable( String module );
/**
* 销毁
*/
void destroy();
/**
* 卡片接收到Marker传入数据
*
* @param marker marker
*/
void onMarkerReceive( IMogoMarker marker );
/**
* 当前卡片名称
*

View File

@@ -5,6 +5,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.text.TextUtils;
import android.util.Log;
import android.view.MotionEvent;
import androidx.fragment.app.Fragment;
@@ -23,6 +24,7 @@ import com.mogo.map.navi.MogoTraffic;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
import com.mogo.module.extensions.ExtensionsModuleConst;
import com.mogo.module.main.MainActivity;
import com.mogo.module.main.registercenter.MogoRegisterCenterHandler;
import com.mogo.service.module.IMogoModuleLifecycle;
@@ -36,7 +38,6 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* @author congtaowang
@@ -90,7 +91,7 @@ public class MogoModulesManager implements MogoModulesHandler,
}
@Override
public void onMapLoadedCallback( Runnable callback ) {
public void setMapLoadedCallback( Runnable callback ) {
mMapLoadedCallback = callback;
}
@@ -111,35 +112,27 @@ public class MogoModulesManager implements MogoModulesHandler,
}
@Override
public void loadMap( int containerId ) {
loadModuleByType( ModuleType.TYPE_MAP, containerId );
public void loadMapModule( int containerId ) {
IMogoModuleProvider provider = ( IMogoModuleProvider ) ARouter.getInstance().build( MogoModulePaths.PATH_MODULE_MAP ).navigation( getContext() );
addFragment( provider, containerId );
}
@Override
public void loadAppsList( int containerId ) {
loadModuleByType( ModuleType.TYPE_APP_LIST, containerId );
public void loadAppsListModule( int containerId ) {
IMogoModuleProvider provider = ( IMogoModuleProvider ) ARouter.getInstance().build( MogoModulePaths.PATH_MODULE_APPS ).navigation( getContext() );
addFragment( provider, containerId );
}
@Override
public void loadExtensions( int containerId ) {
loadModuleByType( ModuleType.TYPE_EXTENSION, containerId );
public void loadExtensionsModule( int containerId ) {
IMogoModuleProvider provider = ( IMogoModuleProvider ) ARouter.getInstance().build( ExtensionsModuleConst.PATH_EXTENSION ).navigation( getContext() );
addFragment( provider, containerId );
}
@Override
public void loadEntrances( int containerId ) {
loadModuleByType( ModuleType.TYPE_ENTRANCE, containerId );
}
private void loadModuleByType( int type, int containerId ) {
if ( mModuleProviders.isEmpty() ) {
return;
}
for ( IMogoModuleProvider value : mModuleProviders.values() ) {
if ( value.getType() == type ) {
addFragment( value, containerId );
return;
}
}
public void loadEntrancesModule( int containerId ) {
IMogoModuleProvider provider = ( IMogoModuleProvider ) ARouter.getInstance().build( ExtensionsModuleConst.PATH_ENTRANCE ).navigation( getContext() );
addFragment( provider, containerId );
}
private IMogoModuleProvider load( String path ) {
@@ -162,8 +155,9 @@ public class MogoModulesManager implements MogoModulesHandler,
}
@Override
public void setEnable( String module ) {
public void setModuleEnable( String module ) {
// 仅操作上一个模块和当前模块
Iterator< IMogoModuleProvider > iterator = mModuleProviders.values().iterator();
int counter = 0;
while ( iterator.hasNext() ) {
@@ -178,7 +172,9 @@ public class MogoModulesManager implements MogoModulesHandler,
final IMogoModuleLifecycle lifecycle = MogoRegisterCenterHandler.getInstance().getLifecycleListener( mEnableModuleName );
if ( lifecycle != null ) {
try {
final long start = System.currentTimeMillis();
lifecycle.onDisable();
Logger.i(TAG, "set %s module disable event cost " + (System.currentTimeMillis() - start) + "ms", mEnableModuleName);
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
@@ -190,7 +186,9 @@ public class MogoModulesManager implements MogoModulesHandler,
final IMogoModuleLifecycle lifecycle = MogoRegisterCenterHandler.getInstance().getLifecycleListener( module );
if ( lifecycle != null ) {
try {
final long start = System.currentTimeMillis();
lifecycle.onPerform();
Logger.i(TAG, "set %s module perform event cost " + (System.currentTimeMillis() - start) + "ms", module);
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
@@ -212,20 +210,6 @@ public class MogoModulesManager implements MogoModulesHandler,
mMapLoadedCallback.run();
mMapLoadedCallback = null;
}
Iterator< IMogoMapListener > iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
IMogoMapListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onMapLoaded();
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
@@ -426,7 +410,6 @@ public class MogoModulesManager implements MogoModulesHandler,
}
}
@Override
public void onCalculateSuccess() {
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
@@ -473,7 +456,7 @@ public class MogoModulesManager implements MogoModulesHandler,
IMogoNaviListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onUpdateTraffic(traffic);
listener.onUpdateTraffic( traffic );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
@@ -541,15 +524,16 @@ public class MogoModulesManager implements MogoModulesHandler,
}
@Override
public void onMarkerReceive( IMogoMarker marker ) {
public boolean onMarkerClicked( IMogoMarker marker ) {
IMogoMarkerClickListener listener = MogoRegisterCenterHandler.getInstance().getMarkerListener( marker.getOwner() );
if ( listener != null ) {
try {
listener.onMarkerClicked( marker );
return listener.onMarkerClicked( marker );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
return false;
}
@Override

View File

@@ -4,16 +4,19 @@ import android.content.Context;
import android.util.Log;
import android.view.View;
import com.mogo.module.main.R;
import com.mogo.utils.WindowUtils;
public class VerticalStackTransformer extends VerticalBaseTransformer {
private Context context;
private int spaceBetweenFirAndSecWith = 5 * 2;//第一张卡片和第二张卡片宽度差 dp单位
private int spaceBetweenFirAndSecHeight = 5;//第一张卡片和第二张卡片高度差 dp单位
private int spaceBetweenFirAndSecWith;//第一张卡片和第二张卡片宽度差
private int spaceBetweenFirAndSecHeight;//第一张卡片和第二张卡片高度差
public VerticalStackTransformer( Context context ) {
this.context = context;
spaceBetweenFirAndSecHeight = context.getResources().getDimensionPixelSize( R.dimen.module_main_card_card_shadow_height_div );
spaceBetweenFirAndSecWith = context.getResources().getDimensionPixelSize( R.dimen.module_main_card_card_shadow_width_div );
}
public VerticalStackTransformer( Context context, int spaceBetweenFirAndSecWith, int spaceBetweenFirAndSecHeight ) {
@@ -30,7 +33,7 @@ public class VerticalStackTransformer extends VerticalBaseTransformer {
//控制停止滑动切换的时候,只有最上面的一张卡片可以点击
page.setClickable( true );
} else {
float scale = ( float ) ( page.getWidth() - WindowUtils.dip2px( context, spaceBetweenFirAndSecWith * position ) ) / ( float ) ( page.getWidth() );
float scale = ( float ) ( page.getWidth() - spaceBetweenFirAndSecWith * position ) / ( float ) ( page.getWidth() );
//控制下面卡片的可见度
page.setAlpha( 1.0f );
//控制停止滑动切换的时候,只有最上面的一张卡片可以点击
@@ -39,7 +42,7 @@ public class VerticalStackTransformer extends VerticalBaseTransformer {
page.setPivotY( page.getHeight() / 2f );
page.setScaleX( scale );
page.setScaleY( scale );
page.setTranslationY( -page.getHeight() * position + ( page.getHeight() * 0.5f ) * ( 1 - scale ) + WindowUtils.dip2px( context, spaceBetweenFirAndSecHeight ) * position );
page.setTranslationY( -page.getHeight() * position + ( page.getHeight() * 0.5f ) * ( 1 - scale ) + spaceBetweenFirAndSecHeight * position );
}
}
}

View File

@@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient android:angle="180" android:endColor="#232536" android:startColor="#001D1D1D" />
<gradient android:angle="180" android:endColor="#232536" android:centerColor="#aa1D1D1D" android:startColor="#001D1D1D" />
</shape>
</item>
</selector>

View File

@@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient android:angle="270" android:centerColor="#7f000000" android:endColor="#1F000000" android:startColor="#CC000000" />
<gradient android:angle="270" android:endColor="#00222222" android:startColor="#99000000" />
</shape>
</item>
</selector>

View File

@@ -14,7 +14,14 @@
app:layout_constraintRight_toRightOf="parent" />
<FrameLayout
android:id="@+id/module_main_id_map_shadow_frame"
android:id="@+id/module_main_id_map_top_shadow_frame"
android:layout_width="match_parent"
android:layout_height="@dimen/module_main_top_shadow_height"
android:background="@drawable/module_main_dw_top_frame_bkg"
android:visibility="invisible" />
<FrameLayout
android:id="@+id/module_main_id_map_left_shadow_frame"
android:layout_width="@dimen/module_main_map_shadow_frame_width"
android:layout_height="match_parent"
android:background="@drawable/module_main_dw_left_frame_bkg"
@@ -35,8 +42,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/module_main_card_container_marginTop">
android:layout_marginTop="@dimen/module_main_card_container_marginTop"
android:layout_height="match_parent">
<!-- 卡片-->
<FrameLayout
android:layout_width="@dimen/module_main_card_container_width"
@@ -46,7 +53,7 @@
<com.mogo.module.main.cards.OrientedViewPager
android:id="@+id/module_main_id_cards_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="@dimen/module_main_card_container_height"
android:layout_marginBottom="@dimen/module_main_card_container_marginBottom"
android:clipToPadding="false"
android:overScrollMode="never"

View File

@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_main_activity_main.xml-->
<dimen name="module_main_map_shadow_frame_width">720px</dimen>
<dimen name="module_main_card_container_marginTop">10px</dimen>
<dimen name="module_main_card_container_width">660px</dimen>
<dimen name="module_main_card_container_marginLeft">60px</dimen>
<dimen name="module_main_card_container_marginBottom">211px</dimen>
<dimen name="module_main_card_container_paddingBottom">20px</dimen>
<dimen name="module_main_map_shadow_frame_width">384px</dimen>
<dimen name="module_main_card_container_marginTop">8px</dimen>
<dimen name="module_main_card_container_width">352px</dimen>
<dimen name="module_main_card_container_height">370px</dimen>
<dimen name="module_main_card_container_marginLeft">32px</dimen>
<dimen name="module_main_card_container_marginBottom">140.5px</dimen>
<dimen name="module_main_card_container_paddingBottom">18px</dimen>
<dimen name="module_main_card_card_shadow_width_div">20px</dimen>
<dimen name="module_main_card_card_shadow_height_div">10px</dimen>
<dimen name="module_main_top_shadow_height">144px</dimen>
</resources>

View File

@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_main_activity_main.xml-->
<!-- module_main_activity_main.xml-->
<dimen name="module_main_map_shadow_frame_width">720px</dimen>
<dimen name="module_main_card_container_marginTop">10px</dimen>
<dimen name="module_main_card_container_width">660px</dimen>
<dimen name="module_main_card_container_height">690px</dimen>
<dimen name="module_main_card_container_marginLeft">60px</dimen>
<dimen name="module_main_card_container_marginBottom">211px</dimen>
<dimen name="module_main_card_container_paddingBottom">20px</dimen>
<dimen name="module_main_card_container_paddingBottom">30px</dimen>
<dimen name="module_main_card_card_shadow_width_div">30px</dimen>
<dimen name="module_main_card_card_shadow_height_div">15px</dimen>
<dimen name="module_main_top_shadow_height">270px</dimen>
</resources>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="module_main_window_background_color">#1D1D1D</color>
</resources>

View File

@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_main_activity_main.xml-->
<dimen name="module_main_map_shadow_frame_width">384px</dimen>
<dimen name="module_main_card_container_marginTop">8px</dimen>
<dimen name="module_main_card_container_width">352px</dimen>
<dimen name="module_main_card_container_marginLeft">32px</dimen>
<dimen name="module_main_card_container_marginBottom">140.5px</dimen>
<dimen name="module_main_card_container_paddingBottom">20px</dimen>
<dimen name="module_main_map_shadow_frame_width">720px</dimen>
<dimen name="module_main_card_container_marginTop">10px</dimen>
<dimen name="module_main_card_container_width">660px</dimen>
<dimen name="module_main_card_container_height">690px</dimen>
<dimen name="module_main_card_container_marginLeft">60px</dimen>
<dimen name="module_main_card_container_marginBottom">211px</dimen>
<dimen name="module_main_card_container_paddingBottom">30px</dimen>
<dimen name="module_main_card_card_shadow_width_div">30px</dimen>
<dimen name="module_main_card_card_shadow_height_div">15px</dimen>
<dimen name="module_main_top_shadow_height">270px</dimen>
</resources>

View File

@@ -7,7 +7,7 @@
<item name="android:windowEnterAnimation">@null</item>
<item name="android:windowExitAnimation">@null</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowBackground">#1F000000</item>
<item name="android:windowBackground">@color/module_main_window_background_color</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:windowAnimationStyle">@style/MainAnimation</item>
</style>

View File

@@ -77,3 +77,5 @@ dependencies {
}
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

View File

@@ -1,3 +1,3 @@
GROUP=com.mogo.module
POM_ARTIFACT_ID=module-navi
POM_ARTIFACT_ID=module-search
VERSION_CODE=1

View File

@@ -1,18 +1,13 @@
package com.mogo.module.navi.constants
import android.annotation.SuppressLint
import android.app.StatusBarManager
import android.content.Context
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.facade.template.IProvider
import com.alibaba.android.arouter.launcher.ARouter
import com.amap.api.services.interfaces.IGeocodeSearch
import com.mogo.map.marker.IMogoMarkerManager
import com.mogo.map.navi.IMogoNavi
import com.mogo.map.search.geo.IMogoGeoSearch
import com.mogo.map.uicontroller.IMogoMapUIController
import com.mogo.module.navi.manager.MogoSettingManager
import com.mogo.service.MogoServicePaths
import com.mogo.service.analytics.IMogoAnalytics
import com.mogo.service.fragmentmanager.FragmentDescriptor
@@ -20,7 +15,6 @@ import com.mogo.service.fragmentmanager.IMogoFragmentManager
import com.mogo.service.map.IMogoMapService
import com.mogo.service.module.IMogoRegisterCenter
import com.mogo.service.statusmanager.IMogoStatusManager
import kotlin.isInitialized as isInitialized1
/**
*@author zyz

View File

@@ -466,7 +466,7 @@ public class MogoServiceProvider implements IMogoModuleProvider,
}
Logger.d( TAG, mAutoRefreshCallback == callback ? "触发自动刷新" : "触发手动刷新" );
Logger.i( TAG, "刷新半径 = %d, 点 = %s", radius, latLng );
mRefreshModel.refreshData( latLng, radius, callback );
mRefreshModel.refreshData( latLng, radius, mLastZoomLevel >= 10 ? 5 : 10, callback );
}
@Override

View File

@@ -52,7 +52,7 @@ public class RefreshModel {
}
}
public void refreshData(MogoLatLng latLng, int radius, final RefreshCallback callback) {
public void refreshData(MogoLatLng latLng, int radius, int limit, final RefreshCallback callback) {
if (mRefreshApiService != null) {
final Map<String, Object> query = new ParamsProvider.Builder(mContext).build();
final RefreshBody refreshBody = new RefreshBody();

View File

@@ -203,20 +203,16 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
//地图marker
mMogoMapService = (IMogoMapService) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_MAP).navigation(getActivity());
mMarkerManager = mMogoMapService.getMarkerManager(getContext());
//切换卡片操作
iMogoCardManager = (IMogoCardManager) ARouter.getInstance().build(MogoServicePaths.PATH_CARD_MANAGER).navigation(getActivity());
mMogoRegisterCenter = (IMogoRegisterCenter) ARouter.getInstance().build(MogoServicePaths.PATH_REGISTER_CENTER).navigation(getContext());
mMogoRegisterCenter.registerMogoModuleLifecycle(TanluConstants.MODEL_NAME, this);
//唤醒
mogoIntentManager = (IMogoIntentManager) ARouter.getInstance().build(MogoServicePaths.PATH_INTENT_MANAGER).navigation(getContext());
//地图操作
mMogoMapService = (IMogoMapService) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_MAP).navigation(getContext());
mMApUIController = mMogoMapService.getMapUIController();
mGeocodeSearch = new GeocodeSearch(getContext());
mMogoStatusManager = (IMogoStatusManager) ARouter.getInstance().build(MogoServicePaths.PATH_STATUS_MANAGER).navigation(getContext());
//poi查询
@@ -314,7 +310,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
}
/**
* 初始化导航 TODO
* 初始化导航
*/
private void initMap() {
mMogoRegisterCenter.registerMogoNaviListener(TanluConstants.MODEL_NAME, new IMogoNaviListener() {
@@ -328,7 +324,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
@Override
public void onNaviInfoUpdate(MogoNaviInfo naviinfo) {
}
@Override
@@ -339,22 +334,18 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
@Override
public void onStopNavi() {
}
@Override
public void onCalculateSuccess() {
}
@Override
public void onoCalculateFailed() {
}
@Override
public void onUpdateTraffic( MogoTraffic traffic ) {
public void onUpdateTraffic(MogoTraffic traffic) {
}
});
@@ -417,7 +408,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
//唤醒
mogoIntentManager.registerIntentListener(TanluConstants.UPLOAD_ROAD_CONDITION, mogoIntentListener);
mogoIntentManager.registerIntentListener(TanluConstants.SPECIFIEDROAD_SEARCH, mogoIntentListener);
mogoIntentManager.registerIntentListener(TanluConstants.PLAY_VIDEO, mogoIntentListener);
mogoIntentManager.registerIntentListener(TanluConstants.SHARE_ROAD_CLOSURE, mogoIntentListener);
mogoIntentManager.registerIntentListener(TanluConstants.SHARE_TRAFFIC_CHECK, mogoIntentListener);
mogoIntentManager.registerIntentListener(TanluConstants.GO_TO_SHARE, mogoIntentListener);
@@ -432,7 +422,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
public void onIntentReceived(String intentStr, Intent intent) {
String data = intent.getStringExtra("data");
Logger.e(TAG, "唤醒 mogoIntentListener intentStr =" + intentStr + ">>data =" + data);
if (intentStr.equals(TanluConstants.SPECIFIEDROAD_SEARCH)) { //地点堵不堵 ok
if (intentStr.equals(TanluConstants.SPECIFIEDROAD_SEARCH)) { //地点堵不堵 --ok
try {
JSONObject jsonObject = new JSONObject(data);
mKeywords = jsonObject.get("location").toString();
@@ -441,20 +431,17 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
} catch (Exception e) {
e.printStackTrace();
}
} else if (intentStr.equals(TanluConstants.UPLOAD_ROAD_CONDITION)) { //上报路况 免唤醒 ok
} else if (intentStr.equals(TanluConstants.UPLOAD_ROAD_CONDITION)) { //上报路况 免唤醒 --ok
sendShareReceiver("1");
Logger.d(TAG, "mogoIntentListener 上报路况 ----> ");
} else if (intentStr.equals(TanluConstants.PLAY_VIDEO)) { //播放视频 免唤醒
Logger.d(TAG, "mogoIntentListener 播放视频 ----> ");
//TODO
} else if (intentStr.equals(TanluConstants.SHARE_ROAD_CLOSURE)) { //分享封路
} else if (intentStr.equals(TanluConstants.SHARE_ROAD_CLOSURE)) { //分享封路 --ok
sendShareReceiver("3");
Logger.d(TAG, "mogoIntentListener 分享封路 ----> ");
} else if (intentStr.equals(TanluConstants.SHARE_TRAFFIC_CHECK)) { //分享交通检查
} else if (intentStr.equals(TanluConstants.SHARE_TRAFFIC_CHECK)) { //分享交通检查 --ok
sendShareReceiver("2");
Logger.d(TAG, "mogoIntentListener 分享交通检查 ----> ");
} else if (intentStr.equals(TanluConstants.GO_TO_SHARE)) { //我要分享
} else if (intentStr.equals(TanluConstants.GO_TO_SHARE)) { //我要分享 --ok
ShareControl shareControl = new ShareControl();
shareControl.showDialog(getActivity());
Logger.d(TAG, "mogoIntentListener 我要分享 ----> ");
@@ -469,8 +456,8 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
private IMogoVoiceCmdCallBack mogoVoiceListener = new IMogoVoiceCmdCallBack() {
@Override
public void onCmdSelected(String cmd) {
Logger.e(TAG, "免唤醒 onCmdSelected mogoVoiceListener cmd =" + cmd);
if (cmd.equals(TanluConstants.PLAY_VIDEO)) {
Logger.d(TAG, "免唤醒 onCmdSelected mogoVoiceListener cmd =" + cmd);
if (cmd.equals(TanluConstants.PLAY_VIDEO)) { //播放路况 --ok
//TODO
}
@@ -478,22 +465,18 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
@Override
public void onCmdAction(String speakText) {
Logger.d(TAG, "免唤醒 onCmdAction speakText =" + speakText);
}
@Override
public void onCmdCancel(String speakText) {
Logger.d(TAG, "免唤醒 onCmdCancel speakText =" + speakText);
}
@Override
public void onSpeakEnd(String speakText) {
Logger.e(TAG, "免唤醒 onSpeakEnd speakText =" + speakText);
}
@Override
public void onSpeakSelectTimeOut(String speakText) {
Logger.e(TAG, "免唤醒 onSpeakSelectTimeOut speakText =" + speakText);
}
};
@@ -678,7 +661,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
}
/**
* C位事件,如何获取数据,需要有默认数据 TODO
* C位事件,如何获取数据,需要有默认数据
* 如果只有一个数据,不显示上下切换按钮,没有数据显示空页面
*/
@Override
@@ -802,7 +785,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
getViewLifecycleOwner().getLifecycle().removeObserver(mPresenter);
TanluServiceHandler.getLocationClient().removeLocationListener(this);
mMogoRegisterCenter.unregisterMogoNaviListener(TanluConstants.MODEL_NAME);
mogoIntentManager.unregisterIntentListener(MogoReceiver.ACTIION_ADAS );
mogoIntentManager.unregisterIntentListener(MogoReceiver.ACTIION_ADAS);
}
/**
@@ -813,30 +796,36 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMarkerInfo(final MarkerInfo event) {
Logger.d(TAG, "onMarkerInfo ------------>");
if (event.type.equals("1")) { //上报路况
if (event == null) {
return;
}
String poiType = "";
if (event.type.equals("1")) { //上报路况 TODO 修改探路
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_block_up);
} else if (event.type.equals("2")) { //交通检查
} else if (event.type.equals("2")) { //交通检查 10002
poiType = "10002";
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_traffic_check);
} else if (event.type.equals("3")) { //封路
} else if (event.type.equals("3")) { //封路 10003
poiType = "10003";
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_road_closure);
} else {
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_block_up);
}
Logger.d(TAG, "onMarkerInfo onCompleted ------>");
Logger.d(TAG, "onMarkerInfo share onCompleted ------>");
MogoMarkerOptions options = new MogoMarkerOptions()
.icon(mMarkerIcon)
.latitude(event.lat)
.owner(TanluConstants.MODEL_NAME)
.longitude(event.lon);
IMogoMarker marker = mMarkerManager.addMarker("share_tag", options); //随便传tag不可点击
//TODO 请求分享接口
//请求分享接口
MarkerExploreWay markerExploreWay = markerExploreWayList.get(0);
if (markerExploreWay.getUserInfo() != null) {
uploadShareInfo(poiType, event.imageUrl, markerExploreWay.getUserInfo().getUserName(),
markerExploreWay.getUserInfo().getUserHead());
}
uploadShareInfo(markerExploreWay.getType(), "", markerExploreWay.getUserInfo().getUserName(),
markerExploreWay.getUserInfo().getUserHead());
}
@@ -858,7 +847,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
@Override
public void onFail(String message, int code) {
Logger.d(TAG, "uploadShareInfo onFail ----->");
Logger.e(TAG, "uploadShareInfo onFail ----->");
AIAssist.getInstance(getContext()).speakTTSVoice(getString(R.string.tanlu_share_failed), null);
}
});
@@ -948,7 +937,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
}
/**
* 绘制线路 TODO
* 绘制线路
*/
private void drawMapLine(List<Center> pointList) {
int intervalNum = Utils.getIntervalValue(pointList.size());
@@ -986,6 +975,10 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
String discription = o.getResult().getDescription();
Logger.d(TAG, "getVoiceControlRoadData discription = " + discription);
if (o.getResult().getInformations() != null && o.getResult().getInformations().size() > 0) {
if (markerExploreWayList != null && markerExploreWayList.size() > 0) {
markerExploreWayList.clear(); //
}
//切换到探路卡片
if (!isCurrentPage) {
//切换探路卡片

View File

@@ -244,7 +244,7 @@ public class TanluModelData {
/**
* 上报交通检查和封路 TODO
* 上报交通检查和封路
*/
public void addTrafficCheckInfo(String poiType, String poiImgUrl, String nickname, String headImgUrl,
double lat, double lon, String address, final UploadShareCallback callback) {
@@ -252,12 +252,11 @@ public class TanluModelData {
UploadShareRoadInfo uploadShareRoadInfo = new UploadShareRoadInfo(poiType, poiImgUrl, nickname, headImgUrl, new Center(lat, lon), address);
String uploadShareStr = gson.toJson(uploadShareRoadInfo);
Logger.d(TAG, "addTrafficCheckInfo sn= " + getSn() + ">> uploadShareStr =" + uploadShareStr);
final Map<String, Object> params = new ParamsProvider.Builder(mContext)
.append("sn", Utils.getSn())
.append("data", uploadShareStr)
.build();
mTanluApiService.searchOnLineInformation(params)
mTanluApiService.uploadCheckTrafficInfor(params)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(mContext)) {
@@ -278,6 +277,7 @@ public class TanluModelData {
@Override
public void onError(Throwable e) {
super.onError(e);
e.printStackTrace();
Logger.d(TAG, "addTrafficCheckInfo onError ------> e= " + e.getMessage());
}
});

View File

@@ -9,11 +9,11 @@ import java.io.Serializable;
*/
public class MarkerInfo implements Serializable {
public String type; //封路,还是上报
public String imageUrl;
public String imageUrl; //上传完cos图片
public Long lon; //经度
public Long lat; //纬度
public MarkerInfo(String type, /*String imageUrl,*/ Long lon, Long lat) {
public MarkerInfo(String type, String imageUrl, Long lon, Long lat) {
this.type = type;
this.imageUrl = imageUrl;
this.lon = lon;

View File

@@ -14,10 +14,12 @@ class MarkerInfoReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
if (intent.action == "com.zhidao.roadcondition.marker.info"){
var type = intent.getStringExtra("type")
var imageUrl = intent.getStringExtra("imageUrl")
var lat = intent.getLongExtra("lat",0)
var lon = intent.getLongExtra("lon",0) //经度
Log.d("MarkerInfoReceiver", "type = $type ---->lat = $lat ---->lon = $lon")
EventBus.getDefault().post(MarkerInfo(type, lon, lat))
Log.d("MarkerInfoReceiver", "type = $type ---->lat = $lat ---->lon = $lon + " )
Log.d("MarkerInfoReceiver", "")
EventBus.getDefault().post(MarkerInfo(type, imageUrl,lon, lat))
}
}
}

View File

@@ -3,6 +3,7 @@ package com.mogo.module.tanlu.video
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.mogo.module.tanlu.R
@@ -102,6 +103,7 @@ class FullMediaActivity : AppCompatActivity(), View.OnClickListener {
video_view.onCompletionListener(object :
MediaCoverVideoPlayer.CompletionListener {
override fun onCompletion() {
Log.d("liyz", "FullMediaActivity ---- onCompletion ");
GSYVideoManager.releaseAllVideos()
finish()
}

View File

@@ -136,15 +136,18 @@ class MediaCoverVideoPlayer : StandardGSYVideoPlayer {
}
/**
* 多次回调 TODO
* 多次回调 TODO
*/
override fun onCompletion() {
Log.d("liyz", "onCompletion --------->")
// completionListener.let {
// it.onCompletion()
// }
super.onCompletion()
Log.d("liyz", "MediaCoverVideoPlayer onCompletion --------->")
completionListener.let {
it.onCompletion()
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
mFullPauseBitmap?.let {
@@ -153,7 +156,9 @@ class MediaCoverVideoPlayer : StandardGSYVideoPlayer {
}
}
mFullPauseBitmap = null
Log.d("MediaCoverVideoPlayer", "recycle.")
Log.d("liyz", "recycle.")
}
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="tanlu_module_marginleft">4px</dimen>
<dimen name="tanlu_module_666px">666px</dimen>
</resources>