opt
BIN
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_navigator_applist.png
Executable file → Normal file
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 4.3 KiB |
BIN
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_navigator_media.png
Executable file → Normal file
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 4.0 KiB |
BIN
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_navigator_navi.png
Executable file → Normal file
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.8 KiB |
BIN
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_navigator_personcenter.png
Executable file → Normal file
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 4.1 KiB |
@@ -23,7 +23,7 @@
|
||||
|
||||
<dimen name="module_apps_navigator_icon_width">78px</dimen>
|
||||
<dimen name="module_apps_navigator_icon_height">78px</dimen>
|
||||
<dimen name="module_apps_navigator_icon_divider">16px</dimen>
|
||||
<dimen name="module_apps_navigator_icon_divider">17px</dimen>
|
||||
<dimen name="module_apps_voice_icon_width">78px</dimen>
|
||||
<dimen name="module_apps_voice_icon_height">78px</dimen>
|
||||
</resources>
|
||||
@@ -2,19 +2,12 @@ package com.mogo.module.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.os.Build;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import com.mogo.module.common.R;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.module.common.wm.WindowManagerView;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -25,54 +18,22 @@ import com.mogo.utils.WindowUtils;
|
||||
public class WMDialog implements DialogInterface {
|
||||
|
||||
private WMDialogParams mParams;
|
||||
private WindowManager mWindowManager;
|
||||
private boolean mIsShowing = false;
|
||||
private View mContentView;
|
||||
private WindowManager.LayoutParams mLayoutParams;
|
||||
private WindowManagerView mWindowManagerView;
|
||||
|
||||
private WMDialog( WMDialogParams params ) {
|
||||
this.mParams = params;
|
||||
mWindowManagerView = new WindowManagerView.Builder( mParams.mContext ).contentView( R.layout.module_commons_layout_wm_dialog ).build();
|
||||
initViews();
|
||||
}
|
||||
|
||||
public void show() {
|
||||
if ( mIsShowing ) {
|
||||
return;
|
||||
}
|
||||
mIsShowing = true;
|
||||
if ( mWindowManager == null ) {
|
||||
mWindowManager = ( WindowManager ) mParams.mContext.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
|
||||
}
|
||||
if ( mContentView == null ) {
|
||||
mLayoutParams = new WindowManager.LayoutParams();
|
||||
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
|
||||
mLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
|
||||
} else {
|
||||
mLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
|
||||
}
|
||||
mLayoutParams.format = PixelFormat.TRANSLUCENT;
|
||||
mLayoutParams.gravity = Gravity.CENTER;
|
||||
mLayoutParams.flags = WindowManager.LayoutParams.FLAG_DIM_BEHIND | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
|
||||
|
||||
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
|
||||
mLayoutParams.width = 1920;
|
||||
mLayoutParams.height = 1080;
|
||||
} else {
|
||||
mLayoutParams.width = WindowUtils.getScreenWidth( mParams.mContext );
|
||||
mLayoutParams.height = WindowUtils.getScreenHeight( mParams.mContext );
|
||||
}
|
||||
mLayoutParams.dimAmount = 0.5f;
|
||||
mLayoutParams.x = 0;
|
||||
mLayoutParams.y = 0;
|
||||
mContentView = initViews();
|
||||
}
|
||||
mWindowManager.addView( mContentView, mLayoutParams );
|
||||
mWindowManagerView.show();
|
||||
}
|
||||
|
||||
private View initViews() {
|
||||
View contentView = LayoutInflater.from( mParams.mContext ).inflate( R.layout.module_commons_layout_wm_dialog, null );
|
||||
TextView ok = contentView.findViewById( R.id.module_commons_wm_dialog_button_ok );
|
||||
TextView cancel = contentView.findViewById( R.id.module_commons_wm_dialog_button_cancel );
|
||||
TextView content = contentView.findViewById( R.id.module_commons_wm_dialog_content );
|
||||
private void initViews() {
|
||||
TextView ok = mWindowManagerView.findViewById( R.id.module_commons_wm_dialog_button_ok );
|
||||
TextView cancel = mWindowManagerView.findViewById( R.id.module_commons_wm_dialog_button_cancel );
|
||||
TextView content = mWindowManagerView.findViewById( R.id.module_commons_wm_dialog_content );
|
||||
|
||||
ok.setText( mParams.mOkButtonText );
|
||||
if ( mParams.mOnOkButtonClickListener != null ) {
|
||||
@@ -92,7 +53,6 @@ public class WMDialog implements DialogInterface {
|
||||
}
|
||||
|
||||
content.setText( mParams.mContent );
|
||||
return contentView;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,20 +62,11 @@ public class WMDialog implements DialogInterface {
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
if ( !mIsShowing ) {
|
||||
return;
|
||||
}
|
||||
if ( mContentView != null ) {
|
||||
mWindowManager.removeViewImmediate( mContentView );
|
||||
}
|
||||
if ( mParams.mOnDialogDismissListener != null ) {
|
||||
mParams.mOnDialogDismissListener.onDismiss( this );
|
||||
}
|
||||
mIsShowing = false;
|
||||
mWindowManagerView.dismiss();
|
||||
}
|
||||
|
||||
public boolean isShowing() {
|
||||
return mIsShowing;
|
||||
return mWindowManagerView.isShowing();
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
@@ -129,16 +80,6 @@ public class WMDialog implements DialogInterface {
|
||||
mParams.mContext = context;
|
||||
}
|
||||
|
||||
// public Builder setTitle( CharSequence title ) {
|
||||
// mParams.mTitle = title;
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public Builder setTitle( @StringRes int title ) {
|
||||
// mParams.mTitle = mContext.getString( title );
|
||||
// return this;
|
||||
// }
|
||||
|
||||
public Builder setContent( CharSequence content ) {
|
||||
mParams.mContent = content;
|
||||
return this;
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.mogo.module.common.wm;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.os.Build;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.LayoutRes;
|
||||
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-05-21
|
||||
* <p>
|
||||
* 往 window manager 添加view
|
||||
*/
|
||||
public class WindowManagerView {
|
||||
|
||||
private WMViewParams mParams;
|
||||
private boolean mIsShowing;
|
||||
private WindowManager mWindowManager;
|
||||
private WindowManager.LayoutParams mLayoutParams;
|
||||
|
||||
private WindowManagerView( WMViewParams params ) {
|
||||
this.mParams = params;
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
mWindowManager = ( WindowManager ) mParams.mContext.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
|
||||
mLayoutParams = new WindowManager.LayoutParams();
|
||||
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
|
||||
mLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
|
||||
} else {
|
||||
mLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
|
||||
}
|
||||
mLayoutParams.format = PixelFormat.TRANSLUCENT;
|
||||
mLayoutParams.gravity = Gravity.CENTER;
|
||||
mLayoutParams.flags = WindowManager.LayoutParams.FLAG_DIM_BEHIND | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
|
||||
|
||||
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
|
||||
mLayoutParams.width = 1920;
|
||||
mLayoutParams.height = 1080;
|
||||
} else {
|
||||
mLayoutParams.width = WindowUtils.getScreenWidth( mParams.mContext );
|
||||
mLayoutParams.height = WindowUtils.getScreenHeight( mParams.mContext );
|
||||
}
|
||||
mLayoutParams.dimAmount = 0.5f;
|
||||
mLayoutParams.x = 0;
|
||||
mLayoutParams.y = 0;
|
||||
}
|
||||
|
||||
public boolean isShowing() {
|
||||
return mIsShowing;
|
||||
}
|
||||
|
||||
public < T extends View > T findViewById( @IdRes int id ) {
|
||||
return mParams.mContentView.findViewById( id );
|
||||
}
|
||||
|
||||
public void show() {
|
||||
if ( mIsShowing ) {
|
||||
return;
|
||||
}
|
||||
mIsShowing = true;
|
||||
mWindowManager.addView( mParams.mContentView, mLayoutParams );
|
||||
}
|
||||
|
||||
public void dismiss() {
|
||||
if ( !mIsShowing ) {
|
||||
return;
|
||||
}
|
||||
if ( mParams != null ) {
|
||||
mWindowManager.removeViewImmediate( mParams.mContentView );
|
||||
}
|
||||
mIsShowing = false;
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
|
||||
private WMViewParams mParams = null;
|
||||
|
||||
public Builder( Context context ) {
|
||||
mParams = new WMViewParams();
|
||||
mParams.mContext = context;
|
||||
}
|
||||
|
||||
public Builder contentView( View contentView ) {
|
||||
mParams.mContentView = contentView;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder contentView( @LayoutRes int contentViewId ) {
|
||||
mParams.mContentView = LayoutInflater.from( mParams.mContext ).inflate( contentViewId, null );
|
||||
return this;
|
||||
}
|
||||
|
||||
public WindowManagerView build() {
|
||||
if ( mParams.mContentView == null ) {
|
||||
throw new NullPointerException( "WMViewParams#mContentView must not be null." );
|
||||
}
|
||||
return new WindowManagerView( mParams );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class WMViewParams {
|
||||
|
||||
public View mContentView;
|
||||
public Context mContext;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 336 B After Width: | Height: | Size: 717 B |
@@ -89,7 +89,7 @@
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/module_map_id_remaining_info_marginRight"
|
||||
android:layout_marginRight="@dimen/module_ext_remaining_info_marginRight"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
@@ -130,7 +130,7 @@
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/module_map_id_remaining_info_marginRight"
|
||||
android:layout_marginRight="@dimen/module_ext_remaining_info_marginRight"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
@@ -171,7 +171,7 @@
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/module_map_id_remaining_info_marginRight"
|
||||
android:layout_marginRight="@dimen/module_ext_remaining_info_marginRight"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
|
||||
@@ -93,11 +93,11 @@
|
||||
</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>
|
||||
<dimen name="module_ext_voice_msg_padding_top">9px</dimen>
|
||||
<dimen name="module_ext_voice_msg_padding_bottom">9px</dimen>
|
||||
<dimen name="module_ext_voice_msg_padding_left">18px</dimen>
|
||||
<dimen name="module_ext_voice_msg_padding_right">18px</dimen>
|
||||
<dimen name="module_ext_voice_msg_icon_margin_left">-1px</dimen>
|
||||
|
||||
<dimen name="module_ext_weather_bkg_corner">30px</dimen>
|
||||
<dimen name="module_ext_weather_container_paddingLeft">23px</dimen>
|
||||
@@ -111,7 +111,7 @@
|
||||
<dimen name="module_ext_remaining_time_unit_textSize">14px</dimen>
|
||||
<dimen name="module_ext_arrive_time_textSize">20px</dimen>
|
||||
<dimen name="module_ext_arrive_time_unit_textSize">14px</dimen>
|
||||
<dimen name="module_map_id_remaining_info_marginRight">34px</dimen>
|
||||
<dimen name="module_ext_remaining_info_marginRight">34px</dimen>
|
||||
<dimen name="module_map_navi_next_info_road_turn_marginLeft">8px</dimen>
|
||||
<dimen name="module_map_navi_next_info_road_turn_marginRight">8px</dimen>
|
||||
|
||||
@@ -125,6 +125,6 @@
|
||||
<dimen name="module_ext_button_width">66px</dimen>
|
||||
<dimen name="module_ext_button_height">66px</dimen>
|
||||
<dimen name="module_ext_camera_button_marginTop">16px</dimen>
|
||||
<dimen name="module_ext_display_overview_textSize">22px</dimen>
|
||||
<dimen name="module_ext_display_overview_textSize">14px</dimen>
|
||||
<dimen name="module_ext_north_textSize">14px</dimen>
|
||||
</resources>
|
||||
@@ -89,11 +89,11 @@
|
||||
<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>
|
||||
<dimen name="module_ext_voice_msg_padding_top">17px</dimen>
|
||||
<dimen name="module_ext_voice_msg_padding_bottom">17px</dimen>
|
||||
<dimen name="module_ext_voice_msg_padding_left">36px</dimen>
|
||||
<dimen name="module_ext_voice_msg_padding_right">36px</dimen>
|
||||
<dimen name="module_ext_voice_msg_icon_margin_left">-2px</dimen>
|
||||
|
||||
<dimen name="module_ext_weather_bkg_corner">30px</dimen>
|
||||
<dimen name="module_ext_weather_container_paddingLeft">40px</dimen>
|
||||
@@ -101,7 +101,7 @@
|
||||
<dimen name="module_ext_msg_dot_marginLeft">15px</dimen>
|
||||
<dimen name="module_ext_msg_dot_marginRight">15px</dimen>
|
||||
<dimen name="module_ext_navi_next_info_road_marginTop">5px</dimen>
|
||||
<dimen name="module_map_id_remaining_info_marginRight">50px</dimen>
|
||||
<dimen name="module_ext_remaining_info_marginRight">50px</dimen>
|
||||
<dimen name="module_ext_remaining_distance_textSize">37px</dimen>
|
||||
<dimen name="module_ext_remaining_distance_unit_textSize">26px</dimen>
|
||||
<dimen name="module_ext_remaining_time_textSize">37px</dimen>
|
||||
@@ -121,6 +121,7 @@
|
||||
<dimen name="module_ext_button_width">120px</dimen>
|
||||
<dimen name="module_ext_button_height">120px</dimen>
|
||||
<dimen name="module_ext_camera_button_marginTop">30px</dimen>
|
||||
<dimen name="module_ext_display_overview_textSize">122px</dimen>
|
||||
<dimen name="module_ext_north_textSize">28px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -90,11 +90,11 @@
|
||||
<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>
|
||||
<dimen name="module_ext_voice_msg_padding_top">17px</dimen>
|
||||
<dimen name="module_ext_voice_msg_padding_bottom">17px</dimen>
|
||||
<dimen name="module_ext_voice_msg_padding_left">36px</dimen>
|
||||
<dimen name="module_ext_voice_msg_padding_right">36px</dimen>
|
||||
<dimen name="module_ext_voice_msg_icon_margin_left">-2px</dimen>
|
||||
|
||||
<dimen name="module_ext_weather_bkg_corner">30px</dimen>
|
||||
<dimen name="module_ext_weather_container_paddingLeft">40px</dimen>
|
||||
@@ -108,7 +108,7 @@
|
||||
<dimen name="module_ext_remaining_time_unit_textSize">26px</dimen>
|
||||
<dimen name="module_ext_arrive_time_textSize">37px</dimen>
|
||||
<dimen name="module_ext_arrive_time_unit_textSize">26px</dimen>
|
||||
<dimen name="module_map_id_remaining_info_marginRight">50px</dimen>
|
||||
<dimen name="module_ext_remaining_info_marginRight">50px</dimen>
|
||||
<dimen name="module_map_navi_next_info_road_turn_marginLeft">15px</dimen>
|
||||
<dimen name="module_map_navi_next_info_road_turn_marginRight">15px</dimen>
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
<dimen name="module_ext_button_width">120px</dimen>
|
||||
<dimen name="module_ext_button_height">120px</dimen>
|
||||
<dimen name="module_ext_camera_button_marginTop">30px</dimen>
|
||||
<dimen name="module_ext_display_overview_textSize">14px</dimen>
|
||||
<dimen name="module_ext_display_overview_textSize">22px</dimen>
|
||||
<dimen name="module_ext_north_textSize">28px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -131,6 +131,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
query.setRadius( 1000 );
|
||||
geoSearch.getFromLocationAsyn( query );
|
||||
break;
|
||||
case 11:
|
||||
MarkerServiceHandler.getADASController().setSettingStatus( intent.getBooleanExtra( "status", false ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,4 +31,5 @@ public interface IMogoADASController extends IProvider {
|
||||
*/
|
||||
void killADAS();
|
||||
|
||||
void setSettingStatus(boolean show);
|
||||
}
|
||||
|
||||
@@ -166,4 +166,9 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSettingStatus( boolean show ) {
|
||||
AutopilotServiceManage.getInstance().setSettingStatus( show );
|
||||
}
|
||||
}
|
||||
|
||||