Merge branch 'dev' of http://gitlab.zhidaoauto.com/ecos/yycp-service/Launcher into dev
@@ -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 );
|
||||
|
||||
@@ -161,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",
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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" );
|
||||
}
|
||||
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
After Width: | Height: | Size: 668 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 668 B |
|
After Width: | Height: | Size: 2.4 KiB |
BIN
modules/mogo-module-extensions/src/main/res/drawable-xhdpi/module_ext_ic_message2.png
Normal file → Executable file
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
@@ -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>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="module_ext_msg_counter_margin">26px</dimen>
|
||||
</resources>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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道路事件异常请检查参数");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +120,10 @@ public class V2XSocketManager {
|
||||
);
|
||||
}
|
||||
|
||||
public V2XMessageListener_401011 getV2XMessageListener_401011() {
|
||||
return v2XMessageListener_401011;
|
||||
}
|
||||
|
||||
/**
|
||||
* 道路事件,服务端下发
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
/**
|
||||
* 直播点赞
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 触发刷新直播心跳
|
||||
*
|
||||
|
||||
|
Before Width: | Height: | Size: 280 B After Width: | Height: | Size: 995 B |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 280 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
|
||||