diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/glide/GlideBlurTransformation.java b/foudations/mogo-utils/src/main/java/com/mogo/utils/glide/GlideBlurTransformation.java index d8f753a4c9..9ee136f036 100644 --- a/foudations/mogo-utils/src/main/java/com/mogo/utils/glide/GlideBlurTransformation.java +++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/glide/GlideBlurTransformation.java @@ -11,6 +11,7 @@ import androidx.annotation.NonNull; import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool; import com.bumptech.glide.load.resource.bitmap.CenterCrop; +import com.mogo.utils.logger.Logger; /** * 使用Glide加载图片时,使该图片进行高斯模糊 @@ -20,23 +21,32 @@ import com.bumptech.glide.load.resource.bitmap.CenterCrop; */ public class GlideBlurTransformation extends CenterCrop { private static final float DEFAULT_BLUR_RADIUS = 25F; + private static final float DEFAULT_OUT_WIDTH_SCALE = 0.5F; private Context context; private float blurRadius; + private float outScale; public GlideBlurTransformation(Context context) { this(context, DEFAULT_BLUR_RADIUS); } public GlideBlurTransformation(Context context, float blurRadius) { + this(context, blurRadius, DEFAULT_OUT_WIDTH_SCALE); + } + + public GlideBlurTransformation(Context context, float blurRadius, float outWidthScale) { this.context = context; this.blurRadius = blurRadius; + this.outScale = outWidthScale; } @Override protected Bitmap transform(@NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) { Bitmap bitmap = super.transform(pool, toTransform, outWidth, outHeight); - return blurBitmap(bitmap, blurRadius, (int) (outWidth * 0.5), (int) (outHeight * 0.5)); + Logger.d("GlideBlurTransformation", "transform=== blurRadius: " + blurRadius + " " + + "outScale: " + outScale); + return blurBitmap(bitmap, blurRadius, (int) (outWidth * outScale), (int) (outHeight * outScale)); } private Bitmap blurBitmap(Bitmap bitmap, float blurRadius, int outWidth, int outHeight) { diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerUserInfo.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerUserInfo.java index ec6271c154..8f297b2c43 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerUserInfo.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerUserInfo.java @@ -82,6 +82,9 @@ public class MarkerUserInfo implements Serializable { } public String getGender() { + if (TextUtils.isEmpty(gender)) { + return "未知"; + } return gender; } 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 35444c8bec..18c482a475 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 @@ -38,4 +38,8 @@ public class TanluConstants { //分享/上报按钮点击 from=1 手动点击 from=2 语音打开 public static final String LAUNCHER_SHARE_CLICK = "Launcher_Share_Click"; public static final String CARNET_USER_UPLOAD = "CarNet_user_upload"; + + //语音搜索 + public static final String CARNET_VOICE_SEARCH = "CarNet_Voice_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 88072178a0..1a3fa6b377 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 @@ -399,6 +399,7 @@ public class TanluCardViewFragment extends MvpFragment> private void handleMarkerExploreWay(MarkerExploreWay markerExploreWay) { if (markerExploreWay != null) { + Log.d(TAG, "markerExploreWay.getFileType() =" + markerExploreWay.getFileType()); if (markerExploreWay.getFileType() == 0) { //图片 refreshPhotoData(markerExploreWay); } else if (markerExploreWay.getFileType() == 1) { //视频 @@ -571,7 +572,6 @@ public class TanluCardViewFragment extends MvpFragment> //判断是图片还是视频,第一个时,上一个不可点击 Log.e(TAG, " tv_previous_res --1-> currentPosition = " + currentPosition + " >> size= " + markerExploreWayList.size()); if (currentPosition < 0) { -// return; currentPosition = markerExploreWayList.size(); } currentPosition--; @@ -583,7 +583,6 @@ public class TanluCardViewFragment extends MvpFragment> //判断是图片还是视频,最后一个时,下一个不可点击 Log.e(TAG, " tv_next_res --1-> currentPosition = " + currentPosition + " >> size= " + markerExploreWayList.size()); if (currentPosition >= markerExploreWayList.size()) { -// return; currentPosition = 0; } currentPosition++; @@ -603,9 +602,10 @@ public class TanluCardViewFragment extends MvpFragment> autoZoomInImageView.post(new Runnable() { @Override public void run() { - //放大增量是0.3,放大时间是1000毫秒,放大开始时间是600毫秒以后 + Log.d(TAG, "handleImageAnimation run -------->"); + //放大增量是0.3,放大时间是1000毫秒,放大开始时间是500毫秒以后 autoZoomInImageView.init() - .startZoomInByScaleDeltaAndDuration(0.2f, 1000, 500); + .startZoomInByScaleDeltaAndDuration(0.2f, 1000, 300); } }); } @@ -685,16 +685,18 @@ public class TanluCardViewFragment extends MvpFragment> mDistanceTv.setText(handleDistance(markerExploreWay.getDistance())); mTimeTv.setText(formatDate(markerExploreWay.getGenerateTime())); String thumbnailUrl = markerExploreWay.getItems().get(0).getUrl(); - Logger.d(TAG, "refreshPhotoData thumbnailUrl ------>" + thumbnailUrl); + Logger.d(TAG, "refreshPhoto thumbnailUrl ------>" + thumbnailUrl); autoZoomInImageView.setVisibility(View.VISIBLE); simpleCoverVideoPlayer.setVisibility(View.GONE); mogoImageloader.downloadImage(getActivity(), thumbnailUrl, new IMogoImageLoaderListener() { @Override public void onStart() { + Log.d(TAG, "onStart ------>"); } @Override public void onCompleted(Bitmap bitmap) { + Log.d(TAG, "onCompleted ------>bitmap = " + bitmap); autoZoomInImageView.setImageBitmap(bitmap); //动画 handleImageAnimation(); @@ -702,7 +704,7 @@ public class TanluCardViewFragment extends MvpFragment> @Override public void onFailure(Exception e) { - Logger.e(TAG, "onFailure ------>" + e); + Log.e(TAG, "onFailure ------>" + e); } }); } @@ -715,7 +717,6 @@ public class TanluCardViewFragment extends MvpFragment> } /** - * * C位事件,如何获取数据,需要有默认数据 * 如果只有一个数据,不显示上下切换按钮,没有数据显示空页面 */ @@ -848,14 +849,14 @@ public class TanluCardViewFragment extends MvpFragment> /** * 接收到分享对应数据打点 * - * @param event TODO + * @param event */ @Subscribe(threadMode = ThreadMode.MAIN) public void onMarkerInfo(final MarkerInfo event) { if (event == null) { return; } - Log.d(TAG, "onMarkerInfo event.type =" + event.type + " >>event.lat = " + event.lat + " >>event.lon = " + event.lon + " >>event.imageUrl =" + event.imageUrl); + Log.d(TAG, "onMarkerInfo event.type =" + event.type + " >>event.lat = " + event.lat + " >>event.lon = " + event.lon + " >>event.imageUrl =" + event.imageUrl); String poiType = ""; if (event.type.equals("1")) { //上报路况 @@ -940,7 +941,7 @@ public class TanluCardViewFragment extends MvpFragment> /** - * 导航路线数据事件 + * 导航路线数据事件 TODO */ public void getNavigationLineData() { Double lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude(); @@ -1037,13 +1038,15 @@ public class TanluCardViewFragment extends MvpFragment> public void getVoiceControlRoadData(String keywords, final double lat, final double lon) { String adCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getAdCode(); String cityCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getCityCode(); - //移动到具体位置 mMogoStatusManager.setUserInteractionStatus(TanluConstants.MODEL_NAME, true, true); MogoLatLng latLng = new MogoLatLng(lat, lon); mMApUIController.moveToCenter(latLng); - Logger.d(TAG, "getVoiceControlRoadData lat =" + lat + ">>>lon =" + lon + ">>>cityCode= " + cityCode + " >>>adCode = " + adCode); + inputlon = lon; + inputlat = lat; + + Log.d(TAG, "getVoiceControlRoadData lat =" + lat + ">>>lon =" + lon + ">>>cityCode= " + cityCode + " >>>adCode = " + adCode); mTanluModelData.getVoiceControlRoadData(keywords, cityCode, lon, lat, adCode, new VoiceSearchCallback() { @Override public void onSuccess(VoiceSearchResult o) { @@ -1056,7 +1059,6 @@ public class TanluCardViewFragment extends MvpFragment> //转换数据结构 convertData(o.getResult().getInformations()); - //切换到探路卡片 if (!isCurrentPage) { iMogoCardManager.switch2(TanluConstants.MODEL_NAME); @@ -1067,6 +1069,9 @@ public class TanluCardViewFragment extends MvpFragment> List informationList = o.getResult().getInformations(); //清除探路之前的数据 mMarkerManager.removeMarkers(TanluConstants.MODEL_NAME); + //添加埋点数据 + datalon = informationList.get(0).lon; + datalat = informationList.get(0).lat; //打点 ArrayList optionList = new ArrayList<>(); @@ -1078,7 +1083,7 @@ public class TanluCardViewFragment extends MvpFragment> } else if (trafficType.equals("car_checking")) { //查车 multiMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_traffic_check); } else if (trafficType.equals("0")) { - multiMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_traffic_check); + multiMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_block_up); } else if (trafficType.equals("traffic_control")) { multiMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_road_closure); } @@ -1090,7 +1095,7 @@ public class TanluCardViewFragment extends MvpFragment> .longitude(informationList.get(i).lon); optionList.add(options); - Log.e(TAG, "lat =" + informationList.get(i).lat + ">>>lon =" + informationList.get(i).lon); + Log.d(TAG, "lat =" + informationList.get(i).lat + ">>>lon =" + informationList.get(i).lon); } Logger.d(TAG, "getVoiceControlRoadData optionList.size() = " + optionList.size()); mMarkerManager.addMarkers(TanluConstants.MODEL_NAME, optionList, true); @@ -1128,7 +1133,7 @@ public class TanluCardViewFragment extends MvpFragment> markerExploreWayList.add(markerExploreWay); } - Log.e(TAG, "convertData markerExploreWayList.size() =" + markerExploreWayList.size()); + Log.d(TAG, "convertData markerExploreWayList.size() =" + markerExploreWayList.size()); } /** @@ -1230,9 +1235,22 @@ public class TanluCardViewFragment extends MvpFragment> AIAssist.getInstance(getContext()).speakTTSVoice(searchingVoiceStrings[random.nextInt(3)], null); } - //上报语音搜索 TODO - private void trackVoiceSearch(int type) { + Double inputlon = 0.0;//经度 + Double inputlat = 0.0; //维度 + Double datalon = 0.0; //经度 + Double datalat = 0.0; //维度 + + //上报语音搜索 + private void trackVoiceSearch(int type) { + Map properties = new HashMap<>(); + properties.put("type", type); + properties.put("searchtext", mKeywords); + properties.put("inputlon", inputlon); + properties.put("inputlat", inputlat); + properties.put("datalon", datalon); + properties.put("datalat", datalat); + mAnalytics.track(TanluConstants.CARNET_VOICE_SEARCH, properties); } } diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/TanluModelData.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/TanluModelData.java index 0a9e1f27a9..1a34d8ad11 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/TanluModelData.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/TanluModelData.java @@ -181,9 +181,6 @@ public class TanluModelData { Gson gson = new Gson(); NaviLatLng coordinates = new NaviLatLng(getNaviInfo(lon, lat).fromStart(), getNaviInfo(lon, lat).toEnd()); Logger.d(TAG, "getNavigationLineData -------> " + getSn()); - if (coordinates == null) { - return; - } List list = new ArrayList<>(); list.add(lon); diff --git a/modules/mogo-module-tanlu/src/main/res/values-ldpi/dimens.xml b/modules/mogo-module-tanlu/src/main/res/values-ldpi/dimens.xml index 4e2517d37d..1369cbda37 100644 --- a/modules/mogo-module-tanlu/src/main/res/values-ldpi/dimens.xml +++ b/modules/mogo-module-tanlu/src/main/res/values-ldpi/dimens.xml @@ -38,7 +38,7 @@ 109px 28px 45px - 45px + 42px 20px diff --git a/modules/mogo-module-tanlu/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-tanlu/src/main/res/values-xhdpi/dimens.xml index c6f46c0772..ed17bded92 100644 --- a/modules/mogo-module-tanlu/src/main/res/values-xhdpi/dimens.xml +++ b/modules/mogo-module-tanlu/src/main/res/values-xhdpi/dimens.xml @@ -35,9 +35,9 @@ 20px 300px 90px - 75px + 122px 205px - 25px + 50px 90px 80px diff --git a/upload.sh b/upload.sh index 3ad1ccbd45..16a2bafedb 100755 --- a/upload.sh +++ b/upload.sh @@ -8,6 +8,7 @@ ./gradlew :libraries:map-amap:clean :libraries:map-amap:uploadArchives ./gradlew :libraries:mogo-map:clean :libraries:mogo-map:uploadArchives ./gradlew :services:mogo-service:clean :services:mogo-service:uploadArchives +./gradlew :modules:mogo-module-common:clean :modules:mogo-module-common:uploadArchives ./gradlew :modules:mogo-module-map:clean :modules:mogo-module-map:uploadArchives ./gradlew :modules:mogo-module-tanlu:clean :modules:mogo-module-tanlu:uploadArchives ./gradlew :modules:mogo-module-apps:clean :modules:mogo-module-apps:uploadArchives