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

This commit is contained in:
董宏宇
2020-11-03 17:48:17 +08:00
24 changed files with 112 additions and 62 deletions

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
import com.mogo.map.MogoLatLng;
import com.mogo.service.IMogoServiceApis;
@@ -165,6 +166,8 @@ public class SchemeIntent implements IMogoStatusChangedListener {
if ( mApis == null ) {
return;
}
Log.d("TanluManager", "handleSearchRoadCondition intentStr =" + target.getQueryParameter( "intentStr" ) + ">> data = " + target.getQueryParameter( "data" )
+ "-----city = " + target.getQueryParameter( "city" ) + "----keywords = " + target.getQueryParameter( "keywords" ));
mApis.getTanluUiApi().searchRoadCondition( target.getQueryParameter( "intentStr" ),
target.getQueryParameter( "data" ), target.getQueryParameter( "city" ),
target.getQueryParameter( "keywords" ) );

View File

@@ -25,9 +25,6 @@ class StrategyShareProvider : IProvider {
private lateinit var blockStrategy: BlockStrategy
override fun init(context: Context) {
TanluServiceManager.init(context)
TanluManager.getInstance(context).init()
Logger.d(S_TAG, "策略上报Provider初始化====")
val apis = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context) as IMogoServiceApis
blockStrategy = BlockStrategy(context, apis)

View File

@@ -0,0 +1,64 @@
package com.mogo.module.share;
import android.content.Context;
import android.content.Intent;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.map.MogoLatLng;
import com.mogo.module.share.bean.event.MarkerInfo;
import com.mogo.module.share.constant.ShareConstants;
import com.mogo.service.share.IMogoTanluUiProvider;
import com.mogo.utils.logger.Logger;
import org.greenrobot.eventbus.EventBus;
import io.reactivex.Single;
import io.reactivex.SingleOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
/**
* @author congtaowang
* @since 2019-12-24
* <p>
* 描述
*/
@Route( path = ShareConstants.TAG )
public class TanluCardViewProvider implements IMogoTanluUiProvider {
private static final String TAG = "TanluCardViewProvider";
private Context mContext;
@Override
public void init( Context context ) {
mContext = context;
TanluServiceManager.init(context);
TanluManager.getInstance(context).init();
}
@Override
public void searchRoadCondition(String intentStr, String data, String city, String keywords) {
Disposable disposable = Single.create((SingleOnSubscribe<Intent>) emitter -> {
Logger.d(TAG, "searchRoadCondition---> intentStr: " + intentStr + " data: " + data + " " +
"city: " + city + " keywords: " + keywords);
Intent intent = new Intent(intentStr);
intent.putExtra("data", data);
intent.putExtra("city", city);
intent.putExtra("keywords", keywords);
Thread.sleep(3000);
emitter.onSuccess(intent);
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(intent -> {
Logger.d(TAG, "searchRoadCondition---go real share");
TanluManager.getInstance(mContext).realShare(intentStr, intent);
});
}
@Override
public void shareSuccess(String poiType, MogoLatLng location) {
MarkerInfo markerInfo = new MarkerInfo(poiType, "", location.lon, location.lat, true, "1");
EventBus.getDefault().post(markerInfo);
}
}

View File

@@ -62,12 +62,6 @@ import java.util.List;
import java.util.Map;
import java.util.Random;
import io.reactivex.Single;
import io.reactivex.SingleOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import static com.mogo.module.share.constant.ShareConstants.SPECIFIEDROAD_SEARCH;
import static com.mogo.module.share.constant.ShareConstants.TXZ_SPECIFIEDROAD_SEARCH;
import static com.mogo.module.share.constant.ShareConstants.TYPE_NAME_BLOCK;
@@ -82,6 +76,7 @@ import static com.mogo.module.share.constant.ShareConstants.VOICE_COMMAND_QUERY_
* @description 探路和新鲜事的view
* @since 2020/5/19
*/
public class TanluManager implements IMogoMarkerClickListener,
IMogoPoiSearchListener,
IMogoGeoSearchListener {
@@ -139,27 +134,33 @@ public class TanluManager implements IMogoMarkerClickListener,
initListener();
}
// @Override
// public void init(Context context) {
//
// }
public void searchRoadCondition(String intentStr, String data, String city, String keywords) {
Disposable disposable = Single.create((SingleOnSubscribe<Intent>) emitter -> {
Logger.d(TAG, "searchRoadCondition---> intentStr: " + intentStr + " data: " + data + " " +
"city: " + city + " keywords: " + keywords);
Intent intent = new Intent(intentStr);
intent.putExtra("data", data);
intent.putExtra("city", city);
intent.putExtra("keywords", keywords);
Thread.sleep(3000);
emitter.onSuccess(intent);
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(intent -> {
Logger.d(TAG, "searchRoadCondition---go real share");
realShare(intentStr, intent);
});
}
public void shareSuccess(String poiType, MogoLatLng location) {
MarkerInfo markerInfo = new MarkerInfo(poiType, "", location.lon, location.lat, true, "1");
EventBus.getDefault().post(markerInfo);
}
// @Override
// public void searchRoadCondition(String intentStr, String data, String city, String keywords) {
// Disposable disposable = Single.create((SingleOnSubscribe<Intent>) emitter -> {
// Logger.d(TAG, "searchRoadCondition---> intentStr: " + intentStr + " data: " + data + " " +
// "city: " + city + " keywords: " + keywords);
// Intent intent = new Intent(intentStr);
// intent.putExtra("data", data);
// intent.putExtra("city", city);
// intent.putExtra("keywords", keywords);
// Thread.sleep(3000);
// emitter.onSuccess(intent);
// }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(intent -> {
// Logger.d(TAG, "searchRoadCondition---go real share");
// realShare(intentStr, intent);
// });
// }
//
// @Override
// public void shareSuccess(String poiType, MogoLatLng location) {
// MarkerInfo markerInfo = new MarkerInfo(poiType, "", location.lon, location.lat, true, "1");
// EventBus.getDefault().post(markerInfo);
// }
private void initInterface() {
//地图marker地图操作

View File

@@ -65,19 +65,6 @@ public class ShareConstants {
public static final String UNWAKE_UPLOAD_ROAD_ICY = "command_upload_road_icy";
public static final String UNWAKE_UPLOAD_DENSE_FOG = "command_upload_dense_fog";
public static final String UNWAKE_UPLOAD_ROAD_CONSTRUCTION = "command_upload_road_construction";
public static final String[] CMD_UPLOAD_BLOCK = {"上报拥堵"};
public static final String[] CMD_TRAFFIC_CHECK = {"上报交通检查"};
public static final String[] CMD_ROAD_CLOSURE = {"上报封路"};
public static final String[] CMD_UPLOAD_ACCIDENT = {"上报事故", "上报交通事故"};
public static final String[] UPLOAD_REAL_TIME_TRAFFIC = {"上报实时路况", "上报路况"};
public static final String[] UPLOAD_SEEK_HELP = {"故障求助", "发起故障求助"};
public static final String[] UPLOAD_STAGNANT_WATER = {"上报积水"};
public static final String[] UPLOAD_ROAD_ICY = {"上报积冰", "上报道路积冰", "上报结冰", "上报道路结冰"};
public static final String[] UPLOAD_DENSE_FOG = {"上报大雾", "上报浓雾"};
public static final String[] UPLOAD_ROAD_CONSTRUCTION = {"上报施工", "上报道路施工"};
public static final String[] CMD_CANCEL_SHARE = {"取消分享"};
public static final String UNWAKE_CANCEL_SHARE = "com.zhidao.launcher.cancle.share";
/**
@@ -151,7 +138,6 @@ public class ShareConstants {
public static final String TANLU_ROAD_CLOSURE_COMPAT = "10003"; //封路,适配语音不做数值转换
public static final String TANLU_ROAD_CURRENT = "10015"; //实时路况
// 道路事件名称,用于语音识别区分道路事件
public static final String TYPE_NAME_BLOCK = "拥堵";
public static final String TYPE_NAME_TRAFFIC_CHECK = "交通检查";
@@ -163,7 +149,6 @@ public class ShareConstants {
public static final String TYPE_NAME_DENSE_FOG = "";
public static final String TYPE_NAME_ROAD_CONSTRUCTION = "施工";
// 同行者 xx堵不堵 唤醒
public static final String TXZ_SPECIFIEDROAD_SEARCH = "com.zhidao.roadcondition.roadinfo";

View File

@@ -16,9 +16,9 @@ import com.mogo.module.share.manager.UploadHelper
import com.mogo.service.IMogoServiceApis
import com.mogo.service.MogoServicePaths
import com.mogo.service.analytics.IMogoAnalytics
import com.mogo.service.statusmanager.IMogoStatusManager
import com.mogo.service.share.IMogoTanluProvider
import com.mogo.service.share.TanluUploadParams
import com.mogo.service.statusmanager.IMogoStatusManager
import com.mogo.utils.logger.Logger
import kotlin.random.Random

View File

@@ -1,7 +1,6 @@
package com.mogo.module.share.manager
import android.content.Context
import android.util.Log
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.service.IMogoServiceApis
import com.mogo.service.MogoServicePaths

View File

@@ -47,7 +47,8 @@ object UploadHelper {
// 有网就正常上报
ServiceApisManager.serviceApis.statusManagerApi.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true)
// 上报即成功
TanluManager.getInstance(context).shareSuccess(type.eventType, type.location)
// TanluManager.getInstance(context).shareSuccess(type.eventType, type.location)
ServiceApisManager.serviceApis.tanluUiApi.shareSuccess(type.eventType, type.location)
val location = ServiceApisManager.serviceApis.mapServiceApi.getSingletonLocationClient(context).lastKnowLocation
val latLon = MogoLatLng(location.latitude, location.longitude)
type.location = latLon

View File

@@ -6,8 +6,6 @@
<string name="voice_get_informations_tts">为您找到%s条路况信息</string>
<string name="tanlu_share_success">已分享成功,你分享的内容将帮助%s位车友</string>
<string name="tanlu_share_failed">上传失败</string>
<string name="tanlu_upload_roadcondition">上报路况</string>
<string name="tanlu_cancle_time">取消(%s</string>
<string name="tanlu_neterror_cancle_time">好的(%s</string>

View File

@@ -11,8 +11,6 @@ import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.scenario.impl.AbsV2XScenario;
import com.mogo.module.v2x.scenario.scene.animation.V2XAnimationWindow;
import com.mogo.module.v2x.scenario.view.IV2XWindow;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.windowview.IMogoTopViewStatusListener;
@@ -132,6 +130,6 @@ public class V2XRoadVideoCarScenario extends AbsV2XScenario<V2XEventShowEntity>
@Override
public void beforeViewRemoveAnim(View view) {
Log.d(TAG, "beforeViewRemoveAnim");
closeWindow();
( (V2XRoadVideoWindow)getV2XWindow()).pauseVideo();
}
}

View File

@@ -19,6 +19,7 @@ import com.mogo.module.v2x.listener.V2XWindowStatusListener;
import com.mogo.module.v2x.scenario.view.IV2XWindow;
import com.mogo.module.v2x.view.SimpleCoverVideoPlayer;
import com.mogo.utils.BitmapHelper;
import com.shuyu.gsyvideoplayer.GSYVideoManager;
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack;
import com.shuyu.gsyvideoplayer.utils.GSYVideoType;
@@ -99,6 +100,7 @@ public class V2XRoadVideoWindow extends RelativeLayout implements
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag(TAG)
.build(simpleCoverVideoPlayer);
simpleCoverVideoPlayer.getStartButton().performClick();
GSYVideoManager.instance().setNeedMute(true);
thumbnailImage.setVisibility(View.GONE);
playImageView.setVisibility(View.GONE);
}
@@ -260,14 +262,14 @@ public class V2XRoadVideoWindow extends RelativeLayout implements
@Override
public void close() {
pushVideo();
pauseVideo();
//移除窗体
V2XServiceManager
.getMogoTopViewManager()
.removeViewNoLinkage(this);
}
void pushVideo() {
public void pauseVideo() {
if (simpleCoverVideoPlayer != null) {
simpleCoverVideoPlayer.onVideoPause();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -30,17 +30,18 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:layout_alignTop="@+id/road_case_style"
android:paddingRight="@dimen/dp_28"
android:text="100"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_34" />
android:textSize="@dimen/dp_26" />
<com.mogo.module.v2x.view.HeartUnLikeView
<ImageView
android:id="@+id/road_case_useless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_alignTop="@+id/road_case_style"
android:src="@drawable/v2x_share_item_unlike"
android:layout_toLeftOf="@id/road_case_useless_num"
android:clickable="false"
android:gravity="center"
@@ -50,19 +51,20 @@
android:id="@+id/road_case_useful_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_alignTop="@+id/road_case_style"
android:layout_toLeftOf="@id/road_case_useless"
android:gravity="left"
android:paddingRight="@dimen/dp_28"
android:text="100"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_34" />
android:textSize="@dimen/dp_26" />
<com.mogo.module.v2x.view.HeartLikeView
<ImageView
android:id="@+id/road_case_uselful"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/v2x_share_item_like"
android:layout_alignTop="@+id/road_case_style"
android:layout_toLeftOf="@id/road_case_useful_num"
android:clickable="false"
android:paddingRight="5px" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB