Merge branch 'feature/v1.0.0' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into feature/v1.0.0
@@ -93,6 +93,7 @@ public class SocketManager implements IMogoSocketManager, OnSocketReceiveCallbac
|
||||
while ( iterator.hasNext() ) {
|
||||
IMogoOnMessageListener listener = iterator.next();
|
||||
if ( listener != null ) {
|
||||
Logger.d(TAG, "received msg ==" + payload.getPayload().toStringUtf8());
|
||||
listener.onMsgReceived( GsonUtil.objectFromJson( payload.getPayload().toStringUtf8(), listener.target() ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@@ -11,6 +13,9 @@ public class MarkerCarInfo implements Serializable {
|
||||
private String carTypeName;
|
||||
|
||||
public String getCarBrandLogoUrl() {
|
||||
if (TextUtils.isEmpty(carBrandLogoUrl)) {
|
||||
return "";
|
||||
}
|
||||
return carBrandLogoUrl;
|
||||
}
|
||||
|
||||
@@ -19,6 +24,9 @@ public class MarkerCarInfo implements Serializable {
|
||||
}
|
||||
|
||||
public String getCarTypeName() {
|
||||
if (TextUtils.isEmpty(carTypeName)) {
|
||||
return "未知";
|
||||
}
|
||||
return carTypeName;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@@ -20,6 +22,9 @@ public class MarkerDynamicData implements Serializable {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
if (TextUtils.isEmpty(name)) {
|
||||
return "未知";
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@@ -21,6 +23,9 @@ public class MarkerExploreWay implements Serializable {
|
||||
private List<MarkerExploreWayItem> items;//视频地址和图片地址
|
||||
|
||||
public String getAddr() {
|
||||
if (TextUtils.isEmpty(addr)) {
|
||||
return "未知";
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@@ -11,6 +13,9 @@ public class MarkerExploreWayItem implements Serializable {
|
||||
private String url;
|
||||
|
||||
public String getThumbnail() {
|
||||
if (TextUtils.isEmpty(thumbnail)) {
|
||||
return "";
|
||||
}
|
||||
return thumbnail;
|
||||
}
|
||||
|
||||
@@ -19,6 +24,9 @@ public class MarkerExploreWayItem implements Serializable {
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
if (TextUtils.isEmpty(url)) {
|
||||
return "";
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@@ -12,6 +14,9 @@ public class MarkerHobbyDatum implements Serializable {
|
||||
private int isCheck;
|
||||
|
||||
public String getContent() {
|
||||
if (TextUtils.isEmpty(content)) {
|
||||
return "未知";
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@@ -37,6 +39,9 @@ public class MarkerLocation implements Serializable {
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
if (TextUtils.isEmpty(address)) {
|
||||
return "未知";
|
||||
}
|
||||
return address;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@@ -54,6 +56,9 @@ public class MarkerShareMusic implements Serializable {
|
||||
}
|
||||
|
||||
public String getMediaImg() {
|
||||
if (TextUtils.isEmpty(mediaImg)) {
|
||||
return "";
|
||||
}
|
||||
return mediaImg;
|
||||
}
|
||||
|
||||
@@ -62,6 +67,9 @@ public class MarkerShareMusic implements Serializable {
|
||||
}
|
||||
|
||||
public String getMediaName() {
|
||||
if (TextUtils.isEmpty(mediaName)) {
|
||||
return "未知";
|
||||
}
|
||||
return mediaName;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -51,6 +53,9 @@ public class MarkerShowEntity {
|
||||
}
|
||||
|
||||
public String getTextContent() {
|
||||
if (TextUtils.isEmpty(textContent)) {
|
||||
return "未知";
|
||||
}
|
||||
return textContent;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +90,9 @@ public class MarkerUserInfo implements Serializable {
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
if (TextUtils.isEmpty(sn)) {
|
||||
return "";
|
||||
}
|
||||
return sn;
|
||||
}
|
||||
|
||||
@@ -98,6 +101,9 @@ public class MarkerUserInfo implements Serializable {
|
||||
}
|
||||
|
||||
public String getUserHead() {
|
||||
if (TextUtils.isEmpty(userHead)) {
|
||||
return "";
|
||||
}
|
||||
return userHead;
|
||||
}
|
||||
|
||||
@@ -114,6 +120,9 @@ public class MarkerUserInfo implements Serializable {
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
if (TextUtils.isEmpty(userName)) {
|
||||
return "";
|
||||
}
|
||||
return userName;
|
||||
}
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 8.4 KiB |
@@ -358,6 +358,7 @@ public class MogoModulesManager implements MogoModulesHandler,
|
||||
try {
|
||||
getApplicationContext().unregisterReceiver( mReceiver );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
mReceiver = null;
|
||||
|
||||
@@ -153,6 +153,8 @@ public class MarkerServiceHandler {
|
||||
Logger.e(TAG, "onMarkerClicked 点击了大而全中的Marker lastMarkerShowEntity:" + lastMarkerShowEntity);
|
||||
|
||||
lastMarkerShowEntity.setChecked(false);
|
||||
lastMarkerShowEntity.setHighlighted(false);
|
||||
|
||||
drawMapMarkerItem(lastMarkerShowEntity);
|
||||
|
||||
lastMarker.remove();
|
||||
@@ -163,6 +165,7 @@ public class MarkerServiceHandler {
|
||||
Logger.e(TAG, "onMarkerClicked 点击了大而全中的Marker markerShowEntity:" + markerShowEntity);
|
||||
|
||||
markerShowEntity.setChecked(true);
|
||||
markerShowEntity.setHighlighted(true);
|
||||
|
||||
lastMarker = drawMapMarkerItem(markerShowEntity);
|
||||
|
||||
@@ -181,6 +184,7 @@ public class MarkerServiceHandler {
|
||||
// 将上次选中 Marker 设置为未选中状态
|
||||
MarkerShowEntity lastMarkerShowEntity = (MarkerShowEntity) lastMarker.getObject();
|
||||
lastMarkerShowEntity.setChecked(false);
|
||||
lastMarkerShowEntity.setHighlighted(false);
|
||||
drawMapMarkerItem(lastMarkerShowEntity);
|
||||
}
|
||||
lastMarker = null;
|
||||
@@ -203,6 +207,11 @@ public class MarkerServiceHandler {
|
||||
public static void drawMapMarker(MarkerResponse response) {
|
||||
lastMarker = null;
|
||||
getMarkerManager().removeMarkers();
|
||||
if (markerShowEntities == null) {
|
||||
markerShowEntities = new ArrayList<>();
|
||||
} else {
|
||||
markerShowEntities.clear();
|
||||
}
|
||||
|
||||
// 解析不同的Marker类型,然后对应的进行绘制
|
||||
if (response != null && response.getResult() != null) {
|
||||
@@ -290,11 +299,11 @@ public class MarkerServiceHandler {
|
||||
}
|
||||
|
||||
}
|
||||
getMapUIController().changeZoom(12);
|
||||
// getMapUIController().changeZoom(8);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制Marker
|
||||
* 绘制Marker,这里绘制的会使用markerShowEntities队列进行维护
|
||||
*/
|
||||
public static IMogoMarker drawMapMarker(MarkerShowEntity markerShowEntity) {
|
||||
Logger.e(TAG, "绘制Marker====drawMapMarker:" + markerShowEntity);
|
||||
@@ -307,15 +316,15 @@ public class MarkerServiceHandler {
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
options.icon(markerView);
|
||||
options.alpha(0.8f);
|
||||
|
||||
IMogoMarker marker = getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
|
||||
marker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
marker.setObject(markerShowEntity);
|
||||
|
||||
if (markerShowEntities == null) {
|
||||
markerShowEntities = new ArrayList<>();
|
||||
if (markerShowEntities != null) {
|
||||
markerShowEntities.add(markerShowEntity);
|
||||
}
|
||||
markerShowEntities.add(markerShowEntity);
|
||||
return marker;
|
||||
} else {
|
||||
Logger.e(TAG, "Location 必须进行初始化!!!!!");
|
||||
@@ -327,7 +336,7 @@ public class MarkerServiceHandler {
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制Marker
|
||||
* 绘制Marker,这里绘制的不会添加到队列中
|
||||
*/
|
||||
public static IMogoMarker drawMapMarkerItem(MarkerShowEntity markerShowEntity) {
|
||||
Logger.e(TAG, "绘制Marker====drawMapMarkerItem:" + markerShowEntity);
|
||||
@@ -340,6 +349,11 @@ public class MarkerServiceHandler {
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
options.icon(markerView);
|
||||
if (markerShowEntity.isHighlighted()) {
|
||||
options.alpha(1f);
|
||||
} else {
|
||||
options.alpha(0.8f);
|
||||
}
|
||||
|
||||
IMogoMarker marker = getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
|
||||
marker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
@@ -354,23 +368,4 @@ public class MarkerServiceHandler {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
//TODO 这里是用来测试的
|
||||
public static void drawMapMarker() {
|
||||
// Logger.e(TAG, "=====绘制Marker====");
|
||||
//
|
||||
// MapMarkerView mapMarkerView = new MapMarkerView(mContext);
|
||||
//
|
||||
// MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
// .icon(mapMarkerView)
|
||||
// .owner("CARD_TYPE_USER_DATA")
|
||||
// .latitude(39.574525d + new Random().nextDouble())
|
||||
// .longitude(116.21733d + new Random().nextDouble());
|
||||
// IMogoMarker marker = getMarkerManager().addMarker("CARD_TYPE_USER_DATA", options);
|
||||
// marker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
// marker.setObject("我是Marker上面绑定的数据");
|
||||
//
|
||||
// getMapUIController().changeZoom(8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.service.imageloader.IMogoImageLoaderListener;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
@@ -55,6 +56,7 @@ public abstract class MapMarkerBaseView extends ConstraintLayout {
|
||||
public abstract void updateView(MarkerShowEntity markerShowEntity);
|
||||
|
||||
protected void loadImageWithMarker(MarkerShowEntity markerShowEntity) {
|
||||
|
||||
if (!TextUtils.isEmpty(markerShowEntity.getIconUrl())) {
|
||||
MarkerServiceHandler
|
||||
.getImageloader()
|
||||
@@ -69,15 +71,17 @@ public abstract class MapMarkerBaseView extends ConstraintLayout {
|
||||
|
||||
@Override
|
||||
public void onCompleted(Bitmap bitmap) {
|
||||
// 刷新图标
|
||||
Logger.d(TAG, "loaded.");
|
||||
Logger.d(TAG, "loadImageWithMarker loaded.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
|
||||
Logger.e(TAG, "loadImageWithMarker onFailure.");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ivUserHead.setBackgroundResource(R.drawable.icon_default_user_head);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
case ServiceConst.CARD_TYPE_CARS_CHATTING:
|
||||
case ServiceConst.CARD_TYPE_USER_DATA:
|
||||
ivUserHead.setVisibility(View.VISIBLE);
|
||||
ivIcon.setVisibility(View.GONE);
|
||||
ivIcon.setVisibility(View.INVISIBLE);
|
||||
|
||||
if (bindObj instanceof MarkerOnlineCar) {
|
||||
if (((MarkerOnlineCar) bindObj).getUserInfo().getGenderValue() == 0) {
|
||||
@@ -83,7 +83,7 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_ROAD_CONDITION:
|
||||
ivUserHead.setVisibility(View.GONE);
|
||||
ivUserHead.setVisibility(View.INVISIBLE);
|
||||
ivIcon.setVisibility(View.VISIBLE);
|
||||
|
||||
ivUserHead.setImageResource(R.drawable.icon_map_marker_road_block_up);
|
||||
@@ -92,7 +92,7 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_NOVELTY:
|
||||
ivUserHead.setVisibility(View.GONE);
|
||||
ivUserHead.setVisibility(View.INVISIBLE);
|
||||
ivIcon.setVisibility(View.VISIBLE);
|
||||
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_road_check);
|
||||
@@ -101,7 +101,7 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_SHARE_MUSIC:
|
||||
ivUserHead.setVisibility(View.GONE);
|
||||
ivUserHead.setVisibility(View.INVISIBLE);
|
||||
ivIcon.setVisibility(View.VISIBLE);
|
||||
|
||||
if (bindObj instanceof MarkerShareMusic) {
|
||||
|
||||
@@ -44,8 +44,6 @@ public class MapMarkerView extends MapMarkerBaseView {
|
||||
}
|
||||
|
||||
protected void initView(Context context) {
|
||||
setBackground(null);
|
||||
|
||||
LayoutInflater.from(context).inflate(R.layout.view_map_marker, this);
|
||||
ivUserHead = findViewById(R.id.ivUserHead);
|
||||
ivIcon = findViewById(R.id.ivIcon);
|
||||
@@ -56,18 +54,11 @@ public class MapMarkerView extends MapMarkerBaseView {
|
||||
public void updateView(MarkerShowEntity markerShowEntity) {
|
||||
try {
|
||||
Object bindObj = markerShowEntity.getBindObj();
|
||||
|
||||
if (markerShowEntity.isHighlighted()) {
|
||||
ivBg.setAlpha(1f);
|
||||
} else {
|
||||
ivBg.setAlpha(0.7f);
|
||||
}
|
||||
|
||||
switch (markerShowEntity.getMarkerType()) {
|
||||
case ServiceConst.CARD_TYPE_CARS_CHATTING:
|
||||
case ServiceConst.CARD_TYPE_USER_DATA:
|
||||
ivUserHead.setVisibility(View.VISIBLE);
|
||||
ivIcon.setVisibility(View.GONE);
|
||||
ivIcon.setVisibility(View.INVISIBLE);
|
||||
|
||||
if (bindObj instanceof MarkerOnlineCar) {
|
||||
if (((MarkerOnlineCar) bindObj).getUserInfo().getGenderValue() == 0) {
|
||||
@@ -81,15 +72,15 @@ public class MapMarkerView extends MapMarkerBaseView {
|
||||
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_ROAD_CONDITION:
|
||||
ivUserHead.setVisibility(View.GONE);
|
||||
ivUserHead.setVisibility(View.INVISIBLE);
|
||||
ivIcon.setVisibility(View.VISIBLE);
|
||||
|
||||
ivUserHead.setImageResource(R.drawable.icon_map_marker_road_block_up);
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_road_block_up);
|
||||
ivBg.setImageResource(R.drawable.bg_map_marker_blue);
|
||||
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_NOVELTY:
|
||||
ivUserHead.setVisibility(View.GONE);
|
||||
ivUserHead.setVisibility(View.INVISIBLE);
|
||||
ivIcon.setVisibility(View.VISIBLE);
|
||||
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_road_check);
|
||||
@@ -97,7 +88,7 @@ public class MapMarkerView extends MapMarkerBaseView {
|
||||
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_SHARE_MUSIC:
|
||||
ivUserHead.setVisibility(View.GONE);
|
||||
ivUserHead.setVisibility(View.INVISIBLE);
|
||||
ivIcon.setVisibility(View.VISIBLE);
|
||||
|
||||
if (bindObj instanceof MarkerShareMusic) {
|
||||
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
@@ -23,7 +23,6 @@
|
||||
android:layout_height="@dimen/dp_85"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/bg_map_marker_blue"
|
||||
android:alpha="0.8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -37,9 +36,9 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:miv_failureHolder="@drawable/icon_default"
|
||||
app:miv_overlayImageId="@drawable/icon_default"
|
||||
app:miv_placeHolder="@drawable/icon_default"
|
||||
app:miv_failureHolder="@drawable/icon_default_user_head"
|
||||
app:miv_overlayImageId="@drawable/icon_default_user_head"
|
||||
app:miv_placeHolder="@drawable/icon_default_user_head"
|
||||
app:miv_shape="circle" />
|
||||
|
||||
<ImageView
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clMarkerContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:maxWidth="@dimen/dp_366"
|
||||
android:layout_height="@dimen/dp_74"
|
||||
android:background="@drawable/bg_map_marker_blue_info"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -34,9 +33,9 @@
|
||||
android:layout_height="@dimen/dp_60"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:miv_failureHolder="@drawable/icon_default"
|
||||
app:miv_overlayImageId="@drawable/icon_default"
|
||||
app:miv_placeHolder="@drawable/icon_default"
|
||||
app:miv_failureHolder="@drawable/icon_default_user_head"
|
||||
app:miv_overlayImageId="@drawable/icon_default_user_head"
|
||||
app:miv_placeHolder="@drawable/icon_default_user_head"
|
||||
app:miv_shape="circle" />
|
||||
|
||||
<ImageView
|
||||
@@ -63,10 +62,10 @@
|
||||
android:singleLine="true"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/sp_32"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ivIcon"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ivUserHead"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/ivIcon"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivIcon"
|
||||
app:layout_constraintStart_toEndOf="@+id/ivUserHead"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivUserHead"
|
||||
tools:text="诗一样的女子诗诗一样的女子诗诗一样的女子诗" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout >
|
||||
|
||||
|
||||
@@ -63,6 +63,8 @@ import com.mogo.module.tanlu.video.FullMediaActivity;
|
||||
import com.mogo.module.tanlu.video.SimpleCoverVideoPlayer;
|
||||
import com.mogo.module.tanlu.view.AutoZoomInImageView;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.voice.IMogoVoiceListener;
|
||||
import com.mogo.service.voice.IMogoVoiceManager;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
|
||||
@@ -84,7 +86,7 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
|
||||
* @description 探路卡片
|
||||
* @since 2020-01-02
|
||||
*/
|
||||
public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView > >
|
||||
public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
implements IView,
|
||||
IMogoMarkerClickListener,
|
||||
IMogoModuleLifecycle,
|
||||
@@ -103,6 +105,7 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
private IMogoSocketManager mMogoSocketManager;
|
||||
private IMogoLocationClient mLocationClient;
|
||||
private IMogoCardManager iMogoCardManager;
|
||||
private IMogoVoiceManager mMogoVoiceManager;
|
||||
|
||||
//声音控制文字
|
||||
private String voiceGetInfoMationTts;
|
||||
@@ -125,11 +128,11 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
private TextView mDistanceTv;
|
||||
private TextView mTimeTv;
|
||||
|
||||
private List< MarkerExploreWay > markerExploreWayList = new ArrayList<>();
|
||||
private List<MarkerExploreWay> markerExploreWayList = new ArrayList<>();
|
||||
private int currentPosition = 0; //卡片媒体当前位置
|
||||
private Bitmap mMarkerIcon;
|
||||
private TanluModelData mTanluModelData;
|
||||
private List< MogoLatLng > passedByPoints;
|
||||
private List<MogoLatLng> passedByPoints;
|
||||
private IMogoRegisterCenter mMogoRegisterCenter;
|
||||
|
||||
|
||||
@@ -141,70 +144,74 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
@Override
|
||||
protected void initViews() {
|
||||
initVideo();
|
||||
simpleCoverVideoPlayer = findViewById( R.id.video_player_main );
|
||||
autoZoomInImageView = findViewById( R.id.tanlu_photo_imageView );
|
||||
mPreviousTv = findViewById( R.id.tv_previous_res );
|
||||
mNextTv = findViewById( R.id.tv_next_res );
|
||||
mRootLayout = findViewById( R.id.layout_data_show );
|
||||
mEmptyLayout = findViewById( R.id.layout_empty_data_show );
|
||||
mEmptyTv = findViewById( R.id.tv_main_empty );
|
||||
mAddressTv = findViewById( R.id.tv_information_media_content );
|
||||
mDistanceTv = findViewById( R.id.tv_distance_video );
|
||||
mTimeTv = findViewById( R.id.tv_information_media_time );
|
||||
simpleCoverVideoPlayer = findViewById(R.id.video_player_main);
|
||||
autoZoomInImageView = findViewById(R.id.tanlu_photo_imageView);
|
||||
mPreviousTv = findViewById(R.id.tv_previous_res);
|
||||
mNextTv = findViewById(R.id.tv_next_res);
|
||||
mRootLayout = findViewById(R.id.layout_data_show);
|
||||
mEmptyLayout = findViewById(R.id.layout_empty_data_show);
|
||||
mEmptyTv = findViewById(R.id.tv_main_empty);
|
||||
mAddressTv = findViewById(R.id.tv_information_media_content);
|
||||
mDistanceTv = findViewById(R.id.tv_distance_video);
|
||||
mTimeTv = findViewById(R.id.tv_information_media_time);
|
||||
|
||||
mPreviousTv.setOnClickListener( this );
|
||||
mNextTv.setOnClickListener( this );
|
||||
mEmptyTv.setOnClickListener( this );
|
||||
mPreviousTv.setOnClickListener(this);
|
||||
mNextTv.setOnClickListener(this);
|
||||
mEmptyTv.setOnClickListener(this);
|
||||
|
||||
simpleCoverVideoPlayer.setVisibility( View.VISIBLE );
|
||||
autoZoomInImageView.setVisibility( View.GONE );
|
||||
simpleCoverVideoPlayer.setVisibility(View.VISIBLE);
|
||||
autoZoomInImageView.setVisibility(View.GONE);
|
||||
|
||||
//视频配置 TODO 需要去掉
|
||||
// gsyVideoOptionBuilder.setUrl(mVideoUrl).setCacheWithPlay(false).setPlayTag(TAG)
|
||||
// .build(simpleCoverVideoPlayer);
|
||||
simpleCoverVideoPlayer.getStartButton().setOnClickListener( new View.OnClickListener() {
|
||||
simpleCoverVideoPlayer.getStartButton().setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View view ) {
|
||||
Logger.d( TAG, "simpleCoverVideoPlayer onClick -------> " );
|
||||
FullMediaActivity.Companion.launch( getActivity(), mVideoUrl, mImageUrl, mTitle, mGenerateTime );
|
||||
public void onClick(View view) {
|
||||
Logger.d(TAG, "simpleCoverVideoPlayer onClick -------> ");
|
||||
FullMediaActivity.Companion.launch(getActivity(), mVideoUrl, mImageUrl, mTitle, mGenerateTime);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void initInterface() {
|
||||
//图片配置
|
||||
mogoImageloader = ( IMogoImageloader ) ARouter.getInstance().build( MogoServicePaths.PATH_UTILS_IMAGE_LOADER ).navigation();
|
||||
mogoImageloader = (IMogoImageloader) ARouter.getInstance().build(MogoServicePaths.PATH_UTILS_IMAGE_LOADER).navigation();
|
||||
//地图marker
|
||||
mMogoMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( getActivity() );
|
||||
mMogoMapService = (IMogoMapService) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_MAP).navigation(getActivity());
|
||||
//切换卡片操作
|
||||
iMogoCardManager = ( IMogoCardManager ) ARouter.getInstance().build( MogoServicePaths.PATH_CARD_MANAGER ).navigation( getActivity() );
|
||||
iMogoCardManager = (IMogoCardManager) ARouter.getInstance().build(MogoServicePaths.PATH_CARD_MANAGER).navigation(getActivity());
|
||||
|
||||
mMogoRegisterCenter = ( IMogoRegisterCenter ) ARouter.getInstance().build( MogoServicePaths.PATH_REGISTER_CENTER ).navigation( getContext() );
|
||||
mMogoRegisterCenter = (IMogoRegisterCenter) ARouter.getInstance().build(MogoServicePaths.PATH_REGISTER_CENTER).navigation(getContext());
|
||||
|
||||
|
||||
mMogoRegisterCenter.registerMogoModuleLifecycle( TanluConstants.MODEL_NAME, this );
|
||||
mMogoRegisterCenter.registerMogoModuleLifecycle(TanluConstants.MODEL_NAME, this);
|
||||
mMogoRegisterCenter = (IMogoRegisterCenter) ARouter.getInstance().build(MogoServicePaths.PATH_REGISTER_CENTER).navigation(getContext());
|
||||
//语音操作
|
||||
mMogoVoiceManager = (IMogoVoiceManager) ARouter.getInstance().build(MogoServicePaths.PATH_VOICE_MANAGER).navigation(getContext());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onActivityCreated( @Nullable Bundle savedInstanceState ) {
|
||||
super.onActivityCreated( savedInstanceState );
|
||||
getViewLifecycleOwner().getLifecycle().addObserver( mPresenter );
|
||||
EventBus.getDefault().register( this );
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
getViewLifecycleOwner().getLifecycle().addObserver(mPresenter);
|
||||
EventBus.getDefault().register(this);
|
||||
initInterface();
|
||||
initModelData();
|
||||
handleRoadLineMessage();
|
||||
initMap();
|
||||
initStrings();
|
||||
initListener();
|
||||
|
||||
//TODO切换探路卡片
|
||||
// iMogoCardManager.switch2(TanluConstants.MODEL_NAME);
|
||||
}
|
||||
|
||||
private void initModelData() {
|
||||
if ( mTanluModelData == null ) {
|
||||
mTanluModelData = new TanluModelData( getContext() );
|
||||
if (mTanluModelData == null) {
|
||||
mTanluModelData = new TanluModelData(getContext());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +219,7 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
* 初始化导航 TODO
|
||||
*/
|
||||
private void initMap() {
|
||||
mMogoRegisterCenter.registerMogoNaviListener( TanluConstants.MODEL_NAME, new IMogoNaviListener() {
|
||||
mMogoRegisterCenter.registerMogoNaviListener(TanluConstants.MODEL_NAME, new IMogoNaviListener() {
|
||||
@Override
|
||||
public void onInitNaviFailure() {
|
||||
|
||||
@@ -224,7 +231,7 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate( MogoNaviInfo naviinfo ) {
|
||||
public void onNaviInfoUpdate(MogoNaviInfo naviinfo) {
|
||||
|
||||
}
|
||||
|
||||
@@ -248,47 +255,60 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
public void onoCalculateFailed() {
|
||||
|
||||
}
|
||||
} );
|
||||
});
|
||||
|
||||
//监听marker点击
|
||||
mMogoRegisterCenter.registerMogoMarkerClickListener( TanluConstants.MODEL_NAME, new IMogoMarkerClickListener() {
|
||||
mMogoRegisterCenter.registerMogoMarkerClickListener(TanluConstants.MODEL_NAME, new IMogoMarkerClickListener() {
|
||||
@Override
|
||||
public boolean onMarkerClicked( IMogoMarker marker ) {
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
//点击marker以后,确认他的位置?然后点击下一个操作 TODO
|
||||
MarkerExploreWay exploreWay = extractFromMarker(marker);
|
||||
if ( exploreWay == null ) {
|
||||
if (exploreWay == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( exploreWay.getFileType() == 0 ) { //图片
|
||||
refreshPhotoData( exploreWay );
|
||||
} else if ( exploreWay.getFileType() == 1 ) { //视频
|
||||
handleData( exploreWay );
|
||||
if (exploreWay.getFileType() == 0) { //图片
|
||||
refreshPhotoData(exploreWay);
|
||||
} else if (exploreWay.getFileType() == 1) { //视频
|
||||
handleData(exploreWay);
|
||||
}
|
||||
|
||||
//更新位置currentPosition
|
||||
for ( int i = 0; i < markerExploreWayList.size(); i++ ) {
|
||||
if ( markerExploreWayList.get( i ) == exploreWay ) {
|
||||
for (int i = 0; i < markerExploreWayList.size(); i++) {
|
||||
if (markerExploreWayList.get(i) == exploreWay) {
|
||||
currentPosition = i;
|
||||
break;
|
||||
}
|
||||
Logger.d( TAG, "onMarkerClicked currentPosition = " + currentPosition );
|
||||
Logger.d(TAG, "onMarkerClicked currentPosition = " + currentPosition);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
} );
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private MarkerExploreWay extractFromMarker( IMogoMarker marker ) {
|
||||
if ( marker == null ) {
|
||||
/**
|
||||
* 注册listener监听
|
||||
*/
|
||||
private void initListener() {
|
||||
//某某路堵不堵,某某地点堵不堵,附近堵不堵,播放路况
|
||||
//上报路况,上报拥堵
|
||||
mMogoVoiceManager.registerIntentListener("", new IMogoVoiceListener() {
|
||||
@Override
|
||||
public void onIntentReceived(String command, Intent intent) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private MarkerExploreWay extractFromMarker(IMogoMarker marker) {
|
||||
if (marker == null) {
|
||||
return null;
|
||||
}
|
||||
if ( marker.getObject() instanceof MarkerShowEntity ) {
|
||||
MarkerShowEntity showEntity = ( ( MarkerShowEntity ) marker.getObject() );
|
||||
if ( showEntity.getBindObj() instanceof MarkerExploreWay ) {
|
||||
return ( ( MarkerExploreWay ) showEntity.getBindObj() );
|
||||
if (marker.getObject() instanceof MarkerShowEntity) {
|
||||
MarkerShowEntity showEntity = ((MarkerShowEntity) marker.getObject());
|
||||
if (showEntity.getBindObj() instanceof MarkerExploreWay) {
|
||||
return ((MarkerExploreWay) showEntity.getBindObj());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -323,9 +343,9 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
* @param view
|
||||
*/
|
||||
@Override
|
||||
public void onClick( View view ) {
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if ( id == R.id.tv_previous_res ) { //上一个
|
||||
if (id == R.id.tv_previous_res) { //上一个
|
||||
// 判断是图片还是视频,第一个时,上一个不可点击
|
||||
Logger.d(TAG, " tv_previous_res --1-> currentPosition =" + currentPosition + ">> size= " + markerExploreWayList.size());
|
||||
if (currentPosition < 0) {
|
||||
@@ -342,47 +362,47 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
// getNavigationLineData();
|
||||
// getNaviRoadLineInfo();
|
||||
|
||||
} else if ( id == R.id.tv_next_res ) { //下一个
|
||||
} else if (id == R.id.tv_next_res) { //下一个
|
||||
//判断是图片还是视频,最后一个时,下一个不可点击
|
||||
Logger.d( TAG, " tv_next_res --1-> currentPosition =" + currentPosition + ">> size= " + markerExploreWayList.size() );
|
||||
if ( currentPosition > markerExploreWayList.size() ) {
|
||||
Logger.d(TAG, " tv_next_res --1-> currentPosition =" + currentPosition + ">> size= " + markerExploreWayList.size());
|
||||
if (currentPosition > markerExploreWayList.size()) {
|
||||
return;
|
||||
}
|
||||
currentPosition++;
|
||||
Logger.d( TAG, " tv_next_res --2-> currentPosition =" + currentPosition + ">> size= " + markerExploreWayList.size() );
|
||||
if ( markerExploreWayList.size() > currentPosition ) {
|
||||
handleData( markerExploreWayList.get( currentPosition ) );
|
||||
Logger.d(TAG, " tv_next_res --2-> currentPosition =" + currentPosition + ">> size= " + markerExploreWayList.size());
|
||||
if (markerExploreWayList.size() > currentPosition) {
|
||||
handleData(markerExploreWayList.get(currentPosition));
|
||||
}
|
||||
|
||||
} else if ( id == R.id.tv_main_empty ) { //TODO上报路况,逻辑
|
||||
Logger.d( TAG, "tv_main_empty click -----> " );
|
||||
sendShareReceiver( "1" );
|
||||
} else if (id == R.id.tv_main_empty) { //TODO上报路况,逻辑
|
||||
Logger.d(TAG, "tv_main_empty click -----> ");
|
||||
sendShareReceiver("1");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送广播
|
||||
*/
|
||||
private void sendShareReceiver( String type ) {
|
||||
Logger.d( "liyz", "LaucherShareDialog sendShareReceiver ---->" );
|
||||
private void sendShareReceiver(String type) {
|
||||
Logger.d("liyz", "LaucherShareDialog sendShareReceiver ---->");
|
||||
Intent intent = new Intent();
|
||||
intent.setAction( "com.zhidao.roadcondition.share" );
|
||||
intent.putExtra( "type", type );
|
||||
getContext().sendBroadcast( intent );
|
||||
intent.setAction("com.zhidao.roadcondition.share");
|
||||
intent.putExtra("type", type);
|
||||
getContext().sendBroadcast(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行图片动画
|
||||
*/
|
||||
private void handleImageAnimation() {
|
||||
autoZoomInImageView.post( new Runnable() {
|
||||
autoZoomInImageView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//放大增量是0.3,放大时间是1000毫秒,放大开始时间是600毫秒以后
|
||||
autoZoomInImageView.init()
|
||||
.startZoomInByScaleDeltaAndDuration( 0.2f, 1000, 500 );
|
||||
.startZoomInByScaleDeltaAndDuration(0.2f, 1000, 500);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -392,7 +412,7 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean onMarkerClicked( IMogoMarker marker ) {
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -401,44 +421,44 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
*
|
||||
* @param exploreWay
|
||||
*/
|
||||
private void handleData( MarkerExploreWay exploreWay ) {
|
||||
if ( exploreWay != null ) {
|
||||
if ( exploreWay.getFileType() == 0 ) { //图片
|
||||
refreshPhotoData( exploreWay );
|
||||
} else if ( exploreWay.getFileType() == 1 ) { //视频
|
||||
refreshVideoData( exploreWay );
|
||||
private void handleData(MarkerExploreWay exploreWay) {
|
||||
if (exploreWay != null) {
|
||||
if (exploreWay.getFileType() == 0) { //图片
|
||||
refreshPhotoData(exploreWay);
|
||||
} else if (exploreWay.getFileType() == 1) { //视频
|
||||
refreshVideoData(exploreWay);
|
||||
}
|
||||
} else {
|
||||
Logger.e( TAG, "handleData exploreWay == null " );
|
||||
Logger.e(TAG, "handleData exploreWay == null ");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新单个视频数据,更新位置positon
|
||||
*/
|
||||
private void refreshVideoData( MarkerExploreWay markerExploreWay ) {
|
||||
if ( markerExploreWay.getItems() == null ) {
|
||||
private void refreshVideoData(MarkerExploreWay markerExploreWay) {
|
||||
if (markerExploreWay.getItems() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( markerExploreWay.getItems().size() == 0 ) {
|
||||
if (markerExploreWay.getItems().size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
String videoUrl = markerExploreWay.getItems().get( 0 ).getUrl();
|
||||
mImageUrl = markerExploreWay.getItems().get( 0 ).getThumbnail();
|
||||
String videoUrl = markerExploreWay.getItems().get(0).getUrl();
|
||||
mImageUrl = markerExploreWay.getItems().get(0).getThumbnail();
|
||||
mGenerateTime = markerExploreWay.getGenerateTime();
|
||||
mTitle = markerExploreWay.getAddr();
|
||||
mAddressTv.setText( markerExploreWay.getAddr() );
|
||||
mDistanceTv.setText( handleDistance( markerExploreWay.getDistance() ) );
|
||||
mTimeTv.setText( formatDate( markerExploreWay.getGenerateTime() ) );
|
||||
mAddressTv.setText(markerExploreWay.getAddr());
|
||||
mDistanceTv.setText(handleDistance(markerExploreWay.getDistance()));
|
||||
mTimeTv.setText(formatDate(markerExploreWay.getGenerateTime()));
|
||||
//判断是图片还是视频,第一个时,上一个不可点击
|
||||
simpleCoverVideoPlayer.setVisibility( View.VISIBLE );
|
||||
simpleCoverVideoPlayer.setVisibility(View.VISIBLE);
|
||||
//视频配置
|
||||
mVideoUrl = videoUrl;
|
||||
gsyVideoOptionBuilder.setUrl( videoUrl ).setCacheWithPlay( false ).setPlayTag( TAG )
|
||||
.build( simpleCoverVideoPlayer );
|
||||
if ( mImageUrl == null ) {
|
||||
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag(TAG)
|
||||
.build(simpleCoverVideoPlayer);
|
||||
if (mImageUrl == null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -446,45 +466,45 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
/**
|
||||
* 刷新单个图片数据
|
||||
*/
|
||||
private void refreshPhotoData( MarkerExploreWay markerExploreWay ) {
|
||||
if ( markerExploreWay.getItems() == null ) {
|
||||
private void refreshPhotoData(MarkerExploreWay markerExploreWay) {
|
||||
if (markerExploreWay.getItems() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( markerExploreWay.getItems().size() == 0 ) {
|
||||
if (markerExploreWay.getItems().size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
mAddressTv.setText( markerExploreWay.getAddr() );
|
||||
mDistanceTv.setText( handleDistance( markerExploreWay.getDistance() ) );
|
||||
mTimeTv.setText( formatDate( markerExploreWay.getGenerateTime() ) );
|
||||
String thumbnailUrl = markerExploreWay.getItems().get( 0 ).getUrl();
|
||||
Logger.d( TAG, "refreshPhotoData thumbnailUrl ------>" + thumbnailUrl );
|
||||
autoZoomInImageView.setVisibility( View.VISIBLE );
|
||||
simpleCoverVideoPlayer.setVisibility( View.GONE );
|
||||
mogoImageloader.downloadImage( getActivity(), thumbnailUrl, new IMogoImageLoaderListener() {
|
||||
mAddressTv.setText(markerExploreWay.getAddr());
|
||||
mDistanceTv.setText(handleDistance(markerExploreWay.getDistance()));
|
||||
mTimeTv.setText(formatDate(markerExploreWay.getGenerateTime()));
|
||||
String thumbnailUrl = markerExploreWay.getItems().get(0).getUrl();
|
||||
Logger.d(TAG, "refreshPhotoData thumbnailUrl ------>" + thumbnailUrl);
|
||||
autoZoomInImageView.setVisibility(View.VISIBLE);
|
||||
simpleCoverVideoPlayer.setVisibility(View.GONE);
|
||||
mogoImageloader.downloadImage(getActivity(), thumbnailUrl, new IMogoImageLoaderListener() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompleted( Bitmap bitmap ) {
|
||||
autoZoomInImageView.setImageBitmap( bitmap );
|
||||
public void onCompleted(Bitmap bitmap) {
|
||||
autoZoomInImageView.setImageBitmap(bitmap);
|
||||
//动画
|
||||
// handleImageAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure( Exception e ) {
|
||||
Logger.e( TAG, "onFailure ------>" + e );
|
||||
public void onFailure(Exception e) {
|
||||
Logger.e(TAG, "onFailure ------>" + e);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected Presenter createPresenter() {
|
||||
return new Presenter( this ) {
|
||||
return new Presenter(this) {
|
||||
};
|
||||
}
|
||||
|
||||
@@ -494,42 +514,42 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
*/
|
||||
@Override
|
||||
public void onPerform() {
|
||||
Logger.d( TAG, "tanlu卡片 有效 ---->" );
|
||||
mMarkerManager = mMogoMapService.getMarkerManager( getActivity() );
|
||||
List< IMogoMarker > markers = mMarkerManager.getMarkers( TanluConstants.MODEL_NAME );
|
||||
if ( markers != null && markers.size() > 0 ) {
|
||||
mEmptyLayout.setVisibility( View.GONE );
|
||||
mRootLayout.setVisibility( View.VISIBLE );
|
||||
Logger.d( TAG, "onPerform markers.size() =" + markers.size() );
|
||||
for ( int i = 0; i < markers.size(); i++ ) {
|
||||
MarkerExploreWay exploreWay = extractFromMarker(markers.get( i ));
|
||||
if ( exploreWay == null ) {
|
||||
Logger.d(TAG, "tanlu卡片 有效 ---->");
|
||||
mMarkerManager = mMogoMapService.getMarkerManager(getActivity());
|
||||
List<IMogoMarker> markers = mMarkerManager.getMarkers(TanluConstants.MODEL_NAME);
|
||||
if (markers != null && markers.size() > 0) {
|
||||
mEmptyLayout.setVisibility(View.GONE);
|
||||
mRootLayout.setVisibility(View.VISIBLE);
|
||||
Logger.d(TAG, "onPerform markers.size() =" + markers.size());
|
||||
for (int i = 0; i < markers.size(); i++) {
|
||||
MarkerExploreWay exploreWay = extractFromMarker(markers.get(i));
|
||||
if (exploreWay == null) {
|
||||
break;
|
||||
}
|
||||
markerExploreWayList.add(exploreWay );
|
||||
markerExploreWayList.add(exploreWay);
|
||||
}
|
||||
|
||||
if ( markers.size() == 1 ) {
|
||||
mPreviousTv.setVisibility( View.GONE );
|
||||
mNextTv.setVisibility( View.GONE );
|
||||
if (markers.size() == 1) {
|
||||
mPreviousTv.setVisibility(View.GONE);
|
||||
mNextTv.setVisibility(View.GONE);
|
||||
} else {
|
||||
mPreviousTv.setVisibility( View.VISIBLE );
|
||||
mNextTv.setVisibility( View.VISIBLE );
|
||||
mPreviousTv.setVisibility(View.VISIBLE);
|
||||
mNextTv.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
//展示第一个数据
|
||||
MarkerExploreWay markerExploreWay = markerExploreWayList.get( 0 );
|
||||
if ( markerExploreWay != null ) {
|
||||
if ( markerExploreWay.getFileType() == 0 ) { //图片
|
||||
refreshPhotoData( markerExploreWay );
|
||||
} else if ( markerExploreWay.getFileType() == 1 ) { //视频
|
||||
refreshVideoData( markerExploreWay );
|
||||
MarkerExploreWay markerExploreWay = markerExploreWayList.get(0);
|
||||
if (markerExploreWay != null) {
|
||||
if (markerExploreWay.getFileType() == 0) { //图片
|
||||
refreshPhotoData(markerExploreWay);
|
||||
} else if (markerExploreWay.getFileType() == 1) { //视频
|
||||
refreshVideoData(markerExploreWay);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mEmptyLayout.setVisibility( View.VISIBLE );
|
||||
mRootLayout.setVisibility( View.GONE );
|
||||
mEmptyTv.setText( Html.fromHtml( getContext().getString( R.string.main_empty_content ) ) );
|
||||
mEmptyLayout.setVisibility(View.VISIBLE);
|
||||
mRootLayout.setVisibility(View.GONE);
|
||||
mEmptyTv.setText(Html.fromHtml(getContext().getString(R.string.main_empty_content)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,7 +558,7 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
*/
|
||||
@Override
|
||||
public void onDisable() {
|
||||
Logger.d( TAG, "tanlu卡片 无效 ----->" );
|
||||
Logger.d(TAG, "tanlu卡片 无效 ----->");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -552,32 +572,32 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouch( MotionEvent motionEvent ) {
|
||||
public void onTouch(MotionEvent motionEvent) {
|
||||
// Logger.d( TAG, "地图触摸事件" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPOIClick( MogoPoi poi ) {
|
||||
if ( poi != null ) {
|
||||
TipToast.shortTip( poi.getName() );
|
||||
public void onPOIClick(MogoPoi poi) {
|
||||
if (poi != null) {
|
||||
TipToast.shortTip(poi.getName());
|
||||
}
|
||||
TanluServiceHandler.getPoiSearch().searchPOIIdAsyn( poi.getPoiId() );
|
||||
TanluServiceHandler.getPoiSearch().searchPOIIdAsyn(poi.getPoiId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPoiSearched( MogoPoiResult result, int errorCode ) {
|
||||
public void onPoiSearched(MogoPoiResult result, int errorCode) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPoiItemSearched( MogoPoiItem item, int errorCode ) {
|
||||
if ( item == null ) {
|
||||
public void onPoiItemSearched(MogoPoiItem item, int errorCode) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged( MogoLocation location ) {
|
||||
public void onLocationChanged(MogoLocation location) {
|
||||
// if (location.getErrCode() == 0) {
|
||||
// Logger.d(TAG, "onLocationChanged 当前位置 -->" + location.getAddress());
|
||||
// } else {
|
||||
@@ -586,32 +606,32 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapClick( MogoLatLng latLng ) {
|
||||
public void onMapClick(MogoLatLng latLng) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockMap( boolean isLock ) {
|
||||
public void onLockMap(boolean isLock) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged( EnumMapUI ui ) {
|
||||
Logger.d( TAG, ui.name() );
|
||||
public void onMapModeChanged(EnumMapUI ui) {
|
||||
Logger.d(TAG, ui.name());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapChanged( MogoLatLng location, float zoom, float tilt, float bearing ) {
|
||||
public void onMapChanged(MogoLatLng location, float zoom, float tilt, float bearing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
EventBus.getDefault().unregister( this );
|
||||
getViewLifecycleOwner().getLifecycle().removeObserver( mPresenter );
|
||||
TanluServiceHandler.getLocationClient().removeLocationListener( this );
|
||||
mMogoRegisterCenter.unregisterMogoNaviListener( TanluConstants.MODEL_NAME );
|
||||
EventBus.getDefault().unregister(this);
|
||||
getViewLifecycleOwner().getLifecycle().removeObserver(mPresenter);
|
||||
TanluServiceHandler.getLocationClient().removeLocationListener(this);
|
||||
mMogoRegisterCenter.unregisterMogoNaviListener(TanluConstants.MODEL_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -619,35 +639,35 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
@Subscribe( threadMode = ThreadMode.MAIN )
|
||||
public void onMarkerInfo( final MarkerInfo event ) {
|
||||
Logger.d( TAG, "onMarkerInfo ------>" );
|
||||
mMarkerIcon = BitmapFactory.decodeResource( getResources(), R.drawable.ic_search_poi_location );
|
||||
mogoImageloader.downloadImage( getActivity(), event.imageUrl, new IMogoImageLoaderListener() {
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMarkerInfo(final MarkerInfo event) {
|
||||
Logger.d(TAG, "onMarkerInfo ------>");
|
||||
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_search_poi_location);
|
||||
mogoImageloader.downloadImage(getActivity(), event.imageUrl, new IMogoImageLoaderListener() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
Logger.d( TAG, "onMarkerInfo onStart ------>" );
|
||||
Logger.d(TAG, "onMarkerInfo onStart ------>");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompleted( Bitmap bitmap ) {
|
||||
Logger.d( TAG, "onMarkerInfo onCompleted ------>" );
|
||||
public void onCompleted(Bitmap bitmap) {
|
||||
Logger.d(TAG, "onMarkerInfo onCompleted ------>");
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.icon( mMarkerIcon )
|
||||
.latitude( event.lat )
|
||||
.owner( TanluConstants.MODEL_NAME )
|
||||
.longitude( event.lon );
|
||||
.icon(mMarkerIcon)
|
||||
.latitude(event.lat)
|
||||
.owner(TanluConstants.MODEL_NAME)
|
||||
.longitude(event.lon);
|
||||
|
||||
mMogoMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( getContext() );
|
||||
mMarkerManager = mMogoMapService.getMarkerManager( getContext() );
|
||||
IMogoMarker marker = mMarkerManager.addMarker( TanluConstants.MODEL_NAME, options );
|
||||
mMogoMapService = (IMogoMapService) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_MAP).navigation(getContext());
|
||||
mMarkerManager = mMogoMapService.getMarkerManager(getContext());
|
||||
IMogoMarker marker = mMarkerManager.addMarker(TanluConstants.MODEL_NAME, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure( Exception e ) {
|
||||
Logger.e( TAG, "onMarkerInfo onFailure -----e =" + e );
|
||||
public void onFailure(Exception e) {
|
||||
Logger.e(TAG, "onMarkerInfo onFailure -----e =" + e);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -656,107 +676,107 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
public void getNavigationLineData() {
|
||||
Double lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
|
||||
Double lon = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLongitude();
|
||||
Logger.e( TAG, "getNavigationLineData lon = " + lon + ">>>>> lat= " + lat );
|
||||
mTanluModelData.getNavigationLineData( lon, lat, new AlongTheWayCallback() {
|
||||
Logger.e(TAG, "getNavigationLineData lon = " + lon + ">>>>> lat= " + lat);
|
||||
mTanluModelData.getNavigationLineData(lon, lat, new AlongTheWayCallback() {
|
||||
@Override
|
||||
public void onSuccess( InformationAndLiveCarResult data ) {
|
||||
Logger.d( TAG, "getNavigationLineData onSuccess " );
|
||||
public void onSuccess(InformationAndLiveCarResult data) {
|
||||
Logger.d(TAG, "getNavigationLineData onSuccess ");
|
||||
//不做任何处理,直接出发推送,重新请求接口,划线
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail( String message, int code ) {
|
||||
Logger.e( TAG, "getNavigationLineData onFail message = " + message + ">>>code= " + code );
|
||||
public void onFail(String message, int code) {
|
||||
Logger.e(TAG, "getNavigationLineData onFail message = " + message + ">>>code= " + code);
|
||||
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通勤族 事件,监听消息自己请求路线数据
|
||||
*/
|
||||
public void getRoadLineData() {
|
||||
mTanluModelData.getRoadLineData( new RoadLineCallback() {
|
||||
mTanluModelData.getRoadLineData(new RoadLineCallback() {
|
||||
@Override
|
||||
public void onSuccess( PathLineResult o ) {
|
||||
public void onSuccess(PathLineResult o) {
|
||||
//绘制线路线
|
||||
if ( o != null && o.getPointList() != null && o.getPointList().size() > 0 ) {
|
||||
drawMapLine( o.getPointList() );
|
||||
if (o != null && o.getPointList() != null && o.getPointList().size() > 0) {
|
||||
drawMapLine(o.getPointList());
|
||||
} else {
|
||||
Logger.e( TAG, "getRoadLineData onSuccess o.getPointList() == null" );
|
||||
Logger.e(TAG, "getRoadLineData onSuccess o.getPointList() == null");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail( String message, int code ) {
|
||||
Logger.d( TAG, "getRoadLineData onFail message =" + message + ">>>code =" + code );
|
||||
public void onFail(String message, int code) {
|
||||
Logger.d(TAG, "getRoadLineData onFail message =" + message + ">>>code =" + code);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航路线,监听消息自己请求路线数据
|
||||
*/
|
||||
public void getNaviRoadLineInfo() {
|
||||
mTanluModelData.getNaviRoadLineInfo( new RoadLineCallback() {
|
||||
mTanluModelData.getNaviRoadLineInfo(new RoadLineCallback() {
|
||||
@Override
|
||||
public void onSuccess( PathLineResult o ) {
|
||||
public void onSuccess(PathLineResult o) {
|
||||
//绘制线路线
|
||||
if ( o != null && o.getPointList() != null && o.getPointList().size() > 0 ) {
|
||||
drawMapLine( o.getPointList() );
|
||||
if (o != null && o.getPointList() != null && o.getPointList().size() > 0) {
|
||||
drawMapLine(o.getPointList());
|
||||
} else {
|
||||
Logger.e( TAG, "getNaviRoadLineInfo onSuccess o.getPointList() == null" );
|
||||
Logger.e(TAG, "getNaviRoadLineInfo onSuccess o.getPointList() == null");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail( String message, int code ) {
|
||||
Logger.d( TAG, "getNaviRoadLineInfo onFail message =" + message + ">>>code =" + code );
|
||||
public void onFail(String message, int code) {
|
||||
Logger.d(TAG, "getNaviRoadLineInfo onFail message =" + message + ">>>code =" + code);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制线路
|
||||
*/
|
||||
private void drawMapLine( List< Center > pointList ) {
|
||||
int intervalNum = Utils.getIntervalValue( pointList.size() );
|
||||
Logger.d( TAG, "drawMapLine intervalNum = $intervalNum -- pointList.size = ${pointList.size}" );
|
||||
private void drawMapLine(List<Center> pointList) {
|
||||
int intervalNum = Utils.getIntervalValue(pointList.size());
|
||||
Logger.d(TAG, "drawMapLine intervalNum = $intervalNum -- pointList.size = ${pointList.size}");
|
||||
int listSize = pointList.size();
|
||||
|
||||
//沿途最多15个点
|
||||
for ( int i = 0; i < listSize; i += intervalNum ) {
|
||||
passedByPoints.add( new MogoLatLng( pointList.get( i ).getLat(), ( pointList.get( i ).getLon() ) ) );
|
||||
for (int i = 0; i < listSize; i += intervalNum) {
|
||||
passedByPoints.add(new MogoLatLng(pointList.get(i).getLat(), (pointList.get(i).getLon())));
|
||||
}
|
||||
|
||||
Logger.d( TAG, "drawMapLine passedByPoints.size() ----> " + passedByPoints.size() );
|
||||
MogoLatLng startLatLng = new MogoLatLng( pointList.get( 0 ).getLat(), pointList.get( 0 ).getLon() );
|
||||
MogoLatLng endLatLng = new MogoLatLng( pointList.get( listSize - 1 ).getLat(), pointList.get( listSize - 1 ).getLon() );
|
||||
mMarkerManager.addRouteWay( getContext(), startLatLng, endLatLng, passedByPoints );
|
||||
Logger.d(TAG, "drawMapLine passedByPoints.size() ----> " + passedByPoints.size());
|
||||
MogoLatLng startLatLng = new MogoLatLng(pointList.get(0).getLat(), pointList.get(0).getLon());
|
||||
MogoLatLng endLatLng = new MogoLatLng(pointList.get(listSize - 1).getLat(), pointList.get(listSize - 1).getLon());
|
||||
mMarkerManager.addRouteWay(getContext(), startLatLng, endLatLng, passedByPoints);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 声音控制道路数据
|
||||
*/
|
||||
public void getVoiceControlRoadData( String keywords ) {
|
||||
public void getVoiceControlRoadData(String keywords) {
|
||||
Double lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
|
||||
Double lon = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLongitude();
|
||||
String cityCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getCityCode();
|
||||
String adCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getAdCode();
|
||||
Logger.d( TAG, "getVoiceControlRoadData lat =" + lat + ">>>lon =" + lon + ">>>cityCode=" + cityCode + ">>>adCode =" + adCode );
|
||||
mTanluModelData.getVoiceControlRoadData( keywords, cityCode, lon, lat, adCode, new VoiceSearchCallback() {
|
||||
Logger.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 ) {
|
||||
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 );
|
||||
Logger.d(TAG, "getVoiceControlRoadData discription = " + discription);
|
||||
if (o.getInformations() != null && o.getInformations().size() > 0) {
|
||||
speakSuccessVoice(o.getInformations(), discription == null ? "" : discription);
|
||||
} else {
|
||||
if ( !TextUtils.isEmpty( discription ) ) {
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( discription, null );
|
||||
if (!TextUtils.isEmpty(discription)) {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(discription, null);
|
||||
} else {
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "未找到其他车主分享的路况信息", null );
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice("未找到其他车主分享的路况信息", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -768,70 +788,70 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail( String message, int code ) {
|
||||
Logger.e( TAG, "getVoiceControlRoadData onFail message = " + message + ">>>code= " + code );
|
||||
speakFailVoice( searchfaileVoiceStrings[2] );
|
||||
public void onFail(String message, int code) {
|
||||
Logger.e(TAG, "getVoiceControlRoadData onFail message = " + message + ">>>code= " + code);
|
||||
speakFailVoice(searchfaileVoiceStrings[2]);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
Random random = new Random();
|
||||
|
||||
private void speakSuccessVoice( List< Information > informations, String trafficStatus ) {
|
||||
switch ( informations.size() ) {
|
||||
private void speakSuccessVoice(List<Information> informations, String trafficStatus) {
|
||||
switch (informations.size()) {
|
||||
case 0:
|
||||
Logger.d( TAG, "speakSuccessVoice ----> " + random.nextInt( 3 ) );
|
||||
speakFailVoice( searchfaileVoiceStrings[random.nextInt( 3 )] );
|
||||
Logger.d(TAG, "speakSuccessVoice ----> " + random.nextInt(3));
|
||||
speakFailVoice(searchfaileVoiceStrings[random.nextInt(3)]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
trackVoiceSearch( 1 );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( (
|
||||
String.format( voiceGetInfoMationTts, "1" ) + trafficStatus ), null );
|
||||
trackVoiceSearch(1);
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice((
|
||||
String.format(voiceGetInfoMationTts, "1") + trafficStatus), null);
|
||||
|
||||
case 2:
|
||||
trackVoiceSearch( 1 );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( (
|
||||
trackVoiceSearch(1);
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice((
|
||||
String.format(
|
||||
voiceGetInfoMationTts,
|
||||
"2"
|
||||
) + trafficStatus ), null );
|
||||
) + trafficStatus), null);
|
||||
|
||||
|
||||
case 3:
|
||||
trackVoiceSearch( 1 );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( (
|
||||
trackVoiceSearch(1);
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice((
|
||||
String.format(
|
||||
voiceGetInfoMationTts,
|
||||
"3"
|
||||
) + trafficStatus ), null );
|
||||
) + trafficStatus), null);
|
||||
|
||||
default:
|
||||
trackVoiceSearch( 1 );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( (
|
||||
trackVoiceSearch(1);
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice((
|
||||
String.format(
|
||||
voiceGetInfoMationTts,
|
||||
"多"
|
||||
) + trafficStatus ), null );
|
||||
) + trafficStatus), null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void initStrings() {
|
||||
voiceGetInfoMationTts =
|
||||
getContext().getResources().getString( R.string.voice_get_informations_tts );
|
||||
getContext().getResources().getString(R.string.voice_get_informations_tts);
|
||||
searchingVoiceStrings =
|
||||
getContext().getResources().getStringArray( R.array.searching_voice_string_array );
|
||||
getContext().getResources().getStringArray(R.array.searching_voice_string_array);
|
||||
searchfaileVoiceStrings =
|
||||
getContext().getResources().getStringArray( R.array.search_fail_voice_array );
|
||||
getContext().getResources().getStringArray(R.array.search_fail_voice_array);
|
||||
}
|
||||
|
||||
private void speakFailVoice( String string ) {
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( string, null );
|
||||
private void speakFailVoice(String string) {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(string, null);
|
||||
}
|
||||
|
||||
//上报语音搜索
|
||||
private void trackVoiceSearch( int type ) {
|
||||
private void trackVoiceSearch(int type) {
|
||||
|
||||
}
|
||||
|
||||
|
||||