opt
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.mogo.service.module;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author zyz
|
||||
@@ -8,6 +9,32 @@ import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
*/
|
||||
public interface IMogoAddressManager extends IProvider {
|
||||
|
||||
/**
|
||||
* 回家
|
||||
*/
|
||||
void goHome();
|
||||
|
||||
/**
|
||||
* 去公司
|
||||
*/
|
||||
void goCompany();
|
||||
|
||||
/**
|
||||
* 打开搜索
|
||||
*/
|
||||
void goSearch();
|
||||
|
||||
/**
|
||||
* 规划路线
|
||||
*
|
||||
* @param destination 目的地
|
||||
*/
|
||||
void calculatePath( MogoLatLng destination );
|
||||
|
||||
/**
|
||||
* 分类搜索
|
||||
*/
|
||||
void categorySearch(String category);
|
||||
|
||||
void goSettings();
|
||||
}
|
||||
|
||||
@@ -84,6 +84,12 @@ public interface IMogoStatusManager extends IProvider {
|
||||
*/
|
||||
boolean isAIAssistReady();
|
||||
|
||||
/**
|
||||
* 求助状态
|
||||
* @return
|
||||
*/
|
||||
boolean isSeekHelping();
|
||||
|
||||
/**
|
||||
* 设置小智语音UI状态
|
||||
*
|
||||
@@ -166,6 +172,13 @@ public interface IMogoStatusManager extends IProvider {
|
||||
*/
|
||||
void setAIAssistReady( String tag, boolean ready );
|
||||
|
||||
/**
|
||||
* 设置求助状态
|
||||
* @param tag
|
||||
* @param seekHelping
|
||||
*/
|
||||
void setSeekHelping(String tag, boolean seekHelping);
|
||||
|
||||
/**
|
||||
* 注册监听
|
||||
*
|
||||
|
||||
@@ -59,5 +59,10 @@ public enum StatusDescriptor {
|
||||
/**
|
||||
* 小智语音状态
|
||||
*/
|
||||
AI_ASSIST_READY;
|
||||
AI_ASSIST_READY,
|
||||
|
||||
/**
|
||||
* 求助状态
|
||||
*/
|
||||
SEEK_HELPING;
|
||||
}
|
||||
|
||||
@@ -99,6 +99,12 @@ public class MogoStatusManager implements IMogoStatusManager {
|
||||
return get_bool_val( StatusDescriptor.AI_ASSIST_READY );
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isSeekHelping() {
|
||||
return get_bool_val( StatusDescriptor.SEEK_HELPING );
|
||||
}
|
||||
|
||||
private boolean get_bool_val( StatusDescriptor descriptor ) {
|
||||
Boolean val = mStatus.get( descriptor );
|
||||
return val == null ? false : val;
|
||||
@@ -177,6 +183,13 @@ public class MogoStatusManager implements IMogoStatusManager {
|
||||
recordStatusModifier( tag, StatusDescriptor.AI_ASSIST_READY );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSeekHelping( String tag, boolean seekHelping ) {
|
||||
mStatus.put( StatusDescriptor.SEEK_HELPING, seekHelping );
|
||||
invokeStatusChangedListener( StatusDescriptor.SEEK_HELPING, seekHelping );
|
||||
recordStatusModifier( tag, StatusDescriptor.SEEK_HELPING );
|
||||
}
|
||||
|
||||
private void invokeStatusChangedListener( StatusDescriptor descriptor, boolean status ) {
|
||||
if ( mListeners.containsKey( descriptor ) ) {
|
||||
Iterator< IMogoStatusChangedListener > iterator = mListeners.get( descriptor ).iterator();
|
||||
|
||||
Reference in New Issue
Block a user