merge
This commit is contained in:
@@ -2,6 +2,7 @@ package com.mogo.module.extensions.entrance;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -54,6 +55,7 @@ import com.mogo.service.module.IMogoAddressManager;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -61,6 +63,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.http.HEAD;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-07
|
||||
@@ -117,6 +121,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
private TextView ivMode;
|
||||
|
||||
private IMogoPolyline iMogoPolyline;
|
||||
public static boolean isClickShare;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -129,7 +134,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mIMogoAuthorizeModuleManager = (IMogoAuthorizeModuleManager) ARouter.getInstance().build(AuthorizeConstant.PROVIDER_MODULE).navigation(getContext());
|
||||
mIMogoAuthorizeModuleManager.registerAuthorizeListener(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE, this);
|
||||
|
||||
mEntrancePresenter = new EntrancePresenter(getContext(), this, mIMogoAuthorizeModuleManager);
|
||||
mEntrancePresenter = new EntrancePresenter( getContext(), this, mIMogoAuthorizeModuleManager );
|
||||
mMogoFragmentManager = mApis.getFragmentManagerApi();
|
||||
mMogoAddressManager = mApis.getAddressManagerApi();
|
||||
|
||||
@@ -138,7 +143,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mSearch = findViewById( R.id.module_entrance_id_search );
|
||||
|
||||
mSearch.setOnClickListener( view -> {
|
||||
setMarkerStatus(true);
|
||||
setMarkerStatus( true );
|
||||
mSearchProvider = ( IMogoModuleProvider ) ARouter.getInstance()
|
||||
.build( MogoModulePaths.PATH_MODULE_SEARCH )
|
||||
.navigation();
|
||||
@@ -153,7 +158,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
mHome = findViewById( R.id.module_entrance_id_home );
|
||||
mHome.setOnClickListener( view -> {
|
||||
setMarkerStatus(true);
|
||||
setMarkerStatus( true );
|
||||
mMogoAddressManager.goHome();
|
||||
mApis.getAdasControllerApi().closeADAS();
|
||||
|
||||
@@ -161,7 +166,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
mCompany = findViewById( R.id.module_entrance_id_company );
|
||||
mCompany.setOnClickListener( view -> {
|
||||
setMarkerStatus(true);
|
||||
setMarkerStatus( true );
|
||||
mMogoAddressManager.goCompany();
|
||||
mApis.getAdasControllerApi().closeADAS();
|
||||
|
||||
@@ -169,11 +174,36 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
mUploadRoadCondition = findViewById( R.id.module_entrance_id_upload_road_condition );
|
||||
mUploadRoadCondition.setOnClickListener( view -> {
|
||||
ShareControl.getInstance( getActivity() ).showDialog();
|
||||
traceData( "1" );
|
||||
isClickShare = true;
|
||||
if (mIMogoAuthorizeModuleManager.needAuthorize()) {
|
||||
mIMogoAuthorizeModuleManager.invokeAuthorization(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
} else {
|
||||
ShareControl.getInstance( getActivity() ).showDialog();
|
||||
traceData( "1" );
|
||||
}
|
||||
} );
|
||||
mVRMode = findViewById( R.id.module_entrance_id_vr_mode );
|
||||
mVRMode.setOnClickListener( view -> {
|
||||
|
||||
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
Rect mBoundRect = new Rect();
|
||||
final int paddingTop = WindowUtils.dip2px( getContext(), 250 );
|
||||
final int paddingBottom = WindowUtils.dip2px( getContext(), 150 );
|
||||
final int paddingRight = WindowUtils.dip2px( getContext(), 150 );
|
||||
final int paddingLeft = WindowUtils.dip2px( getContext(), 650 );
|
||||
|
||||
mBoundRect.bottom = paddingBottom;
|
||||
mBoundRect.top = paddingTop;
|
||||
mBoundRect.left = paddingLeft;
|
||||
mBoundRect.right = paddingRight;
|
||||
mMApUIController.showBounds( TAG,
|
||||
new MogoLatLng(
|
||||
mService.getSingletonLocationClient( getContext() ).getLastKnowLocation().getLatitude(),
|
||||
mService.getSingletonLocationClient( getContext() ).getLastKnowLocation().getLongitude()
|
||||
),
|
||||
Arrays.asList( new MogoLatLng( 39.9736012000, 116.4220762300 ) ),
|
||||
mBoundRect,
|
||||
false );
|
||||
} );
|
||||
|
||||
mMove2CurrentLocation = findViewById( R.id.module_entrance_id_move2_current_location );
|
||||
@@ -223,36 +253,38 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mSpeedLimitUnit = findViewById( R.id.module_entrance_id_speed_limit_unit );
|
||||
|
||||
|
||||
mApis.getIntentManagerApi().registerIntentListener(AUTONAVI_STANDARD_BROADCAST_RECV, new IMogoIntentListener() {
|
||||
@Override public void onIntentReceived(String intentStr, Intent intent) {
|
||||
int key_type = intent.getIntExtra("KEY_TYPE", 0);
|
||||
mApis.getIntentManagerApi().registerIntentListener( AUTONAVI_STANDARD_BROADCAST_RECV, new IMogoIntentListener() {
|
||||
@Override
|
||||
public void onIntentReceived( String intentStr, Intent intent ) {
|
||||
int key_type = intent.getIntExtra( "KEY_TYPE", 0 );
|
||||
|
||||
int type = intent.getIntExtra("EXTRA_TYPE", -1);
|
||||
int opera_type = intent.getIntExtra("EXTRA_OPERA", -1);
|
||||
if (key_type == 10027) {
|
||||
if (opera_type == 0) {
|
||||
ivMode.setSelected(false);
|
||||
} else if (opera_type == 1) {
|
||||
ivMode.setSelected(true);
|
||||
int type = intent.getIntExtra( "EXTRA_TYPE", -1 );
|
||||
int opera_type = intent.getIntExtra( "EXTRA_OPERA", -1 );
|
||||
if ( key_type == 10027 ) {
|
||||
if ( opera_type == 0 ) {
|
||||
ivMode.setSelected( false );
|
||||
} else if ( opera_type == 1 ) {
|
||||
ivMode.setSelected( true );
|
||||
}
|
||||
ivMode.setText(
|
||||
getString( ivMode.isSelected() ? R.string.mode_car_up : R.string.mode_north_up ) );
|
||||
getString( ivMode.isSelected() ? R.string.mode_car_up : R.string.mode_north_up ) );
|
||||
}
|
||||
}
|
||||
});
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void setMarkerStatus(boolean show){
|
||||
protected void setMarkerStatus( boolean show ) {
|
||||
mMogoStatusManager.setSearchUIShow(
|
||||
MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY, show
|
||||
MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY, show
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
private static final String AUTONAVI_STANDARD_BROADCAST_RECV =
|
||||
"AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
"AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected EntrancePresenter createPresenter() {
|
||||
@@ -280,28 +312,34 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
if (mEntrancePresenter != null) {
|
||||
if ( mEntrancePresenter != null ) {
|
||||
mEntrancePresenter.unregisterUnWake();
|
||||
}
|
||||
|
||||
isClickShare = false;
|
||||
mIMogoAuthorizeModuleManager.unregisterAuthorizeListener(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void authorizeSuccess() {
|
||||
Log.d(TAG, "authorizeSuccess --------> ");
|
||||
mEntrancePresenter.handleNeedAuthorizeCmd();
|
||||
Log.d(TAG, "authorizeSuccess --------> isClickShare = " + isClickShare);
|
||||
if (isClickShare) {
|
||||
ShareControl.getInstance( getActivity() ).showDialog();
|
||||
traceData( "1" );
|
||||
} else {
|
||||
mEntrancePresenter.handleNeedAuthorizeCmd();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void authorizeFailed(String errorMsg) {
|
||||
Log.e(TAG, "authorizeFailed --------> ");
|
||||
public void authorizeFailed( String errorMsg ) {
|
||||
Log.e( TAG, "authorizeFailed --------> " );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forbiddenVoiceWhenAuthorize(String cmd) {
|
||||
Log.d(TAG, "forbiddenVoiceWhenAuthorize --------> ");
|
||||
public void forbiddenVoiceWhenAuthorize( String cmd ) {
|
||||
Log.d( TAG, "forbiddenVoiceWhenAuthorize --------> " );
|
||||
|
||||
}
|
||||
|
||||
@@ -328,7 +366,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
ivMode.setVisibility( View.VISIBLE );
|
||||
mExitNavi.setVisibility( View.VISIBLE );
|
||||
mMApUIController.setPointToCenter( 0.675926, 0.77552 );
|
||||
mMApUIController.changeMapMode(ivMode.isSelected()?EnumMapUI.NorthUP_2D :EnumMapUI.CarUp_2D );
|
||||
mMApUIController.changeMapMode( ivMode.isSelected() ? EnumMapUI.NorthUP_2D : EnumMapUI.CarUp_2D );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -339,7 +377,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mExitNavi.setVisibility( View.GONE );
|
||||
mSpeedLimit.setVisibility( View.GONE );
|
||||
mMApUIController.setPointToCenter( 0.66145, 0.590688 );
|
||||
mMApUIController.changeMapMode(EnumMapUI.NorthUP_2D);
|
||||
mMApUIController.changeMapMode( EnumMapUI.NorthUP_2D );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -142,6 +142,8 @@ public class EntrancePresenter extends Presenter<EntranceView> {
|
||||
@Override
|
||||
public void onIntentReceived(String intentStr, Intent intent) {
|
||||
mVoiceCmdType = intentStr;
|
||||
EntranceFragment.isClickShare = false;
|
||||
|
||||
String data = intent.getStringExtra("data");
|
||||
Log.d(TAG, "唤醒 mogoIntentListener intentStr =" + intentStr + ">>data =" + data + " >>> needAuthorize = " + mIMogoAuthorizeModuleManager.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_SHARE));
|
||||
if (intentStr.equals(ExtensionsModuleConst.GO_TO_SHARE)) { //我要分享 --ok
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 272 B |
Binary file not shown.
|
After Width: | Height: | Size: 451 B |
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="90px" />
|
||||
<solid android:color="#4C6873A5" />
|
||||
</shape>
|
||||
@@ -146,7 +146,7 @@
|
||||
android:layout_height="@dimen/module_ext_operation_panel_vr_height"
|
||||
android:background="@drawable/module_ext_dw_top_corner_bkg"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -10,26 +10,42 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_ext_id_voice"
|
||||
android:layout_width="@dimen/module_ext_voice_icon_width"
|
||||
android:layout_height="@dimen/module_ext_voice_icon_height"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="@dimen/module_ext_voice_icon_width"
|
||||
android:layout_height="@dimen/module_ext_voice_icon_height"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- <com.mogo.module.extensions.anim.JSurfaceView-->
|
||||
<!-- />-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_voice_msg"
|
||||
<LinearLayout
|
||||
android:id="@+id/module_ext_id_voice_msg_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/module_ext_str_voice_msg"
|
||||
android:textColor="@color/module_ext_color_voice_text"
|
||||
android:textSize="@dimen/module_ext_voice_textSize"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_ext_id_voice"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/module_ext_ic_right_arrow" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_voice_msg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/module_ext_id_voice_msg_icon_margin_left"
|
||||
android:background="@drawable/module_ext_dw_grey_bottom_bkg"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/module_ext_id_voice_msg_padding_left"
|
||||
android:paddingTop="@dimen/module_ext_id_voice_msg_padding_top"
|
||||
android:paddingRight="@dimen/module_ext_id_voice_msg_padding_right"
|
||||
android:paddingBottom="@dimen/module_ext_id_voice_msg_padding_bottom"
|
||||
android:text="@string/module_ext_str_voice_msg"
|
||||
android:textColor="@color/module_ext_color_voice_text"
|
||||
android:textSize="@dimen/module_ext_voice_textSize" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_time"
|
||||
@@ -95,8 +111,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="/"
|
||||
android:textSize="@dimen/module_ext_weather_temp_desc_textSize"
|
||||
android:textColor="#FFFFFF" />
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/module_ext_weather_temp_desc_textSize" />
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
|
||||
@@ -90,4 +90,10 @@
|
||||
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop">24px
|
||||
</dimen>
|
||||
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_textSize">15px</dimen>
|
||||
|
||||
<dimen name="module_ext_id_voice_msg_padding_top">9px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_bottom">9px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_left">18px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_right">18px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_icon_margin_left">-1px</dimen>
|
||||
</resources>
|
||||
@@ -88,4 +88,10 @@
|
||||
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop">24px</dimen>
|
||||
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_textSize">28px</dimen>
|
||||
|
||||
<dimen name="module_ext_id_voice_msg_padding_top">17px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_bottom">17px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_left">36px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_right">36px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_icon_margin_left">-2px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -88,4 +88,10 @@
|
||||
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop">24px</dimen>
|
||||
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_textSize">28px</dimen>
|
||||
|
||||
<dimen name="module_ext_id_voice_msg_padding_top">17px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_bottom">17px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_left">36px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_right">36px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_icon_margin_left">-2px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -20,28 +20,31 @@
|
||||
<string name="module_ext_str_exit_navi">退出导航</string>
|
||||
<string name="module_ext_str_continue_navi">继续导航</string>
|
||||
<string name="module_ext_str_exit_path">退出全览</string>
|
||||
<string name="mode_car_up">车头</string>
|
||||
<string name="mode_north_up">正北</string>
|
||||
<string name="mode_car_up">车头</string>
|
||||
<string name="mode_north_up">正北</string>
|
||||
|
||||
<string-array name="module_ext_str_arr_ai_tips">
|
||||
<string-array name="module_ext_str_arr_ai_tips">
|
||||
<item>你好小智,播放音乐</item>
|
||||
<item>你好小智,我要听音乐</item>
|
||||
<item>你好小智,播放赵磊的歌</item>
|
||||
<item>你好小智,我想听成都</item>
|
||||
<item>你好小智,打开导航</item>
|
||||
<item>你好小智,我要去拉萨</item>
|
||||
<item>你好小智,我要回家</item>
|
||||
<item>你好小智,我要去加油站</item>
|
||||
<item>你好小智,导航去西单商场</item>
|
||||
<item>你好小智,打开行车记录仪</item>
|
||||
<item>你好小智,打开收音机</item>
|
||||
<item>你好小智,调频到97.4</item>
|
||||
<item>你好小智,调频到103.9</item>
|
||||
<item>你好小智,今天天气怎么样</item>
|
||||
<item>你好小智,北京明天天气怎么样</item>
|
||||
<item>你好小智,打开车聊聊</item>
|
||||
<item>你好小智,我想聊天</item>
|
||||
<item>你好小智,中关村堵不堵</item>
|
||||
<item>你好小智,打开探路</item>
|
||||
<item>你好小智,附近路况</item>
|
||||
<item>你好小智,前方路况怎么样</item>
|
||||
<item>你好小智,上报路况</item>
|
||||
<item>你好小智,分享这首歌</item>
|
||||
<item>你好小智,打开辅助驾驶</item>
|
||||
<item>你好小智,查询附近的人</item>
|
||||
<item>你好小智,音量开到百分之三十</item>
|
||||
<item>你好小智,打开全部应用</item>
|
||||
<item>你好小智,返回桌面</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user