Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
tongchenfei
2020-09-08 17:23:51 +08:00
66 changed files with 281 additions and 93 deletions

2
.idea/misc.xml generated
View File

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

View File

@@ -32,6 +32,7 @@ import com.mogo.service.passport.IMogoTicketCallback;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.LogLevel;
import com.mogo.utils.logger.Logger;
import com.squareup.leakcanary.LeakCanary;
import com.zhidao.boot.persistent.lib.PersistentManager;
import com.zhidao.mogo.module.left.panel.LeftPanelConst;
import com.zhidao.mogo.tanlu.api.TanluApiConst;
@@ -53,6 +54,9 @@ public class MogoApplication extends AbsMogoApplication {
public void onCreate() {
initDebugConfig();
super.onCreate();
if ( !shouldInit() ) {
return;
}
// Crash 日志收集
final long start = System.currentTimeMillis();
CrashSystem crashSystem = CrashSystem.getInstance( this );
@@ -94,10 +98,20 @@ public class MogoApplication extends AbsMogoApplication {
Intent intent = new Intent( this, MogoMainService.class );
startService( intent );
}
LeakCanary.install( this );
Log.i( "timer", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
}
@Override
protected boolean shouldInit() {
return !LeakCanary.isInAnalyzerProcess( this );
}
private void initDebugConfig() {
if ( !shouldInit() ) {
return;
}
DebugConfig.setNetMode( BuildConfig.NET_ENV );
DebugConfig.setDebug( BuildConfig.DEBUG );
DebugConfig.setAIType( BuildConfig.AIType );

View File

@@ -84,6 +84,7 @@ targetSdkVersion : 22,
// material
material : 'com.google.android.material:material:1.1.0',
indicator : 'com.github.zhpanvip:viewpagerindicator:1.0.4',
// modules
moduletanlu : "com.mogo.module:module-tanlu:${MOGO_MODULE_TANLU_VERSION}",
@@ -160,7 +161,7 @@ targetSdkVersion : 22,
gpssimulatornoop : "com.mogo.module:module-gps-simulator-noop:${MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION}",
adasapi : "com.zhidao.autopilot.support:adas:1.0.1",
adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.0.8",
adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.0.9",
// 个人中心的SDK
personalsdk : "com.zhidaoauto.person.info:data:1.0.1",

View File

@@ -53,7 +53,13 @@ public class AbsMogoApplication extends Application {
public void onCreate() {
super.onCreate();
sApp = this;
init();
if ( shouldInit() ) {
init();
}
}
protected boolean shouldInit(){
return true;
}
protected void init() {

View File

@@ -47,7 +47,6 @@ public abstract class MvpFragment<V extends IView, P extends Presenter<V>> exten
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
initViews(savedInstanceState);
}
/**
@@ -61,6 +60,7 @@ public abstract class MvpFragment<V extends IView, P extends Presenter<V>> exten
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
initViews();
initViews(savedInstanceState);
mPresenter = createPresenter();
getViewLifecycleOwner().getLifecycle().addObserver(mPresenter);
}

View File

@@ -70,7 +70,7 @@ public class AMapViewWrapper implements IMogoMapView,
AMap.OnCameraChangeListener,
AMap.OnMyLocationChangeListener {
private static final String TAG = "AMapNaviViewWrapper";
private static final String TAG = "AMapViewWrapper";
private final MapView mMapView;
private IMogoMap mIMap;
@@ -243,6 +243,9 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onLowMemory() {
if ( mMapView != null ) {
mMapView.onLowMemory();
}
Logger.d( TAG, "map onLowMemory" );
}

View File

@@ -136,6 +136,7 @@ class CosStatusController : CosStatusCallback {
}
Log.d(TAG, "videoAndThumbMap ${videoAndThumbMap}")
if (videoAndThumbMap.size == 2) {
trackUploadCos(4)
Log.d(TAG, "videoAndThumbMap.size == 2 ")
var locationInfo = LocationUtil.getInstance().getLocationInfo()
val locationStr: String = Gson().toJson(locationInfo)
@@ -149,7 +150,6 @@ class CosStatusController : CosStatusCallback {
sendGetInfoFailedReceiver("100")
}
} else {
trackUploadCos(4)
//分享成功并打点如果是上报拥堵需要takeVideo
LatLngStickyEventBus.getInstance()
.postSticky(GetImageSuccessEvent(downloadUrl, mType))

View File

@@ -28,17 +28,8 @@ public class AnimWrapper implements Anim {
public void initAnim( ImageView target ) {
mTarget = target;
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
ThreadPoolService.execute( () -> {
final AnimationDrawable drawable = new AnimationDrawable();
for ( int i = 0; i < AnimRes.sRes.length; i++ ) {
drawable.addFrame( target.getResources().getDrawable( AnimRes.sRes[i] ), 100 );
}
UiThreadHandler.post( () -> {
target.setBackground( drawable );
mDelegate = new OthersAnim( drawable );
start();
} );
} );
mDelegate = new OthersAnim( target );
start();
} else {
mTarget.setImageResource( R.drawable.mogo_tts_icon_00000 );
}

View File

@@ -1,6 +1,9 @@
package com.mogo.module.apps.anim;
import android.graphics.drawable.AnimationDrawable;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.widget.ImageView;
/**
* @author congtaowang
@@ -8,25 +11,44 @@ import android.graphics.drawable.AnimationDrawable;
* <p>
* 描述
*/
public class OthersAnim implements Anim{
public class OthersAnim implements Anim {
private AnimationDrawable mDrawable;
private int mStartIndex = 0;
public OthersAnim( AnimationDrawable drawable ) {
this.mDrawable = drawable;
private final static int MSG_LOOP = 3003;
public static final long INTERVAL = 100L;
private boolean mStarted = false;
private final ImageView mImageView;
private Handler mHandler = new Handler( Looper.getMainLooper() ) {
@Override
public void handleMessage( Message msg ) {
super.handleMessage( msg );
switch ( msg.what ) {
case MSG_LOOP:
if ( mStarted ) {
mImageView.setImageResource( AnimRes.sRes[mStartIndex++ % AnimRes.sRes.length] );
mHandler.sendEmptyMessageDelayed( MSG_LOOP, INTERVAL );
}
break;
}
}
};
public OthersAnim( ImageView imageView ) {
this.mImageView = imageView;
}
@Override
public void start() {
if ( mDrawable != null ) {
mDrawable.start();
}
mStarted = true;
mHandler.sendEmptyMessage( MSG_LOOP );
}
@Override
public void stop() {
if ( mDrawable != null ) {
mDrawable.stop();
}
mStarted = false;
mHandler.removeMessages( MSG_LOOP );
}
}

View File

@@ -1052,5 +1052,6 @@
<dimen name="sp_40">40px</dimen>
<dimen name="sp_42">42px</dimen>
<dimen name="sp_48">48px</dimen>
<dimen name="module_common_shadow_width">-10px</dimen>
</resources>

View File

@@ -1043,4 +1043,5 @@
<dimen name="sp_40">21.8750px</dimen>
<dimen name="sp_42">22.9688px</dimen>
<dimen name="sp_48">26.2500px</dimen>
<dimen name="module_common_shadow_width">-8px</dimen>
</resources>

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -8,11 +8,12 @@
android:id="@+id/module_ext_id_weather_container"
android:layout_width="wrap_content"
android:layout_height="@dimen/module_ext_height"
android:background="@drawable/module_ext_drawable_weather_bkg"
android:background="@drawable/module_ext_shadow_bkg"
android:gravity="center"
android:paddingStart="@dimen/module_ext_weather_container_paddingLeft"
android:paddingEnd="@dimen/module_ext_weather_container_paddingRight"
android:visibility="invisible"
android:translationY="@dimen/module_common_shadow_width"
app:layout_goneMarginLeft="@dimen/module_ext_notice_margin_start"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@+id/module_ext_id_msg"
@@ -37,23 +38,24 @@
tools:text="28°" />
</LinearLayout>
<FrameLayout
<RelativeLayout
android:id="@+id/module_ext_id_msg"
android:layout_width="@dimen/module_ext_height"
android:layout_height="@dimen/module_ext_height"
android:layout_marginStart="@dimen/module_ext_notice_margin_start"
android:translationY="@dimen/module_common_shadow_width"
android:layout_marginEnd="@dimen/module_ext_msg_marginRight"
android:background="@drawable/module_ext_drawable_msg_container_bkg"
android:background="@drawable/module_ext_shadow_bkg"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/ivUserHeadImg"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@+id/ivUserHeadImg"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible">
<ImageView
android:id="@+id/module_ext_id_msg_icon_counter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_centerInParent="true"
android:scaleType="fitXY"
android:src="@drawable/module_ext_ic_message2" />
@@ -61,23 +63,20 @@
android:id="@+id/module_ext_id_msg_counter"
android:layout_width="@dimen/module_ext_msg_counter_width"
android:layout_height="@dimen/module_ext_msg_counter_height"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/module_ext_msg_dot_marginLeft"
android:layout_marginBottom="@dimen/module_ext_msg_dot_marginRight"
android:background="@drawable/module_ext_drawable_msg_bkg"
android:gravity="center"
android:layout_alignParentRight="true"
android:textColor="#FFFFFF"
android:textSize="@dimen/module_ext_msg_counter_textSize"
tools:text="···" />
</FrameLayout>
</RelativeLayout>
<ImageView
android:id="@+id/ivUserHeadImg"
android:layout_width="@dimen/module_ext_height"
android:layout_height="@dimen/module_ext_height"
android:src="@drawable/model_ext_default_user_head"
app:layout_constraintBottom_toBottomOf="@+id/module_ext_id_weather_container"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/module_ext_id_weather_container"
tools:visibility="gone" />
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
</merge>

View File

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

View File

@@ -55,7 +55,7 @@
<dimen name="module_entrance_id_button_marginTop">20px</dimen>
<!-- module_ext_layout_extensions.xml-->
<dimen name="module_ext_height">100px</dimen>
<dimen name="module_ext_height">120px</dimen>
<dimen name="module_ext_paddingRight">60px</dimen>
<dimen name="module_ext_paddingLeft">60px</dimen>
<dimen name="module_ext_voice_textSize">32px</dimen>
@@ -145,4 +145,5 @@
<dimen name="module_ext_display_overview_icon_marginTop">20px</dimen>
<dimen name="module_ext_top_over_navi_height">40px</dimen>
<dimen name="module_ext_msg_counter_margin">45px</dimen>
</resources>

View File

@@ -55,7 +55,7 @@
<dimen name="module_entrance_id_button_marginTop">20px</dimen>
<!-- module_ext_layout_extensions.xml-->
<dimen name="module_ext_height">120px</dimen>
<dimen name="module_ext_height">140px</dimen>
<dimen name="module_ext_paddingRight">60px</dimen>
<dimen name="module_ext_paddingLeft">60px</dimen>
<dimen name="module_ext_voice_textSize">32px</dimen>
@@ -147,4 +147,5 @@
<dimen name="module_ext_top_over_navi_height">34px</dimen>
<dimen name="module_ext_notice_margin_start">175px</dimen>
<dimen name="module_ext_weather_margin_start">30px</dimen>
<dimen name="module_ext_msg_counter_margin">45px</dimen>
</resources>

View File

@@ -56,7 +56,7 @@
<dimen name="module_entrance_id_button_marginTop">8px</dimen>
<!-- module_ext_layout_extensions.xml-->
<dimen name="module_ext_height">66px</dimen>
<dimen name="module_ext_height">82px</dimen>
<dimen name="module_ext_paddingRight">32px</dimen>
<dimen name="module_ext_paddingLeft">32px</dimen>
@@ -152,5 +152,6 @@
<dimen name="module_ext_top_over_navi_height">19px</dimen>
<dimen name="module_ext_weather_margin_start">16px</dimen>
<dimen name="module_ext_msg_counter_margin">26px</dimen>
</resources>

View File

@@ -52,6 +52,7 @@ dependencies {
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.aspectj
implementation rootProject.ext.dependencies.indicator
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogoutils

View File

@@ -1,13 +1,17 @@
package com.mogo.module.guide.fragment
import androidx.recyclerview.widget.RecyclerView
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
import com.mogo.module.guide.GuideBizManager
import com.mogo.module.guide.R
import com.mogo.module.guide.util.speak
import com.mogo.utils.logger.Logger
import com.zhpan.indicator.enums.IndicatorSlideMode
import com.zhpan.indicator.enums.IndicatorStyle
import kotlinx.android.synthetic.main.module_guide_fragment.*
class GuideFragment : MvpFragment<GuideConstract.View, GuidePresenter>(), GuideConstract.View {
companion object {
@@ -28,6 +32,12 @@ class GuideFragment : MvpFragment<GuideConstract.View, GuidePresenter>(), GuideC
Logger.d(TAG, "init Views")
adapter = GuideAdapter(this)
moduleGuideViewPager.adapter = adapter
(moduleGuideViewPager.getChildAt(0) as RecyclerView).layoutManager!!.isItemPrefetchEnabled = false
moduleGuideIndicator.setSliderColor(context!!.resources.getColor(R.color.module_guide_indicator_dark),context!!.resources.getColor(R.color.module_guide_indicator_white))
.setSliderWidth(context!!.resources.getDimension(R.dimen.dp_11))
.setSlideMode(IndicatorSlideMode.NORMAL)
.setIndicatorStyle(IndicatorStyle.CIRCLE)
.setupWithViewPager(moduleGuideViewPager)
}
fun moveToNext() {

View File

@@ -29,6 +29,10 @@ class GuideStageFiveFragment : MvpFragment<IView, Presenter<IView>>, View.OnClic
override fun initViews() {
module_guide_page_left.setOnClickListener(this)
module_guide_tv_jump.setOnClickListener(this)
}
override fun onResume() {
super.onResume()
speak(context!!,context!!.resources.getString(R.string.module_guide_voice_page_five),object : IMogoVoiceCmdCallBack {
override fun onTTSEnd(ttsId: String?, tts: String?) {
containerFragment?.closeGuideFragment()

View File

@@ -30,6 +30,10 @@ class GuideStageFourFragment : MvpFragment<IView, Presenter<IView>>, View.OnClic
module_guide_page_left.setOnClickListener(this)
module_guide_page_right.setOnClickListener(this)
module_guide_tv_jump.setOnClickListener(this)
}
override fun onResume() {
super.onResume()
speak(context!!,context!!.resources.getString(R.string.module_guide_voice_page_four),object : IMogoVoiceCmdCallBack {
override fun onTTSEnd(ttsId: String?, tts: String?) {
containerFragment?.moveToNext()

View File

@@ -33,6 +33,10 @@ class GuideStageOneFragment : MvpFragment<IView, Presenter<IView>>, View.OnClick
AnalyticsUtil.track(INVOKE_TRACK_SHOW, hashMapOf("pages_num" to 1))
module_guide_page_right.setOnClickListener(this)
module_guide_tv_jump.setOnClickListener(this)
}
override fun onResume() {
super.onResume()
speak(context!!,context!!.resources.getString(R.string.module_guide_voice_page_one),object : IMogoVoiceCmdCallBack {
override fun onTTSEnd(ttsId: String?, tts: String?) {
containerFragment?.moveToNext()

View File

@@ -30,6 +30,10 @@ class GuideStageThreeFragment : MvpFragment<IView, Presenter<IView>>, View.OnCli
module_guide_page_left.setOnClickListener(this)
module_guide_page_right.setOnClickListener(this)
module_guide_tv_jump.setOnClickListener(this)
}
override fun onResume() {
super.onResume()
speak(context!!,context!!.resources.getString(R.string.module_guide_voice_page_three),object : IMogoVoiceCmdCallBack {
override fun onTTSEnd(ttsId: String?, tts: String?) {
containerFragment?.moveToNext()

View File

@@ -30,6 +30,10 @@ class GuideStageTwoFragment : MvpFragment<IView, Presenter<IView>>, View.OnClick
module_guide_page_left.setOnClickListener(this)
module_guide_page_right.setOnClickListener(this)
module_guide_tv_jump.setOnClickListener(this)
}
override fun onResume() {
super.onResume()
speak(context!!,context!!.resources.getString(R.string.module_guide_voice_page_two),object : IMogoVoiceCmdCallBack {
override fun onTTSEnd(ttsId: String?, tts: String?) {
containerFragment?.moveToNext()

View File

@@ -12,4 +12,13 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.zhpan.indicator.IndicatorView
android:id="@+id/moduleGuideIndicator"
android:layout_width="@dimen/dp_30"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_84"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 400 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="module_guide_blue_3B91FF">#3B91FF</color>
<color name="module_guide_indicator_dark">#ccffffff</color>
<color name="module_guide_indicator_white">#ffffff</color>
</resources>

View File

@@ -6,9 +6,9 @@
<string name="module_guide_skip">跳过</string>
<string name="module_guide_voice_page_one">欢迎使用蘑菇出行,您下次可以直接对我说,打开蘑菇出行来直接进入应用,点击左下方按钮进行摄像头设置</string>
<string name="module_guide_voice_page_two"></string>
<string name="module_guide_voice_page_two">左边是道路事件的播报,点击右边地图上的事件标示可以查看事件详情</string>
<string name="module_guide_voice_page_three">这里是道路信息显示,点击后可查看事件详情</string>
<string name="module_guide_voice_page_four">这里是事件汇总,您可以查看您参与的事件和您的分享记录</string>
<string name="module_guide_voice_page_five">点击这里可以把路况分享给其他车友,或者直接对我说,上报路况</string>
<string name="module_guide_voice_page_five">更多设置,在左上角的设置功能中,点击右下角的分享,可以把路况分享给其他车友</string>
<string name="module_guide_voice_page_end">我们希望让您的出行更加安全高效,更多功能等着你去发现,快去体验体验吧</string>
</resources>

View File

@@ -30,6 +30,7 @@ import com.mogo.map.navi.MogoTraffic;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
import com.mogo.module.common.entity.MarkerResponse;
import com.mogo.module.common.map.MapCenterPointStrategy;
import com.mogo.module.common.map.Scene;
import com.mogo.module.service.intent.IntentHandlerFactory;
@@ -224,9 +225,10 @@ public class MogoServices implements IMogoMapListener,
/**
* 手动刷新回调
*/
private RefreshCallback mCustomRefreshCallback = new RefreshCallback() {
private RefreshCallback mCustomRefreshCallback = new RefreshCallback< MarkerResponse >() {
@Override
public void onSuccess( Object o ) {
public void onSuccess( MarkerResponse o ) {
MapMarkerManager.getInstance().onSyncMarkerResponse( o );
mLoopRequest = false;
// 用户手动操作地图刷新成功后,设置状态为 true引发延时策略
mStatusManager.setUserInteractionStatus( ServiceConst.TYPE, true, true );
@@ -241,9 +243,10 @@ public class MogoServices implements IMogoMapListener,
/**
* 自动刷新回调
*/
private RefreshCallback mAutoRefreshCallback = new RefreshCallback() {
private RefreshCallback mAutoRefreshCallback = new RefreshCallback<MarkerResponse>() {
@Override
public void onSuccess( Object o ) {
public void onSuccess( MarkerResponse o ) {
MapMarkerManager.getInstance().onSyncMarkerResponse( o );
mLoopRequest = false;
Logger.d( TAG, "request Success." );
invokeAutoRefreshStrategy();
@@ -436,7 +439,7 @@ public class MogoServices implements IMogoMapListener,
Logger.w( TAG, "lonLat is null." );
return;
}
mRefreshModel.refreshData( ro.mLonLat, ro.mRadius, ro.mAmount, ro.mCallback );
mRefreshModel.refreshExplorerWayData( ro.mLonLat, ro.mRadius, ro.mAmount, ro.mCallback );
MapMarkerManager.getInstance().getOnlineCarDataByAutoRefreshStrategy( ro.mLonLat );
Logger.i( TAG, "刷新半径 = %s, 点 = %s, zoomLevel = %s, amount = %s", ro.mRadius, ro.mLonLat, mLastZoomLevel, ro.mAmount );

View File

@@ -109,8 +109,8 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
mContext = context.getApplicationContext();
mRefreshModel = new RefreshModel( mContext );
// 长连接
MarkerServiceHandler.getMogoSocketManager().registerOnMessageListener( 401001, this );
// 长连接 - 长链变短链
// MarkerServiceHandler.getMogoSocketManager().registerOnMessageListener( 401001, this );
MarkerServiceHandler.getActionManager().registerBizActionDoneListener( this );
MarkerServiceHandler.getApis().getRegisterCenterApi().registerADASControlStatusChangedListener( TAG, this );
}
@@ -703,6 +703,16 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
} );
}
public void onSyncMarkerResponse(MarkerResponse response){
if ( ignoreDrawRequest() ) {
return;
}
Logger.d( TAG, "接收到了地图大而全数据" );
runOnTargetThread( () -> {
drawMapMarker( response );
} );
}
public void syncLocation( double lon, double lat ) {
mCarLatLng = new MogoLatLng( lat, lon );
}

View File

@@ -110,6 +110,51 @@ public class RefreshModel {
}
}
public void refreshExplorerWayData( 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();
refreshBody.limit = limit;
refreshBody.location = new RefreshBody.LatLon( latLng.lat, latLng.lng );
refreshBody.radius = radius;
refreshBody.dataType.add( ServiceConst.CARD_TYPE_ROAD_CONDITION );
String data = GsonUtil.jsonFromObject( refreshBody );
query.put( "data", data );
Logger.d( TAG, data );
mRefreshApiService.refreshDataSync( query )
.subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe( new SubscribeImpl< MarkerResponse >( RequestOptions.create( mContext ) ) {
@Override
public void onSuccess( MarkerResponse o ) {
super.onSuccess( o );
if ( callback != null ) {
callback.onSuccess( o );
}
}
@Override
public void onError( Throwable e ) {
super.onError( e );
if ( callback != null ) {
callback.onFail();
}
}
@Override
public void onError( String message, int code ) {
super.onError( message, code );
if ( callback != null ) {
callback.onFail();
}
}
} );
}
}
public void refreshDataSync( MogoLatLng latLng, int radius, int limit, final RefreshCallback callback ) {
if ( mRefreshApiService != null ) {
final Map< String, Object > query = new ParamsProvider.Builder( mContext ).build();

View File

@@ -5,7 +5,9 @@ import android.os.Handler;
import com.mogo.map.MogoLatLng;
import com.mogo.map.location.MogoLocation;
import com.mogo.module.common.entity.MarkerResponse;
import com.mogo.module.v2x.listener.V2XLocationListener;
import com.mogo.module.v2x.network.V2XRefreshCallback;
import com.mogo.module.v2x.network.V2XRefreshModel;
import com.mogo.utils.logger.Logger;
@@ -18,7 +20,7 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
* desc :
* version: 1.0
*/
public class V2XMarkerService {
public class V2XMarkerService implements V2XRefreshCallback<MarkerResponse> {
private final String TAG = "V2XMarkerService";
// 一分钟获取一次最新的路况信息
@@ -48,12 +50,13 @@ public class V2XMarkerService {
public void refreshMarkerData(MogoLocation location) {
try {
if (mV2XRefreshModel != null && location != null) {
//Logger.d(MODULE_NAME, "V2X道路事件执行气泡刷新操作。");
Logger.d(MODULE_NAME, "V2X道路事件执行气泡刷新操作。");
// 获取目前最新的周边的poi点
mV2XRefreshModel.querySnapshotAsync(
mV2XRefreshModel.querySnapshotSync(
new MogoLatLng(location.getLatitude(), location.getLongitude()),
(int) getMapCameraFactWidth(),
999);
999,
this);
}
} catch (Exception e) {
e.printStackTrace();
@@ -105,4 +108,16 @@ public class V2XMarkerService {
}
refreshHandler.post(refreshRunnable);
}
@Override
public void onSuccess(MarkerResponse result) {
if (V2XSocketManager.getInstance().getV2XMessageListener_401011() != null) {
V2XSocketManager.getInstance().getV2XMessageListener_401011().onMsgReceived(result);
}
}
@Override
public void onFail(String msg) {
Logger.e(TAG, "刷新V2X道路事件异常请检查参数");
}
}

View File

@@ -120,6 +120,10 @@ public class V2XSocketManager {
);
}
public V2XMessageListener_401011 getV2XMessageListener_401011() {
return v2XMessageListener_401011;
}
/**
* 道路事件,服务端下发
*/

View File

@@ -39,12 +39,19 @@ public interface V2XApiService {
Observable<BaseData> refreshHeartBeat(@FieldMap Map<String, Object> liveBroadcast);
/**
* 刷新地图气泡点
* 刷新地图气泡点,异步获取
*/
@FormUrlEncoded
@POST("/yycp-launcherSnapshot/launcherSnapshot/querySnapshotAsync")
Observable<BaseData> querySnapshotAsync(@FieldMap Map<String, Object> parameters);
/**
* 刷新地图气泡点,同步获取
*/
@FormUrlEncoded
@POST("/yycp-launcherSnapshot/launcherSnapshot/querySnapshotSync")
Observable<MarkerResponse> querySnapshotSync(@FieldMap Map<String, Object> parameters);
/**
* 直播点赞
*/

View File

@@ -67,7 +67,7 @@ public class V2XRefreshModel {
}
/**
* 刷新地图点数据
* 刷新地图点数据,同步获取
*/
public void querySnapshotAsync(MogoLatLng latLng, int radius, int limit) {
if (mV2XApiService != null) {
@@ -96,6 +96,42 @@ public class V2XRefreshModel {
}
}
/**
* 刷新地图点数据,同步获取
*/
public void querySnapshotSync(MogoLatLng latLng, int radius, int limit, final V2XRefreshCallback<MarkerResponse> callback) {
if (mV2XApiService != null) {
final Map<String, Object> query = new ParamsProvider.Builder(mContext).build();
final RefreshBody refreshBody = new RefreshBody();
refreshBody.limit = limit;
refreshBody.location = new RefreshBody.LatLon(latLng.lat, latLng.lon);
refreshBody.radius = radius;
refreshBody.dataType.add(ServiceConst.CARD_TYPE_ROAD_CONDITION);
refreshBody.viewPush = true;
query.put("data", GsonUtil.jsonFromObject(refreshBody));
mV2XApiService.querySnapshotSync(query)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SubscribeImpl<MarkerResponse>(RequestOptions.create(mContext)) {
@Override
public void onSuccess(MarkerResponse o) {
super.onSuccess(o);
if (callback != null) {
callback.onSuccess(o);
}
}
@Override
public void onError(String message, int code) {
super.onError(message, code);
if (callback != null) {
callback.onFail(message);
}
}
});
}
}
/**
* 触发刷新直播心跳
*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -1,8 +0,0 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<corners android:radius="@dimen/module_v2x_panel_icon_cor" />
<gradient android:startColor="#FF2E3141" android:endColor="#FF3F435F" android:angle="0" />
</shape>
</item>
</selector>

View File

@@ -89,10 +89,10 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/rgTabSelect" />
<!-- <View-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="58px"-->
<!-- android:background="@drawable/v2x_shadow_shape_view"-->
<!-- app:layout_constraintBottom_toBottomOf="parent" />-->
<!-- <View-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="58px"-->
<!-- android:background="@drawable/v2x_shadow_shape_view"-->
<!-- app:layout_constraintBottom_toBottomOf="parent" />-->
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -5,10 +5,10 @@
android:id="@+id/llEventMore"
android:layout_width="@dimen/module_v2x_panel_width"
android:layout_height="@dimen/module_v2x_panel_width"
android:background="@drawable/v2x_drawable_event_more_bkg"
android:background="@drawable/v2x_shadow_bg"
android:translationY="@dimen/v2x_panel_btn_translationY"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:translationZ="1dp">
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/btnShowOrHidePanels"

View File

@@ -57,7 +57,7 @@
<dimen name="module_v2x_surrounding_item_bottom_right_textsize">16px</dimen>
<dimen name="module_v2x_des_index_width">17px</dimen>
<dimen name="module_v2x_des_index_height">15.4px</dimen>
<dimen name="module_v2x_panel_width">66px</dimen>
<dimen name="module_v2x_panel_width">82px</dimen>
<dimen name="module_v2x_panel_icon_cor">16px</dimen>
<dimen name="share_empty_icon_width">117px</dimen>
<dimen name="v2x_loading_ani_width">200px</dimen>
@@ -74,4 +74,5 @@
<dimen name="share_btn_middle_padding">29px</dimen>
<dimen name="v2x_panel_btn_translationY">-8px</dimen>
</resources>

View File

@@ -56,7 +56,7 @@
<dimen name="module_v2x_des_index_width">31.9px</dimen>
<dimen name="module_v2x_des_index_height">26px</dimen>
<dimen name="module_v2x_panel_icon_cor">30px</dimen>
<dimen name="module_v2x_panel_width">120px</dimen>
<dimen name="module_v2x_panel_width">140px</dimen>
<dimen name="share_empty_icon_width">219px</dimen>
<dimen name="v2x_loading_ani_width">400px</dimen>
<dimen name="v2x_share_btn_width">281px</dimen>
@@ -71,5 +71,7 @@
<dimen name="share_index_bottom_padding">36px</dimen>
<dimen name="share_btn_middle_padding">54px</dimen>
<dimen name="v2x_panel_btn_translationY">-10px</dimen>
<dimen name="v2x_panel_btn_image_width">114px</dimen>
</resources>

View File

@@ -57,7 +57,7 @@
<dimen name="module_v2x_surrounding_item_bottom_right_textsize">16px</dimen>
<dimen name="module_v2x_des_index_width">16px</dimen>
<dimen name="module_v2x_des_index_height">20px</dimen>
<dimen name="module_v2x_panel_width">66px</dimen>
<dimen name="module_v2x_panel_width">82px</dimen>
<dimen name="module_v2x_panel_icon_cor">16px</dimen>
<dimen name="share_empty_icon_width">117px</dimen>
<dimen name="v2x_loading_ani_width">200px</dimen>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -1,8 +0,0 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<corners android:radius="@dimen/module_v2x_panel_icon_cor" />
<gradient android:startColor="#FFFFFFFF" android:endColor="#E5F5F5F5" android:angle="0" />
</shape>
</item>
</selector>

View File

@@ -1,8 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_v2x_panel_icon_cor">30px</dimen>
<dimen name="module_v2x_surrounding_refresh_bt_radius">42px</dimen>
</resources>

View File

@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_v2x_panel_icon_cor">16px</dimen>
<dimen name="module_v2x_surrounding_refresh_bt_radius">24px</dimen>
</resources>