diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshBody.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshBody.java index 2200ed394a..281ecdef93 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshBody.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshBody.java @@ -11,17 +11,20 @@ import java.util.List; */ public class RefreshBody { - public List< String > dataType = new ArrayList<>(); - public int limit = 50;// 请求数量 - public int radius = 2_000; // 地理围栏半径(米) - public LatLon location; + public List dataType = new ArrayList<>(); // 要查询的类型 + public int limit = 50; // 请求数量 + public int radius = 2_000; // 地理围栏半径(米) + public LatLon location; // 坐标 + + public boolean onlyFocus; // 是否仅查询已关注的好友 + public boolean onlySameCity; // 是否仅查询注册城市相同的同城用户 public static class LatLon { private double lat; private double lon; - public LatLon( double lat, double lon ) { + public LatLon(double lat, double lon) { this.lat = lat; this.lon = lon; } diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java index a30ca0e83b..5a366f4567 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java @@ -7,14 +7,13 @@ import com.mogo.commons.data.BaseData; import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.network.ParamsProvider; import com.mogo.commons.network.SubscribeImpl; -import com.mogo.commons.network.Utils; import com.mogo.map.MogoLatLng; +import com.mogo.module.service.ServiceConst; import com.mogo.service.MogoServicePaths; import com.mogo.service.network.IMogoNetwork; import com.mogo.utils.network.RequestOptions; import com.mogo.utils.network.utils.GsonUtil; -import java.util.HashMap; import java.util.Map; import io.reactivex.android.schedulers.AndroidSchedulers; @@ -36,14 +35,14 @@ public class RefreshModel { private final Context mContext; private RefreshApiService mRefreshApiService; - public RefreshModel( Context context ) { + public RefreshModel(Context context) { this.mContext = context; - IMogoNetwork network = ( IMogoNetwork ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_NETWORK ).navigation( context ); - this.mRefreshApiService = network.create( RefreshApiService.class, getNetHost() ); + IMogoNetwork network = (IMogoNetwork) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_NETWORK).navigation(context); + this.mRefreshApiService = network.create(RefreshApiService.class, getNetHost()); } private String getNetHost() { - switch ( DebugConfig.getNetMode() ) { + switch (DebugConfig.getNetMode()) { case DebugConfig.NET_MODE_DEV: return HOST_DEV; case DebugConfig.NET_MODE_QA: @@ -53,34 +52,82 @@ public class RefreshModel { } } - public void refreshData( MogoLatLng latLng, int radius, final RefreshCallback callback ) { - if ( mRefreshApiService != null ) { - final Map< String, Object > query = new ParamsProvider.Builder( mContext ).build(); + public void refreshData(MogoLatLng latLng, int radius, final RefreshCallback callback) { + if (mRefreshApiService != null) { + final Map query = new ParamsProvider.Builder(mContext).build(); final RefreshBody refreshBody = new RefreshBody(); refreshBody.limit = 5; - refreshBody.location = new RefreshBody.LatLon( latLng.lat, latLng.lng ); + refreshBody.location = new RefreshBody.LatLon(latLng.lat, latLng.lng); refreshBody.radius = radius; - query.put( "data", GsonUtil.jsonFromObject( refreshBody ) ); - mRefreshApiService.refreshData( query ) - .subscribeOn( Schedulers.io() ) - .observeOn( AndroidSchedulers.mainThread() ) - .subscribe( new SubscribeImpl< BaseData >( RequestOptions.create( mContext ) ) { + query.put("data", GsonUtil.jsonFromObject(refreshBody)); + mRefreshApiService.refreshData(query) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) { @Override - public void onSuccess( BaseData o ) { - super.onSuccess( o ); - if ( callback != null ) { + public void onSuccess(BaseData o) { + super.onSuccess(o); + if (callback != null) { callback.onSuccess(); } } @Override - public void onError( String message, int code ) { - super.onError( message, code ); - if ( callback != null ) { + public void onError(String message, int code) { + super.onError(message, code); + if (callback != null) { callback.onFail(); } } - } ); + }); + } + } + + /** + * 查询在线车辆 + * + * @param latLng 经纬度 + * @param radius 半径 + * @param onlyFocus 是否仅查询已关注的好友 + * @param onlySameCity 是否仅查询注册城市相同的同城用户 + * @param callback + */ + public void queryOnLineCar(MogoLatLng latLng, + int radius, + boolean onlyFocus, + boolean onlySameCity, + final RefreshCallback callback) { + if (mRefreshApiService != null) { + final Map query = new ParamsProvider.Builder(mContext).build(); + final RefreshBody refreshBody = new RefreshBody(); + refreshBody.limit = 5; + refreshBody.location = new RefreshBody.LatLon(latLng.lat, latLng.lng); + refreshBody.radius = radius; + refreshBody.onlyFocus = onlyFocus; + refreshBody.onlySameCity = onlySameCity; + refreshBody.dataType.add(ServiceConst.CARD_TYPE_USER_DATA); + + query.put("data", GsonUtil.jsonFromObject(refreshBody)); + mRefreshApiService.refreshData(query) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) { + @Override + public void onSuccess(BaseData o) { + super.onSuccess(o); + if (callback != null) { + callback.onSuccess(); + } + } + + @Override + public void onError(String message, int code) { + super.onError(message, code); + if (callback != null) { + callback.onFail(); + } + } + }); } } } diff --git a/modules/mogo-module-tanlu/src/main/AndroidManifest.xml b/modules/mogo-module-tanlu/src/main/AndroidManifest.xml index a238192807..e5e74d1ffe 100644 --- a/modules/mogo-module-tanlu/src/main/AndroidManifest.xml +++ b/modules/mogo-module-tanlu/src/main/AndroidManifest.xml @@ -14,6 +14,13 @@ + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/constant/TanluConstants.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/constant/TanluConstants.java index c40193a41a..bbd8ccef16 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/constant/TanluConstants.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/constant/TanluConstants.java @@ -13,6 +13,10 @@ public class TanluConstants { public static final String MODEL_NAME = "CARD_TYPE_ROAD_CONDITION"; - public static final String UPLOAD_ROAD_CONDITION = "upload_road_condition"; + public static final String UPLOAD_ROAD_CONDITION = "command_upload_roadcondition"; + + public static final String SPECIFIEDROAD_SEARCH = "com.zhidao.pathfinder.specifiedroad.search"; + public static final String NEARBYROAD_SEARCH = "com.zhidao.pathfinder.nearbyroad.search"; + } diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java index f62392ca7d..cadebf4b91 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java @@ -63,6 +63,7 @@ import com.mogo.module.tanlu.model.PathLineResult; import com.mogo.module.tanlu.model.TanluModelData; import com.mogo.module.tanlu.model.VoiceSearchResult; import com.mogo.module.tanlu.model.event.MarkerInfo; +import com.mogo.module.tanlu.model.event.PushTypeInfo; import com.mogo.module.tanlu.util.Utils; import com.mogo.module.tanlu.video.FullMediaActivity; import com.mogo.module.tanlu.video.SimpleCoverVideoPlayer; @@ -85,6 +86,7 @@ import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; +import org.json.JSONObject; import java.util.ArrayList; import java.util.List; @@ -130,8 +132,8 @@ public class TanluCardViewFragment extends MvpFragment> //media private GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder(); - private String mVideoUrl = "http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8"; - private String mImageUrl = "https://oimagec4.ydstatic.com/image?id=-5397300958976572132&product=adpublish&w=520&h=347"; + private String mVideoUrl = ""; + private String mImageUrl = ""; private String mTitle = ""; private long mGenerateTime = 0; private IMogoImageloader mogoImageloader; @@ -152,6 +154,7 @@ public class TanluCardViewFragment extends MvpFragment> private List passedByPoints; private IMogoRegisterCenter mMogoRegisterCenter; private String mKeywords; + private boolean isCurrentPage; @Override @@ -180,9 +183,7 @@ public class TanluCardViewFragment extends MvpFragment> simpleCoverVideoPlayer.setVisibility(View.VISIBLE); autoZoomInImageView.setVisibility(View.GONE); - //视频配置 TODO 需要去掉 -// gsyVideoOptionBuilder.setUrl(mVideoUrl).setCacheWithPlay(false).setPlayTag(TAG) -// .build(simpleCoverVideoPlayer); + //视频点击 simpleCoverVideoPlayer.getStartButton().setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -293,16 +294,13 @@ public class TanluCardViewFragment extends MvpFragment> public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); getViewLifecycleOwner().getLifecycle().addObserver(mPresenter); + Logger.d(TAG, "onActivityCreated -------> "); EventBus.getDefault().register(this); initInterface(); initModelData(); - handleRoadLineMessage(); initMap(); initStrings(); initListener(); - - //TODO切换探路卡片 -// iMogoCardManager.switch2(TanluConstants.MODEL_NAME); } private void initModelData() { @@ -358,11 +356,16 @@ public class TanluCardViewFragment extends MvpFragment> @Override public boolean onMarkerClicked(IMogoMarker marker) { //点击marker以后,确认他的位置?然后点击下一个操作 TODO + mEmptyLayout.setVisibility(View.GONE); + mRootLayout.setVisibility(View.VISIBLE); + + Logger.d(TAG, "onMarkerClicked registerMogoMarkerClickListener = "); MarkerExploreWay exploreWay = extractFromMarker(marker); if (exploreWay == null) { return false; } + //TODO 自己打的点,需要重新 if (exploreWay.getFileType() == 0) { //图片 refreshPhotoData(exploreWay); } else if (exploreWay.getFileType() == 1) { //视频 @@ -404,13 +407,17 @@ public class TanluCardViewFragment extends MvpFragment> * 注册listener监听 */ private void initListener() { + Logger.d(TAG, " initListener ------> "); //某某路堵不堵,某某地点堵不堵,附近堵不堵,播放路况 TODO //唤醒 - mogoIntentManager.registerIntentListener(MogoReceiver.ADAS_ACTION, mogoIntentListener); + mogoIntentManager.registerIntentListener(TanluConstants.UPLOAD_ROAD_CONDITION, mogoIntentListener); + mogoIntentManager.registerIntentListener(TanluConstants.SPECIFIEDROAD_SEARCH, mogoIntentListener); + mogoIntentManager.registerIntentListener(TanluConstants.NEARBYROAD_SEARCH, mogoIntentListener); //免唤醒 - AIAssist.getInstance(getActivity()).registerUnWakeupCommandCallback(TanluConstants.UPLOAD_ROAD_CONDITION, mogoVoiceListener); +// AIAssist.getInstance(getActivity()).registerUnWakeupCommandCallback(TanluConstants.UPLOAD_ROAD_CONDITION, mogoVoiceListener); } + /** * 唤醒语音 */ @@ -419,10 +426,41 @@ public class TanluCardViewFragment extends MvpFragment> 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)) { //地点堵不堵 + if (!isCurrentPage) { + //切换探路卡片 + iMogoCardManager.switch2(TanluConstants.MODEL_NAME); + } + + try { + JSONObject jsonObject = new JSONObject(data); + mKeywords = jsonObject.get("location").toString(); + Logger.d(TAG, "mogoIntentListener specified mKeywords = " + mKeywords); + handleActionFoo(mKeywords); + } catch (Exception e) { + e.printStackTrace(); + } + } else if (intentStr.equals(TanluConstants.NEARBYROAD_SEARCH)) { //附近 + if (!isCurrentPage) { + //切换探路卡片 + iMogoCardManager.switch2(TanluConstants.MODEL_NAME); + } + + try { + JSONObject jsonObject = new JSONObject(data); + mKeywords = jsonObject.get("location").toString(); + Logger.d(TAG, "mogoIntentListener nearby mKeywords = " + mKeywords); + handleActionFoo(mKeywords); + } catch (Exception e) { + e.printStackTrace(); + } + } else if (intentStr.equals(TanluConstants.UPLOAD_ROAD_CONDITION)) { //上报路况 + sendShareReceiver("1"); + +// } else if (intentStr.equals()) { // + + } - JsonObject jsonObject = new JsonObject(); - mKeywords = jsonObject.get("location").toString(); - handleActionFoo(mKeywords); } }; @@ -435,8 +473,7 @@ public class TanluCardViewFragment extends MvpFragment> public void onCmdSelected(String cmd) { Logger.e(TAG, "免唤醒 onCmdSelected mogoVoiceListener cmd =" + cmd); if (cmd.equals(TanluConstants.UPLOAD_ROAD_CONDITION)) { - // - Logger.d(TAG, ""); + sendShareReceiver("1"); } } @@ -476,30 +513,6 @@ public class TanluCardViewFragment extends MvpFragment> } - /** - * 处理路线数据信息,msgType - */ - private void handleRoadLineMessage() { -// mMogoSocketManager = (IMogoSocketManager) ARouter.getInstance().build(MogoServicePaths.PATH_SOCKET_MANAGER).navigation(); -// mMogoSocketManager.registerOnMessageListener(401005, new IMogoOnMessageListener() { -// @Override -// public Class target() { -// return MarkerResponse.class; -// } -// -// @Override -// public void onMsgReceived(MarkerResponse obj) { -// Logger.e(TAG, "handleRoadLineMessage onMsgReceived obj= " + obj); -// } -// }); - - - //TODO 广播类型判断 -// getNavigationLineData(); -// getRoadLineData(); - - } - /** * @param view */ @@ -612,6 +625,7 @@ public class TanluCardViewFragment extends MvpFragment> simpleCoverVideoPlayer.setVisibility(View.VISIBLE); //视频配置 mVideoUrl = videoUrl; + simpleCoverVideoPlayer.loadCoverImage(mImageUrl, getContext()); gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag(TAG) .build(simpleCoverVideoPlayer); if (mImageUrl == null) { @@ -670,6 +684,7 @@ public class TanluCardViewFragment extends MvpFragment> */ @Override public void onPerform() { + isCurrentPage = true; Logger.d(TAG, "tanlu卡片 onPerform 有效 ---->"); mMarkerManager = mMogoMapService.getMarkerManager(getActivity()); List markers = mMarkerManager.getMarkers(TanluConstants.MODEL_NAME); @@ -715,6 +730,7 @@ public class TanluCardViewFragment extends MvpFragment> @Override public void onDisable() { Logger.d(TAG, "tanlu卡片 无效 ----->"); + isCurrentPage = false; } @Override @@ -754,11 +770,6 @@ public class TanluCardViewFragment extends MvpFragment> @Override public void onLocationChanged(MogoLocation location) { -// if (location.getErrCode() == 0) { -// Logger.d(TAG, "onLocationChanged 当前位置 -->" + location.getAddress()); -// } else { -// Logger.d(TAG, "onLocationChanged 定位失败 -->" + location.getErrInfo()); -// } } @Override @@ -788,6 +799,7 @@ public class TanluCardViewFragment extends MvpFragment> getViewLifecycleOwner().getLifecycle().removeObserver(mPresenter); TanluServiceHandler.getLocationClient().removeLocationListener(this); mMogoRegisterCenter.unregisterMogoNaviListener(TanluConstants.MODEL_NAME); + mogoIntentManager.unregisterIntentListener(MogoReceiver.ADAS_ACTION); } /** @@ -822,8 +834,8 @@ public class TanluCardViewFragment extends MvpFragment> .longitude(event.lon); IMogoMarker marker = mMarkerManager.addMarker("share_tag", options); - //TODO 请求分享接口 + } @Override @@ -833,6 +845,22 @@ public class TanluCardViewFragment extends MvpFragment> }); } + /** + * push 类型,1为导航数据,2为通勤族 + * + * @param event + */ + @Subscribe(threadMode = ThreadMode.MAIN) + public void onPushInfo(final PushTypeInfo event) { + Logger.d(TAG, "onPushInfo ----event.type =" + event.type); + if (event.type.equals("1")) { + getNaviRoadLineInfo(); + } else if (event.type.equals("2")) { + getRoadLineData(); + } + } + + /** * 导航路线数据事件 */ @@ -900,7 +928,7 @@ public class TanluCardViewFragment extends MvpFragment> } /** - * 绘制线路 + * 绘制线路 TODO */ private void drawMapLine(List
pointList) { int intervalNum = Utils.getIntervalValue(pointList.size()); @@ -929,12 +957,12 @@ public class TanluCardViewFragment extends MvpFragment> mTanluModelData.getVoiceControlRoadData(keywords, cityCode, lon, lat, adCode, new VoiceSearchCallback() { @Override public void onSuccess(VoiceSearchResult o) { - String discription = o.getDescription(); - Logger.d(TAG, "getVoiceControlRoadData discription = " + discription); - if (o.getInformations() != null && o.getInformations().size() > 0) { - speakSuccessVoice(o.getInformations(), discription == null ? "" : discription); + String discription = o.getResult().getDescription(); + Logger.d(TAG, "getVoiceControlRoadData discription = " + discription); + if (o.getResult().getInformations() != null && o.getResult().getInformations().size() > 0) { + speakSuccessVoice(o.getResult().getInformations(), discription == null ? "" : discription); - List informationList = o.getInformations(); + List informationList = o.getResult().getInformations(); //移动 MogoLatLng latLng = new MogoLatLng(lat, lon); mMApUIController.moveToCenter(latLng); @@ -952,7 +980,6 @@ public class TanluCardViewFragment extends MvpFragment> } else if (informationList.get(i).type == 1) { //视频 } - MogoMarkerOptions options = new MogoMarkerOptions() .icon(multiMarkerIcon) .latitude(informationList.get(i).lat) @@ -961,11 +988,9 @@ public class TanluCardViewFragment extends MvpFragment> optionList.add(options); } - + Logger.d(TAG, "getVoiceControlRoadData optionList.size() = " + optionList.size()); mMarkerManager.addMarkers(TanluConstants.MODEL_NAME, optionList, true); //直接使用当前数据list,作为切换的数据源 - - } else { if (!TextUtils.isEmpty(discription)) { AIAssist.getInstance(getContext()).speakTTSVoice(discription, null); @@ -973,7 +998,6 @@ public class TanluCardViewFragment extends MvpFragment> AIAssist.getInstance(getContext()).speakTTSVoice("未找到其他车主分享的路况信息", null); } } - } @Override diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/Sns.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/Sns.kt index f075745c2b..2ea9c8ebe7 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/Sns.kt +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/Sns.kt @@ -5,9 +5,13 @@ class Sns { var sns: List var localUserId: String + var localNickName: String + var localHeadImgUrl: String - constructor(sns: List, localUserId: String) { + constructor(sns: List, localUserId: String, localNickName: String, localHeadImgUrl: String) { this.sns = sns this.localUserId = localUserId + this.localNickName = localNickName + this.localHeadImgUrl = localHeadImgUrl } } \ No newline at end of file diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/VoiceSearchResult.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/VoiceSearchResult.java index a4ed3c5f26..086957fc6b 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/VoiceSearchResult.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/VoiceSearchResult.java @@ -9,31 +9,45 @@ import java.util.List; * @since 2020-01-08 */ public class VoiceSearchResult extends BaseData { - private List informations; - private String description; - private Sns snResult; - public List getInformations() { - return informations; + private Result result; + + public Result getResult() { + return result; } - public void setInformations(List informations) { - this.informations = informations; + public void setResult(Result result) { + this.result = result; } - public String getDescription() { - return description; + public static class Result { + private List informations; + private String description; + private Sns snResult; + + public List getInformations() { + return informations; + } + + public void setInformations(List informations) { + this.informations = informations; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Sns getSnResult() { + return snResult; + } + + public void setSnResult(Sns snResult) { + this.snResult = snResult; + } } - public void setDescription(String description) { - this.description = description; - } - - public Sns getSnResult() { - return snResult; - } - - public void setSnResult(Sns snResult) { - this.snResult = snResult; - } } diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/event/PushTypeInfo.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/event/PushTypeInfo.java new file mode 100644 index 0000000000..52c23ebdda --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/event/PushTypeInfo.java @@ -0,0 +1,17 @@ +package com.mogo.module.tanlu.model.event; + +import java.io.Serializable; + +/** + * @author lixiaopeng + * @description push区分类别 + * @since 2020-01-08 + */ +public class PushTypeInfo implements Serializable { + public String type; + + public PushTypeInfo(String type) { + this.type = type; + } + +} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/receiver/PushReceiver.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/receiver/PushReceiver.kt new file mode 100644 index 0000000000..731f251884 --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/receiver/PushReceiver.kt @@ -0,0 +1,22 @@ +package com.mogo.module.tanlu.receiver + +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import android.util.Log +import com.mogo.module.tanlu.model.event.PushTypeInfo +import com.mogo.module.tanlu.model.event.VoiceRoadInfo +import org.greenrobot.eventbus.EventBus + +/** + * 导航和通勤族 push的action + */ +class PushReceiver : BroadcastReceiver() { + override fun onReceive(context: Context, intent: Intent) { + if (intent.action == "com.zhidao.roadcondition.split"){ + var type = intent.getStringExtra("type") + Log.d("PushReceiver", "type = $type") + EventBus.getDefault().post(PushTypeInfo(type)) + } + } +} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/video/SimpleCoverVideoPlayer.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/video/SimpleCoverVideoPlayer.kt index 8643ae7cfd..a27b37a2e1 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/video/SimpleCoverVideoPlayer.kt +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/video/SimpleCoverVideoPlayer.kt @@ -56,12 +56,11 @@ class SimpleCoverVideoPlayer : StandardGSYVideoPlayer { } } -// fun loadCoverImage(url: String, mContext: Context) { -// Glide.with(mContext.applicationContext) -// .load(url) -// .error(R.color.color_303447) -// .into(coverImage) -// } + fun loadCoverImage(url: String, mContext: Context) { + Glide.with(mContext.applicationContext) + .load(url) + .into(coverImage) + } override fun updateStartImage() { when (mCurrentState) { diff --git a/modules/mogo-module-tanlu/src/main/res/drawable/shape_bg_222533.xml b/modules/mogo-module-tanlu/src/main/res/drawable/shape_bg_222533.xml index 12b869a5ff..1776be8082 100644 --- a/modules/mogo-module-tanlu/src/main/res/drawable/shape_bg_222533.xml +++ b/modules/mogo-module-tanlu/src/main/res/drawable/shape_bg_222533.xml @@ -1,5 +1,7 @@ - - + + + \ No newline at end of file diff --git a/modules/mogo-module-tanlu/src/main/res/drawable/tanlu_gradual_change_bg.xml b/modules/mogo-module-tanlu/src/main/res/drawable/tanlu_gradual_change_bg.xml new file mode 100644 index 0000000000..6f95f6d2e9 --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/res/drawable/tanlu_gradual_change_bg.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-tanlu/src/main/res/layout/tanlu_item_main_media_recycler.xml b/modules/mogo-module-tanlu/src/main/res/layout/tanlu_item_main_media_recycler.xml index 913bfc2e39..58760e81e0 100644 --- a/modules/mogo-module-tanlu/src/main/res/layout/tanlu_item_main_media_recycler.xml +++ b/modules/mogo-module-tanlu/src/main/res/layout/tanlu_item_main_media_recycler.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="@dimen/dp_660" android:layout_height="@dimen/dp_660" - android:background="@drawable/shape_bg_222533_10px"> + android:background="@drawable/tanlu_gradual_change_bg"> @@ -52,9 +52,9 @@ android:layout_below="@+id/tv_information_media_content" android:layout_alignParentRight="true" android:layout_centerVertical="true" - android:layout_marginRight="@dimen/dp_32" + android:layout_marginRight="@dimen/dp_24" android:text="2019-10-10" - android:textColor="@color/color_999999" + android:textColor="@color/color_99FFFFFF" android:textSize="@dimen/dp_26" /> @@ -64,8 +64,8 @@ android:layout_width="@dimen/dp_596" android:layout_height="@dimen/dp_355" android:layout_below="@+id/layout_top_view" - android:layout_marginLeft="@dimen/dp_32" - android:layout_marginRight="@dimen/dp_32" + android:layout_marginLeft="@dimen/dp_24" + android:layout_marginRight="@dimen/dp_24" android:background="@drawable/shape_bg_222533_9px"> + android:layout_marginTop="@dimen/dp_30" + android:layout_marginLeft="@dimen/dp_24" + android:layout_marginRight="@dimen/dp_24"> + android:textColor="@color/white" + android:textSize="@dimen/dp_28" /> + android:textColor="@color/white" + android:textSize="@dimen/dp_28" /> @@ -126,17 +125,17 @@ + android:visibility="visible"> + android:textSize="@dimen/dp_34" /> \ No newline at end of file diff --git a/modules/mogo-module-tanlu/src/main/res/values/colors.xml b/modules/mogo-module-tanlu/src/main/res/values/colors.xml index 6c0dd2590f..78aa080e47 100644 --- a/modules/mogo-module-tanlu/src/main/res/values/colors.xml +++ b/modules/mogo-module-tanlu/src/main/res/values/colors.xml @@ -34,7 +34,9 @@ #DADAE2 #545362 #99191C25 - #666666 + #99666666 #999999 + #99FFFFFF + #59FFFFFF diff --git a/modules/mogo-module-tanlu/src/main/res/values/strings.xml b/modules/mogo-module-tanlu/src/main/res/values/strings.xml index b6fc8a1bd9..4640762de5 100644 --- a/modules/mogo-module-tanlu/src/main/res/values/strings.xml +++ b/modules/mogo-module-tanlu/src/main/res/values/strings.xml @@ -6,7 +6,7 @@ 已同意 探路共享计划 >> 探路APP用户服务协议 - 未找到其他用户分享的路况,
您可以试试上报路况]]>
+ 未找到其他用户分享的路况,
您可以试试上报路况]]>
未知区域 上报路况 正在更新情报数据