剩余的语音指令
This commit is contained in:
@@ -63,7 +63,7 @@ public class MogoNaviInfo implements Parcelable {
|
||||
return currentRoadName;
|
||||
}
|
||||
|
||||
public void setCurrentRoadName( String currentRoadName ) {
|
||||
public void setCurrentRoadName(String currentRoadName) {
|
||||
this.currentRoadName = currentRoadName;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class MogoNaviInfo implements Parcelable {
|
||||
return currentSpeed;
|
||||
}
|
||||
|
||||
public void setCurrentSpeed( int currentSpeed ) {
|
||||
public void setCurrentSpeed(int currentSpeed) {
|
||||
this.currentSpeed = currentSpeed;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class MogoNaviInfo implements Parcelable {
|
||||
return curStepRetainDistance;
|
||||
}
|
||||
|
||||
public void setCurStepRetainDistance( int curStepRetainDistance ) {
|
||||
public void setCurStepRetainDistance(int curStepRetainDistance) {
|
||||
this.curStepRetainDistance = curStepRetainDistance;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class MogoNaviInfo implements Parcelable {
|
||||
return curStepRetainTime;
|
||||
}
|
||||
|
||||
public void setCurStepRetainTime( int curStepRetainTime ) {
|
||||
public void setCurStepRetainTime(int curStepRetainTime) {
|
||||
this.curStepRetainTime = curStepRetainTime;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class MogoNaviInfo implements Parcelable {
|
||||
return iconResId;
|
||||
}
|
||||
|
||||
public void setIconResId( int iconResId ) {
|
||||
public void setIconResId(int iconResId) {
|
||||
this.iconResId = iconResId;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public class MogoNaviInfo implements Parcelable {
|
||||
return nextRoadName;
|
||||
}
|
||||
|
||||
public void setNextRoadName( String nextRoadName ) {
|
||||
public void setNextRoadName(String nextRoadName) {
|
||||
this.nextRoadName = nextRoadName;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class MogoNaviInfo implements Parcelable {
|
||||
return pathRetainTime;
|
||||
}
|
||||
|
||||
public void setPathRetainTime( int pathRetainTime ) {
|
||||
public void setPathRetainTime(int pathRetainTime) {
|
||||
this.pathRetainTime = pathRetainTime;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,38 @@ public class MogoNaviInfo implements Parcelable {
|
||||
return pathRetainDistance;
|
||||
}
|
||||
|
||||
public void setPathRetainDistance( int pathRetainDistance ) {
|
||||
public String getVoiceRetainDistance() {
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (pathRetainDistance >= 1000) {
|
||||
builder.append(String.format("%.1f公里", pathRetainDistance / 1000f));
|
||||
} else {
|
||||
builder.append(pathRetainDistance).append("米");
|
||||
}
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public String getVoiceRetainTime() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
int seconds = pathRetainTime;
|
||||
int days = seconds / (24 * 60 * 60);
|
||||
if (days > 0) {
|
||||
builder.append(days).append("天");
|
||||
}
|
||||
seconds -= days * 24 * 60 * 60;
|
||||
int hours = seconds / (60 * 60);
|
||||
if (hours > 0) {
|
||||
builder.append(hours).append("小时");
|
||||
}
|
||||
seconds -= hours * 60 * 60;
|
||||
int min = seconds / 60;
|
||||
builder.append(min > 1 ? min : 1).append("分钟");
|
||||
return builder.toString();
|
||||
|
||||
}
|
||||
|
||||
public void setPathRetainDistance(int pathRetainDistance) {
|
||||
this.pathRetainDistance = pathRetainDistance;
|
||||
}
|
||||
|
||||
@@ -127,7 +158,7 @@ public class MogoNaviInfo implements Parcelable {
|
||||
return currentLimitSpeed;
|
||||
}
|
||||
|
||||
public void setCurrentLimitSpeed( float currentLimitSpeed ) {
|
||||
public void setCurrentLimitSpeed(float currentLimitSpeed) {
|
||||
this.currentLimitSpeed = currentLimitSpeed;
|
||||
}
|
||||
|
||||
@@ -137,22 +168,22 @@ public class MogoNaviInfo implements Parcelable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeString( this.currentRoadName );
|
||||
dest.writeInt( this.currentSpeed );
|
||||
dest.writeInt( this.curStepRetainDistance );
|
||||
dest.writeInt( this.curStepRetainTime );
|
||||
dest.writeInt( this.iconResId );
|
||||
dest.writeString( this.nextRoadName );
|
||||
dest.writeInt( this.pathRetainTime );
|
||||
dest.writeInt( this.pathRetainDistance );
|
||||
dest.writeFloat( this.currentLimitSpeed );
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(this.currentRoadName);
|
||||
dest.writeInt(this.currentSpeed);
|
||||
dest.writeInt(this.curStepRetainDistance);
|
||||
dest.writeInt(this.curStepRetainTime);
|
||||
dest.writeInt(this.iconResId);
|
||||
dest.writeString(this.nextRoadName);
|
||||
dest.writeInt(this.pathRetainTime);
|
||||
dest.writeInt(this.pathRetainDistance);
|
||||
dest.writeFloat(this.currentLimitSpeed);
|
||||
}
|
||||
|
||||
public MogoNaviInfo() {
|
||||
}
|
||||
|
||||
protected MogoNaviInfo( Parcel in ) {
|
||||
protected MogoNaviInfo(Parcel in) {
|
||||
this.currentRoadName = in.readString();
|
||||
this.currentSpeed = in.readInt();
|
||||
this.curStepRetainDistance = in.readInt();
|
||||
@@ -164,14 +195,14 @@ public class MogoNaviInfo implements Parcelable {
|
||||
this.currentLimitSpeed = in.readFloat();
|
||||
}
|
||||
|
||||
public static final Creator< MogoNaviInfo > CREATOR = new Creator< MogoNaviInfo >() {
|
||||
public static final Creator<MogoNaviInfo> CREATOR = new Creator<MogoNaviInfo>() {
|
||||
@Override
|
||||
public MogoNaviInfo createFromParcel( Parcel source ) {
|
||||
return new MogoNaviInfo( source );
|
||||
public MogoNaviInfo createFromParcel(Parcel source) {
|
||||
return new MogoNaviInfo(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoNaviInfo[] newArray( int size ) {
|
||||
public MogoNaviInfo[] newArray(int size) {
|
||||
return new MogoNaviInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -263,7 +263,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
if ( isLock ) {
|
||||
mExitNavi.setText( R.string.module_ext_str_exit_navi );
|
||||
} else {
|
||||
mExitNavi.setText( R.string.module_ext_str_continue_navi );
|
||||
mExitNavi.setText( R.string.module_ext_str_exit_path );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,4 +19,5 @@
|
||||
<string name="module_map_str_upload_road_condition">分享</string>
|
||||
<string name="module_ext_str_exit_navi">退出导航</string>
|
||||
<string name="module_ext_str_continue_navi">继续导航</string>
|
||||
<string name="module_ext_str_exit_path">退出全览</string>
|
||||
</resources>
|
||||
|
||||
@@ -38,8 +38,8 @@ public class MapBroadCastHelper {
|
||||
Intent intent = new Intent(ACTION_NAV_SEND);
|
||||
intent.putExtra("KEY_TYPE", 10001);
|
||||
intent.putExtra("NEXT_ROAD_NAME", naviinfo.getNextRoadName());
|
||||
intent.putExtra("ROUTE_REMAIN_TIME", naviinfo.getPathRetainTime());
|
||||
intent.putExtra("ROUTE_REMAIN_DIS", naviinfo.getPathRetainDistance());
|
||||
intent.putExtra("ROUTE_REMAIN_TIME_AUTO", naviinfo.getVoiceRetainTime());
|
||||
intent.putExtra("ROUTE_REMAIN_DIS_AUTO", naviinfo.getVoiceRetainDistance());
|
||||
intent.putExtra("ICON", naviinfo.getIconResId());
|
||||
context.sendBroadcast(intent);
|
||||
Log.v("MapBroadCastHelper","action="+ACTION_NAV_SEND+"NaviInfo");
|
||||
|
||||
@@ -101,7 +101,38 @@ public class MapPresenter extends Presenter<MapView> implements
|
||||
if (extra_endurance_data) {
|
||||
mView.getUIController().recoverLockMode();
|
||||
}
|
||||
} else if (key_type == 10006) {
|
||||
|
||||
int extra_is_show = intent.getIntExtra("EXTRA_IS_SHOW", 0);
|
||||
|
||||
if (extra_is_show == 0) {
|
||||
mView.getUIController().displayOverview();
|
||||
} else {
|
||||
mView.getUIController().recoverLockMode();
|
||||
}
|
||||
}else if (key_type == 10005){
|
||||
int navi_route_prefer = intent.getIntExtra("NAVI_ROUTE_PREFER", type);
|
||||
|
||||
|
||||
}
|
||||
|
||||
///**
|
||||
// * 仅在导航场景下,⽀持第三⽅进⾏路线偏好的重新选择。
|
||||
// * `避免收费` |`1` `多策略算路` |`2` `不走高速` |`3` ` 躲避拥堵` |`4` `不走高速且避免收费` |`5` `不走高速且躲避拥堵` |`6`
|
||||
// * `躲避收费和拥堵` |`7` `不走高速躲避收费和拥堵` |`8` `高速优先` |`20` `躲避拥堵且高速优先` |`24`
|
||||
// *
|
||||
// * @param context
|
||||
// * @param type
|
||||
// */
|
||||
//public static void setUserPreference(Context context, int type) {
|
||||
// Intent intent = new Intent();
|
||||
// intent.setAction("AUTONAVI_STANDARD_BROADCAST_RECV");
|
||||
// intent.putExtra("KEY_TYPE", 10005);
|
||||
// intent.putExtra("NAVI_ROUTE_PREFER", type);
|
||||
// context.sendBroadcast(intent);
|
||||
//}
|
||||
//
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.module.navi.ui.search
|
||||
|
||||
import android.app.Service
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
@@ -103,6 +104,7 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener {
|
||||
tv_navi_navi.setOnClickListener {
|
||||
SearchServiceHolder.getNavi()
|
||||
.startNavi(false)
|
||||
SearchServiceHolder.getMapUIController().recoverLockMode()
|
||||
isStartedNavi = true
|
||||
SearchServiceHolder.fragmentManager.clearAll()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user