优化家和公司的地址
This commit is contained in:
@@ -201,7 +201,6 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mCommonAddress.setVisibility( View.GONE );
|
||||
mNaviInfo.setVisibility( View.VISIBLE );
|
||||
mExitNavi.setVisibility( View.VISIBLE );
|
||||
AnalyticsUtils.track( "Navigation_guide_type", new HashMap<>() );
|
||||
|
||||
mMApUIController.setPointToCenter( 0.675926, 0.77552 );
|
||||
}
|
||||
@@ -212,8 +211,6 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mNaviInfo.setVisibility( View.GONE );
|
||||
mExitNavi.setVisibility( View.GONE );
|
||||
mSpeedLimit.setVisibility( View.GONE );
|
||||
AnalyticsUtils.track( "Navigation_guide_type", new HashMap<>() );
|
||||
|
||||
mMApUIController.setPointToCenter( 0.66145, 0.590688 );
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.main.assist.MapBroadCastHelper;
|
||||
import com.mogo.module.main.cards.CardModulesAdapter;
|
||||
import com.mogo.module.main.cards.MogoModulesHandler;
|
||||
import com.mogo.module.main.cards.MogoModulesManager;
|
||||
@@ -311,6 +312,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.mogo.module.main.assist;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
|
||||
/**
|
||||
* @author zyz
|
||||
* 2020-01-17.
|
||||
*/
|
||||
public class MapBroadCastHelper {
|
||||
|
||||
private static volatile MapBroadCastHelper sInstance;
|
||||
private static final String ACTION_NAV_SEND = "AUTONAVI_STANDARD_BROADCAST_SEND";
|
||||
private static final int STATUS_NAV_FRONT = 3;
|
||||
private static final int STATUS_NAV_BACKGROUND = 4;
|
||||
private static final int STATUS_NAV_START = 8;
|
||||
private static final int STATUS_NAV_STOP = 9;
|
||||
private Context context;
|
||||
|
||||
private MapBroadCastHelper(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public static MapBroadCastHelper getInstance( Context context ) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MapBroadCastHelper.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MapBroadCastHelper( context );
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public void notifyXiaozhi(MogoNaviInfo naviinfo) {
|
||||
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("ICON", naviinfo.getIconResId());
|
||||
context.sendBroadcast(intent);
|
||||
Log.v("MapBroadCastHelper","action="+ACTION_NAV_SEND+"NaviInfo");
|
||||
}
|
||||
|
||||
|
||||
public void notifyXizhiNavStatus(int status) {
|
||||
//Intent intent =new Intent(ACTION_NAV_SEND);
|
||||
//intent.putExtra("KEY_TYPE", 10019);
|
||||
//intent.putExtra("EXTRA_STATE", status);
|
||||
//intent.putExtra("SOURCE_APP", context.getPackageName());
|
||||
//context.sendBroadcast(intent);
|
||||
Log.v("MapBroadCastHelper","NavStatus="+status);
|
||||
|
||||
}
|
||||
|
||||
public void mapFrount(){
|
||||
notifyXizhiNavStatus(STATUS_NAV_FRONT);
|
||||
}
|
||||
|
||||
public void mapBackground(){
|
||||
notifyXizhiNavStatus(STATUS_NAV_BACKGROUND);
|
||||
}
|
||||
|
||||
public void startNavi(){
|
||||
notifyXizhiNavStatus(STATUS_NAV_START);
|
||||
}
|
||||
|
||||
public void stopNavi(){
|
||||
notifyXizhiNavStatus(STATUS_NAV_STOP);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -26,7 +26,10 @@ import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.extensions.ExtensionsModuleConst;
|
||||
import com.mogo.module.main.MainActivity;
|
||||
import com.mogo.module.main.assist.MapBroadCastHelper;
|
||||
import com.mogo.module.main.registercenter.MogoRegisterCenterHandler;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.module.ModuleType;
|
||||
@@ -54,7 +57,8 @@ public class MogoModulesManager implements MogoModulesHandler,
|
||||
|
||||
private MainActivity mActivity;
|
||||
|
||||
private Map< MogoModule, IMogoModuleProvider > mModuleProviders = new HashMap<>();
|
||||
private Map<MogoModule, IMogoModuleProvider> mModuleProviders = new HashMap<>();
|
||||
private IMogoAnalytics mTrackManager;
|
||||
|
||||
private String mEnableModuleName = null;
|
||||
private Runnable mMapLoadedCallback;
|
||||
@@ -66,6 +70,10 @@ public class MogoModulesManager implements MogoModulesHandler,
|
||||
throw new NullPointerException( "activity can't be null." );
|
||||
}
|
||||
this.mActivity = activity;
|
||||
mTrackManager = (IMogoAnalytics) ARouter.getInstance()
|
||||
.build(MogoServicePaths.PATH_UTILS_ANALYTICS)
|
||||
.navigation();
|
||||
|
||||
registerReceiver();
|
||||
}
|
||||
|
||||
@@ -357,9 +365,12 @@ public class MogoModulesManager implements MogoModulesHandler,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate( MogoNaviInfo naviinfo ) {
|
||||
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
|
||||
if ( iterator == null ) {
|
||||
public void onNaviInfoUpdate(MogoNaviInfo naviinfo) {
|
||||
MapBroadCastHelper.getInstance(getApplicationContext()).notifyXiaozhi(naviinfo);
|
||||
Iterator<IMogoNaviListener> iterator =
|
||||
MogoRegisterCenterHandler.getInstance().getNaviListeners();
|
||||
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while ( iterator.hasNext() ) {
|
||||
@@ -376,8 +387,12 @@ public class MogoModulesManager implements MogoModulesHandler,
|
||||
|
||||
@Override
|
||||
public void onStartNavi() {
|
||||
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
|
||||
if ( iterator == null ) {
|
||||
Iterator<IMogoNaviListener> iterator =
|
||||
MogoRegisterCenterHandler.getInstance().getNaviListeners();
|
||||
mTrackManager.track("Navigation_begin", new HashMap<>());
|
||||
|
||||
MapBroadCastHelper.getInstance(getApplicationContext()).startNavi();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while ( iterator.hasNext() ) {
|
||||
@@ -394,8 +409,11 @@ public class MogoModulesManager implements MogoModulesHandler,
|
||||
|
||||
@Override
|
||||
public void onStopNavi() {
|
||||
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
|
||||
if ( iterator == null ) {
|
||||
mTrackManager.track("Navigation_end", new HashMap<>());
|
||||
MapBroadCastHelper.getInstance(getApplicationContext()).stopNavi();
|
||||
Iterator<IMogoNaviListener> iterator =
|
||||
MogoRegisterCenterHandler.getInstance().getNaviListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while ( iterator.hasNext() ) {
|
||||
|
||||
@@ -208,13 +208,13 @@ public class MapPresenter extends Presenter< MapView > implements
|
||||
// }
|
||||
|
||||
case VoiceConstants.CMD_MAP_SPEAK_DRAFT_MODE:
|
||||
//mSearchManager.speakDraft();
|
||||
mSearchManager.speakDraft();
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice("已切换", null);
|
||||
|
||||
break;
|
||||
|
||||
case VoiceConstants.CMD_MAP_SPEAK_DETAIL_MODE:
|
||||
//mSearchManager.speakDetail();
|
||||
mSearchManager.speakDetail();
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice("已切换", null);
|
||||
|
||||
break;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<activity android:name=".ui.NaviActivity"></activity>
|
||||
<provider
|
||||
android:name=".cp.AddressContentProvider"
|
||||
android:authorities="com.mogo.module.navi"
|
||||
android:authorities="com.zhidao.auto.personal.provider"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
</application>
|
||||
|
||||
@@ -112,20 +112,20 @@ object AddressManager {
|
||||
}
|
||||
|
||||
fun deleteHome(){
|
||||
homeAddress=null
|
||||
Observable.create(
|
||||
ObservableOnSubscribe<String> {
|
||||
poiDao.delete(homeAddress)
|
||||
homeAddress=null
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe()
|
||||
}
|
||||
|
||||
fun deleteCompany(){
|
||||
companyAddress=null
|
||||
Observable.create(
|
||||
ObservableOnSubscribe<String> {
|
||||
poiDao.delete(companyAddress)
|
||||
companyAddress=null
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe()
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.mogo.module.navi.manager;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.constants.BroadcastMode;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.navi.constants.SearchServiceHolder;
|
||||
import com.mogo.module.navi.ui.search.CategorySearchFragment;
|
||||
import com.mogo.module.navi.ui.search.SearchFragment;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.fragmentmanager.FragmentDescriptor;
|
||||
@@ -37,6 +40,23 @@ public class MogoSearchManager implements IMogoSearchManager {
|
||||
.clearAll();
|
||||
}
|
||||
|
||||
@Override public void speakDraft() {
|
||||
SearchServiceHolder.INSTANCE.getNavi().setBroadcastMode(BroadcastMode.CONCISE);
|
||||
}
|
||||
|
||||
@Override public void speakDetail() {
|
||||
SearchServiceHolder.INSTANCE.getNavi().setBroadcastMode(BroadcastMode.DETAIL);
|
||||
}
|
||||
|
||||
@Override public void showCategory(String keyword) {
|
||||
Fragment searchFragment = CategorySearchFragment.Companion.newInstance(keyword);
|
||||
SearchServiceHolder.INSTANCE.getFragmentManager()
|
||||
.push(new FragmentDescriptor.Builder().fragment(searchFragment)
|
||||
.tag(MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY)
|
||||
.notifyMainModule(true)
|
||||
.build());
|
||||
}
|
||||
|
||||
@Override public void init(Context context) {
|
||||
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ class SettingAddressFragment : BaseFragment(), IMogoGeoSearchListener {
|
||||
override fun onRegeocodeSearched(regeocodeResult: MogoRegeocodeResult?) {
|
||||
et_navi_search.setText(regeocodeResult?.regeocodeAddress?.formatAddress)
|
||||
selectPoi?.address=regeocodeResult?.regeocodeAddress?.formatAddress
|
||||
selectPoi?.name=regeocodeResult?.regeocodeAddress?.building
|
||||
}
|
||||
|
||||
override fun onGeocodeSearched(geocodeResult: MogoGeocodeResult?) {
|
||||
|
||||
@@ -12,4 +12,7 @@ public interface IMogoSearchManager extends IProvider {
|
||||
void goCompany();
|
||||
void showSearch();
|
||||
void showMain();
|
||||
void speakDraft();
|
||||
void speakDetail();
|
||||
void showCategory(String keyword);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user