Merge branch 'feature/v1.0.3' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into feature/v1.0.3
This commit is contained in:
@@ -14,6 +14,7 @@ import android.view.MotionEvent;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.animation.Interpolator;
|
import android.view.animation.Interpolator;
|
||||||
|
|
||||||
|
import com.alibaba.idst.nls.internal.utils.L;
|
||||||
import com.amap.api.maps.AMap;
|
import com.amap.api.maps.AMap;
|
||||||
import com.amap.api.maps.AMapUtils;
|
import com.amap.api.maps.AMapUtils;
|
||||||
import com.amap.api.maps.CameraUpdateFactory;
|
import com.amap.api.maps.CameraUpdateFactory;
|
||||||
@@ -462,8 +463,10 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
|||||||
break;
|
break;
|
||||||
case NorthUP_2D:
|
case NorthUP_2D:
|
||||||
mMapView.setNaviMode( AMapNaviView.NORTH_UP_MODE );
|
mMapView.setNaviMode( AMapNaviView.NORTH_UP_MODE );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Logger.d(TAG,"mCurrentUIMode--->"+mCurrentUIMode.name());
|
||||||
if ( options == null ) {
|
if ( options == null ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ public class AppNavigatorFragment extends MvpFragment<AppNavigatorView, AppNavig
|
|||||||
|
|
||||||
if (Math.abs(index) == 1) {
|
if (Math.abs(index) == 1) {
|
||||||
scroller.smoothScrollBy(getResources().getDimensionPixelSize(R.dimen.dp_137) * index,
|
scroller.smoothScrollBy(getResources().getDimensionPixelSize(R.dimen.dp_137) * index,
|
||||||
0);
|
0,null,10);
|
||||||
} else {
|
} else {
|
||||||
layoutManager.startSmoothPendingScroll(layoutManager.getCurrentPosition() + index);
|
layoutManager.startSmoothPendingScroll(layoutManager.getCurrentPosition() + index);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ import com.mogo.module.authorize.util.AnalyticsUtil
|
|||||||
import com.mogo.module.authorize.util.AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK
|
import com.mogo.module.authorize.util.AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK
|
||||||
import com.mogo.module.authorize.util.AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_SHOW
|
import com.mogo.module.authorize.util.AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_SHOW
|
||||||
import com.mogo.module.authorize.voice.IVoiceCommandListener
|
import com.mogo.module.authorize.voice.IVoiceCommandListener
|
||||||
import com.mogo.module.authorize.voice.IVoiceIntentListener
|
import com.mogo.module.authorize.voice.IVoiceAuthorizeIntentListener
|
||||||
import com.mogo.module.authorize.voice.VoiceUtil
|
import com.mogo.module.authorize.voice.VoiceUtil
|
||||||
import com.mogo.utils.logger.Logger
|
import com.mogo.utils.logger.Logger
|
||||||
|
|
||||||
class AuthorizeFragment : MvpFragment<AuthorizeContract.View, AuthorizePresenter>(), AuthorizeContract.View, View.OnClickListener, IVoiceCommandListener, IVoiceIntentListener {
|
class AuthorizeFragment : MvpFragment<AuthorizeContract.View, AuthorizePresenter>(), AuthorizeContract.View, View.OnClickListener, IVoiceCommandListener, IVoiceAuthorizeIntentListener {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val TAG = "AuthorizeFragment"
|
const val TAG = "AuthorizeFragment"
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import android.content.Intent
|
|||||||
import com.mogo.service.intent.IMogoIntentListener
|
import com.mogo.service.intent.IMogoIntentListener
|
||||||
import com.mogo.utils.logger.Logger
|
import com.mogo.utils.logger.Logger
|
||||||
|
|
||||||
private const val IVoiceIntentTAG = "IVoiceIntentListener"
|
private const val IVoiceIntentTAG = "IVoiceAuthorizeIntentListener"
|
||||||
|
|
||||||
interface IVoiceIntentListener : IMogoIntentListener, IVoiceBusinessListener {
|
interface IVoiceAuthorizeIntentListener : IMogoIntentListener, IVoiceBusinessListener {
|
||||||
|
|
||||||
override fun onIntentReceived(cmd: String?, intent: Intent?) {
|
override fun onIntentReceived(cmd: String?, intent: Intent?) {
|
||||||
Logger.i(IVoiceIntentTAG, "cmd -> $cmd")
|
Logger.i(IVoiceIntentTAG, "cmd -> $cmd")
|
||||||
@@ -25,7 +25,7 @@ object VoiceManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleOnIntentCmd(cmd: String, intent: Intent, listener: IVoiceIntentListener) {
|
fun handleOnIntentCmd(cmd: String, intent: Intent, listener: IVoiceAuthorizeIntentListener) {
|
||||||
Logger.i(TAG, "handleOnIntentCmd: cmd -> $cmd")
|
Logger.i(TAG, "handleOnIntentCmd: cmd -> $cmd")
|
||||||
when (cmd) {
|
when (cmd) {
|
||||||
VOICE_INTENT_AGREE -> {
|
VOICE_INTENT_AGREE -> {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ object VoiceUtil {
|
|||||||
fun registerAll(
|
fun registerAll(
|
||||||
context: Context,
|
context: Context,
|
||||||
voiceCommand: IVoiceCommandListener,
|
voiceCommand: IVoiceCommandListener,
|
||||||
intentCommand: IVoiceIntentListener
|
intentCommand: IVoiceAuthorizeIntentListener
|
||||||
) {
|
) {
|
||||||
if (!hasRegister) {
|
if (!hasRegister) {
|
||||||
hasRegister = true
|
hasRegister = true
|
||||||
@@ -53,7 +53,7 @@ object VoiceUtil {
|
|||||||
private fun registerAgree(
|
private fun registerAgree(
|
||||||
context: Context,
|
context: Context,
|
||||||
voiceCommand: IVoiceCommandListener,
|
voiceCommand: IVoiceCommandListener,
|
||||||
intentCommand: IVoiceIntentListener
|
intentCommand: IVoiceAuthorizeIntentListener
|
||||||
) {
|
) {
|
||||||
Logger.i(TAG, "registerAgree")
|
Logger.i(TAG, "registerAgree")
|
||||||
AIAssist.getInstance(context)
|
AIAssist.getInstance(context)
|
||||||
@@ -67,7 +67,7 @@ object VoiceUtil {
|
|||||||
private fun registerDisAgree(
|
private fun registerDisAgree(
|
||||||
context: Context,
|
context: Context,
|
||||||
voiceCommand: IVoiceCommandListener,
|
voiceCommand: IVoiceCommandListener,
|
||||||
intentCommand: IVoiceIntentListener
|
intentCommand: IVoiceAuthorizeIntentListener
|
||||||
) {
|
) {
|
||||||
Logger.i(TAG, "registerDisAgree")
|
Logger.i(TAG, "registerDisAgree")
|
||||||
AIAssist.getInstance(context)
|
AIAssist.getInstance(context)
|
||||||
@@ -78,7 +78,7 @@ object VoiceUtil {
|
|||||||
intentRegister?.registerIntentListener(VOICE_INTENT_DISAGREE, intentCommand)
|
intentRegister?.registerIntentListener(VOICE_INTENT_DISAGREE, intentCommand)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun unregisterAll(context: Context, listener: IVoiceIntentListener) {
|
fun unregisterAll(context: Context, listener: IVoiceAuthorizeIntentListener) {
|
||||||
Logger.i(TAG, "unregister All")
|
Logger.i(TAG, "unregister All")
|
||||||
AIAssist.getInstance(context).unregisterUnWakeupCommand(VOICE_REGISTER_AUTHORIZE_AGREE)
|
AIAssist.getInstance(context).unregisterUnWakeupCommand(VOICE_REGISTER_AUTHORIZE_AGREE)
|
||||||
AIAssist.getInstance(context).unregisterUnWakeupCommand(VOICE_REGISTER_AUTHORIZE_DISAGREE)
|
AIAssist.getInstance(context).unregisterUnWakeupCommand(VOICE_REGISTER_AUTHORIZE_DISAGREE)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#000000">
|
android:background="#CC000000">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/clLoadingAuthorizeContainer"
|
android:id="@+id/clLoadingAuthorizeContainer"
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ public class DiscreteScrollLayoutManager extends LinearLayoutManager {
|
|||||||
@Override
|
@Override
|
||||||
protected float calculateSpeedPerPixel(DisplayMetrics displayMetrics) {
|
protected float calculateSpeedPerPixel(DisplayMetrics displayMetrics) {
|
||||||
// 返回:滑过1px时经历的时间(ms)。
|
// 返回:滑过1px时经历的时间(ms)。
|
||||||
return 150f / displayMetrics.densityDpi;
|
return 10f / displayMetrics.densityDpi;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -810,6 +810,10 @@ public class DiscreteScrollLayoutManager extends LinearLayoutManager {
|
|||||||
orientationHelper.getPendingDx(pendingScroll),
|
orientationHelper.getPendingDx(pendingScroll),
|
||||||
orientationHelper.getPendingDy(pendingScroll));
|
orientationHelper.getPendingDy(pendingScroll));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override protected float calculateSpeedPerPixel(DisplayMetrics displayMetrics) {
|
||||||
|
return 10f / displayMetrics.densityDpi;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ScrollStateListener {
|
public interface ScrollStateListener {
|
||||||
|
|||||||
@@ -57,12 +57,13 @@ public class MapPresenter extends Presenter< MapView > implements
|
|||||||
super( view );
|
super( view );
|
||||||
initBroadcast();
|
initBroadcast();
|
||||||
}
|
}
|
||||||
|
private BroadcastReceiver broadcastReceiver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* opera type为0:0 实时路况开;1实时路况关 type为1:0 放大地图; 1缩小地图 type为2:0切换2d车上; 1切换2d北上;2切换3d车上支持
|
* opera type为0:0 实时路况开;1实时路况关 type为1:0 放大地图; 1缩小地图 type为2:0切换2d车上; 1切换2d北上;2切换3d车上支持
|
||||||
*/
|
*/
|
||||||
private void initBroadcast() {
|
private void initBroadcast() {
|
||||||
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
|
broadcastReceiver = new BroadcastReceiver() {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive( Context context, Intent intent ) {
|
public void onReceive( Context context, Intent intent ) {
|
||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
@@ -211,6 +212,13 @@ public class MapPresenter extends Presenter< MapView > implements
|
|||||||
unregisterVoiceCmd();
|
unregisterVoiceCmd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public void onDestroy(@NonNull LifecycleOwner owner) {
|
||||||
|
super.onDestroy(owner);
|
||||||
|
if (broadcastReceiver != null) {
|
||||||
|
getContext().unregisterReceiver(broadcastReceiver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void registerVoiceCmd() {
|
private void registerVoiceCmd() {
|
||||||
|
|
||||||
for ( Map.Entry< String, String[] > entry : VoiceConstants.sVoiceCmds.entrySet() ) {
|
for ( Map.Entry< String, String[] > entry : VoiceConstants.sVoiceCmds.entrySet() ) {
|
||||||
|
|||||||
@@ -33,22 +33,19 @@ public class SearchCategoryAdapter extends RecycleBaseAdapter<MogoPoiItem> {
|
|||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(RecycleViewHolder holder, MogoPoiItem tip) {
|
public void onBindViewHolder(RecycleViewHolder holder, MogoPoiItem tip) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int layoutPosition = holder.getLayoutPosition();
|
int layoutPosition = holder.getLayoutPosition();
|
||||||
|
|
||||||
if (layoutPosition==0) {
|
if (layoutPosition == 0) {
|
||||||
holder.itemView.setBackgroundResource(R.drawable.selector_first_item_category_background);
|
holder.itemView.setBackgroundResource(
|
||||||
}else {
|
R.drawable.selector_first_item_category_background);
|
||||||
|
} else {
|
||||||
holder.itemView.setBackgroundResource(R.drawable.selector_item_category_background);
|
holder.itemView.setBackgroundResource(R.drawable.selector_item_category_background);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
holder.setText(R.id.tv_position, tip.getTitle());
|
holder.setText(R.id.tv_position, tip.getTitle());
|
||||||
holder.setText(R.id.tv_position_des, tip.getSnippet());
|
holder.setText(R.id.tv_position_des, tip.getSnippet());
|
||||||
|
|
||||||
holder.setText(R.id.iv_position,String.valueOf(holder.getLayoutPosition()+1));
|
holder.setText(R.id.iv_position, String.valueOf(holder.getLayoutPosition() + 1));
|
||||||
holder.itemView.setTag(R.id.tag_position, holder.getLayoutPosition());
|
holder.itemView.setTag(R.id.tag_position, holder.getLayoutPosition());
|
||||||
holder.itemView.setOnClickListener(onClickListener);
|
holder.itemView.setOnClickListener(onClickListener);
|
||||||
holder.itemView.setSelected(current == holder.getLayoutPosition());
|
holder.itemView.setSelected(current == holder.getLayoutPosition());
|
||||||
@@ -71,10 +68,10 @@ public class SearchCategoryAdapter extends RecycleBaseAdapter<MogoPoiItem> {
|
|||||||
|
|
||||||
public void setCurrent(int current) {
|
public void setCurrent(int current) {
|
||||||
|
|
||||||
if (current==this.current) {
|
if (current == this.current) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.lastPosition=this.current;
|
this.lastPosition = this.current;
|
||||||
this.current = current;
|
this.current = current;
|
||||||
notifyItemChanged(lastPosition);
|
notifyItemChanged(lastPosition);
|
||||||
notifyItemChanged(current);
|
notifyItemChanged(current);
|
||||||
@@ -84,11 +81,14 @@ public class SearchCategoryAdapter extends RecycleBaseAdapter<MogoPoiItem> {
|
|||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLastPosition(){
|
public int getLastPosition() {
|
||||||
return lastPosition;
|
return lastPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MogoPoiItem getCurrentItem(){
|
public MogoPoiItem getCurrentItem() {
|
||||||
|
if (current >= list.size()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return list.get(current);
|
return list.get(current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,9 +113,13 @@ class CategorySearchFragment : BaseFragment(), CategoryView, IMogoVoiceCmdCallBa
|
|||||||
|
|
||||||
private fun addMarkers() {
|
private fun addMarkers() {
|
||||||
addMarkers.clear()
|
addMarkers.clear()
|
||||||
var marginBounder = resources.getDimensionPixelSize(R.dimen.dp_60)*2
|
var marginBounder = resources.getDimensionPixelSize(R.dimen.dp_60) * 2
|
||||||
SearchServiceHolder.getMapUIController()
|
SearchServiceHolder.getMapUIController()
|
||||||
.showBounds(TAG, null, locationList, Rect(cv_search_result.width+marginBounder,marginBounder, marginBounder, marginBounder), false)
|
.showBounds(
|
||||||
|
TAG, null, locationList, Rect(
|
||||||
|
cv_search_result.width + marginBounder, marginBounder, marginBounder, marginBounder
|
||||||
|
), false
|
||||||
|
)
|
||||||
|
|
||||||
for (options in arrayList) {
|
for (options in arrayList) {
|
||||||
var addMarker = SearchServiceHolder.getMarkerManger()
|
var addMarker = SearchServiceHolder.getMarkerManger()
|
||||||
@@ -218,8 +222,10 @@ class CategorySearchFragment : BaseFragment(), CategoryView, IMogoVoiceCmdCallBa
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun goPath() {
|
private fun goPath() {
|
||||||
var newInstance = ChoosePathFragment.newInstance(mAdapter.currentItem.point)
|
mAdapter.currentItem?.let {
|
||||||
SearchServiceHolder.push(newInstance, MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT)
|
var newInstance = ChoosePathFragment.newInstance(mAdapter.currentItem.point)
|
||||||
|
SearchServiceHolder.push(newInstance, MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateMarker() {
|
private fun updateMarker() {
|
||||||
|
|||||||
@@ -212,16 +212,16 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener, IMogoVoiceCmdCallB
|
|||||||
AIAssist.getInstance(context)
|
AIAssist.getInstance(context)
|
||||||
.registerUnWakeupCommand("thirdPath", arrayOf<String>(thirdPath), this)
|
.registerUnWakeupCommand("thirdPath", arrayOf<String>(thirdPath), this)
|
||||||
AIAssist.getInstance(context)
|
AIAssist.getInstance(context)
|
||||||
.registerUnWakeupCommand("startNavi", arrayOf<String>(startNavi), this)
|
.registerUnWakeupCommand("startNavi", arrayOf<String>(startNavi,"开始"), this)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun registerRetryVoice(){
|
private fun registerRetryVoice() {
|
||||||
AIAssist.getInstance(context)
|
AIAssist.getInstance(context)
|
||||||
.registerUnWakeupCommand("retry", arrayOf<String>("重试"), this)
|
.registerUnWakeupCommand("retry", arrayOf<String>("重试"), this)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unregisterRetryVoice(){
|
private fun unregisterRetryVoice() {
|
||||||
AIAssist.getInstance(context)
|
AIAssist.getInstance(context)
|
||||||
.unregisterUnWakeupCommand("retry")
|
.unregisterUnWakeupCommand("retry")
|
||||||
|
|
||||||
@@ -235,6 +235,9 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener, IMogoVoiceCmdCallB
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun startNavi() {
|
private fun startNavi() {
|
||||||
|
if (TextUtils.isEmpty(mAdapter.selectTag)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
moveMapToRight()
|
moveMapToRight()
|
||||||
|
|
||||||
SearchServiceHolder.getNavi()
|
SearchServiceHolder.getNavi()
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class SettingAddressFragment : BaseFragment(), IMogoGeoSearchListener {
|
|||||||
var neighborhood = regeocodeResult?.regeocodeAddress?.neighborhood
|
var neighborhood = regeocodeResult?.regeocodeAddress?.neighborhood
|
||||||
if (!TextUtils.isEmpty(neighborhood)) {
|
if (!TextUtils.isEmpty(neighborhood)) {
|
||||||
selectPoi?.name = neighborhood
|
selectPoi?.name = neighborhood
|
||||||
}else{
|
} else {
|
||||||
selectPoi?.name = formatAddress
|
selectPoi?.name = formatAddress
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,7 +80,8 @@ class SettingAddressFragment : BaseFragment(), IMogoGeoSearchListener {
|
|||||||
.getFromLocationAsyn(mogoRegeocodeQuery)
|
.getFromLocationAsyn(mogoRegeocodeQuery)
|
||||||
addMarker?.apply {
|
addMarker?.apply {
|
||||||
SearchServiceHolder.getMapUIController()
|
SearchServiceHolder.getMapUIController()
|
||||||
.startJumpAnimation(this,
|
.startJumpAnimation(
|
||||||
|
this,
|
||||||
150f, { input ->
|
150f, { input ->
|
||||||
if (input <= 0.5) {
|
if (input <= 0.5) {
|
||||||
(0.5f - 2.0 * (0.5 - input) * (0.5 - input)).toFloat()
|
(0.5f - 2.0 * (0.5 - input) * (0.5 - input)).toFloat()
|
||||||
@@ -182,13 +183,12 @@ class SettingAddressFragment : BaseFragment(), IMogoGeoSearchListener {
|
|||||||
AppDataBase.getDatabase(context)
|
AppDataBase.getDatabase(context)
|
||||||
.poiDao()
|
.poiDao()
|
||||||
.insert(searchPoi)
|
.insert(searchPoi)
|
||||||
|
AddressHelper.notifyAddressChanged(context, searchPoi)
|
||||||
|
|
||||||
})
|
})
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.subscribe()
|
.subscribe()
|
||||||
|
|
||||||
|
|
||||||
AddressHelper.notifyAddressChanged(context, searchPoi)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
|
|||||||
Reference in New Issue
Block a user