Complete mogo-module-warning fragment show
This commit is contained in:
9
.idea/misc.xml
generated
9
.idea/misc.xml
generated
@@ -11,6 +11,8 @@
|
||||
<component name="DesignSurface">
|
||||
<option name="filePathToZoomLevelMap">
|
||||
<map>
|
||||
<entry key="modules/mogo-module-adas/src/main/res/layout/dialog_adas_dispatch_remind.xml" value="0.1" />
|
||||
<entry key="modules/mogo-module-left-panel/src/main/res/layout/module_left_panel_simple_speed.xml" value="0.202734375" />
|
||||
<entry key="modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml" value="0.25" />
|
||||
<entry key="modules/mogo-module-map/src/main/res/layout/module_map_fragment_map.xml" value="0.202734375" />
|
||||
</map>
|
||||
@@ -19,4 +21,11 @@
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="Embedded JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="VisualizationToolProject">
|
||||
<option name="state">
|
||||
<ProjectState>
|
||||
<option name="scale" value="0.1" />
|
||||
</ProjectState>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -305,9 +305,9 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_CRASH_WARNING, "CrashWarning"));
|
||||
|
||||
// OBU 模块
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_V2X_OBU_MOGO, "MoGoObuProvider"));
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_V2X_OBU_MOGO, "IMoGoObuProvider"));
|
||||
// widgets 模块
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_V2X_WARNING, "MoGoWarningProvider"));
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_V2X_WARNING, "IMoGoWaringProvider"));
|
||||
// 小地图模块
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_SMALL_MAP, "IMogoSmallMapProvider"));
|
||||
// ADAS模块
|
||||
|
||||
@@ -278,6 +278,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
MogoModulesManager.getInstance().loadEntrancesModule(R.id.module_main_id_entrance_fragment_container);
|
||||
MogoModulesManager.getInstance().loadEventPanelModule(R.id.module_main_id_event_panel_fragment_container);
|
||||
MogoModulesManager.getInstance().loadLeftPanelModule(R.id.module_main_id_left_panel_fragment_container);
|
||||
MogoModulesManager.getInstance().loadWaringModule(R.id.module_main_id_waring_fragment);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,28 +22,28 @@ public interface MogoModulesHandler {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List< IMogoModuleProvider > loadCardsModule();
|
||||
List<IMogoModuleProvider> loadCardsModule();
|
||||
|
||||
/**
|
||||
* 加载地图
|
||||
*
|
||||
* @param containerId 容器id
|
||||
*/
|
||||
void loadMapModule( int containerId );
|
||||
void loadMapModule(int containerId);
|
||||
|
||||
/**
|
||||
* 加载所有应用
|
||||
*
|
||||
* @param containerId 容器id
|
||||
*/
|
||||
void loadAppsListModule( int containerId );
|
||||
void loadAppsListModule(int containerId);
|
||||
|
||||
/**
|
||||
* 加载快捷操作
|
||||
*
|
||||
* @param containerId
|
||||
*/
|
||||
void loadEntrancesModule( int containerId );
|
||||
void loadEntrancesModule(int containerId);
|
||||
|
||||
/**
|
||||
* 加载基本服务模块,需要不启动页面就能运行
|
||||
@@ -53,20 +53,30 @@ public interface MogoModulesHandler {
|
||||
*/
|
||||
void loadBaseModule();
|
||||
|
||||
/**
|
||||
* 加载预警面板
|
||||
*
|
||||
* @param containerId
|
||||
*/
|
||||
void loadWaringModule(int containerId);
|
||||
|
||||
/**
|
||||
* 加载事件面板
|
||||
*
|
||||
* @param containerId
|
||||
*/
|
||||
void loadEventPanelModule(int containerId);
|
||||
|
||||
/**
|
||||
* 加载左侧面板
|
||||
*
|
||||
* @param containerId
|
||||
*/
|
||||
void loadLeftPanelModule(int containerId);
|
||||
|
||||
/**
|
||||
* 加载比亚迪模块
|
||||
*
|
||||
* @param containerId
|
||||
*/
|
||||
void loadSplashModule(int containerId);
|
||||
|
||||
@@ -12,6 +12,8 @@ import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.main.MainActivity;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.obu.IMoGoObuProvider;
|
||||
import com.mogo.service.warning.IMoGoWaringProvider;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -160,6 +162,15 @@ public class MogoModulesManager implements MogoModulesHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadWaringModule(int containerId) {
|
||||
IMogoModuleProvider provider = ( IMogoModuleProvider ) ARouter.getInstance()
|
||||
.build( MogoServicePaths.PATH_V2X_WARNING )
|
||||
.navigation( getContext() );
|
||||
addFragment( provider, containerId );
|
||||
}
|
||||
|
||||
|
||||
private IMogoModuleProvider load( String path ) {
|
||||
try {
|
||||
return ( IMogoModuleProvider ) ARouter.getInstance().build( path ).navigation( getContext() );
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--单独的slogan图片 并且设置下间距-->
|
||||
<!--如果使用svg可以直接 drawable-->
|
||||
<item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/mogo_slogan"
|
||||
android:tileMode="disabled" />
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -152,9 +152,9 @@
|
||||
android:visibility="gone" />
|
||||
</FrameLayout>
|
||||
|
||||
<!--网约车视图-->
|
||||
<!--预警视图 OBU、云端下发、自车感知、自车策略-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_hmi_fragment"
|
||||
android:id="@+id/module_main_id_waring_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/main_bitmap_splash_bg"
|
||||
android:background="@drawable/main_bitmap_splash_icon"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.mogo.module.common.view.RoundLayout;
|
||||
import com.mogo.module.small.map.animation.DirectionRotateAnimation;
|
||||
import com.mogo.module.small.map.utils.MapAssetStyleUtils;
|
||||
import com.mogo.module.small.map.view.ISmallMapDirectionView;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.math.RoundingMode;
|
||||
import java.text.NumberFormat;
|
||||
@@ -47,7 +46,7 @@ public class SmallMapDirectionView
|
||||
implements IMogoCarLocationChangedListener2, ISmallMapDirectionView {
|
||||
|
||||
//小地图名称
|
||||
public static final String MODULE_NAME = "SmallMap";
|
||||
public static final String MODULE_NAME = "SmallMapDirectionView";
|
||||
|
||||
private RoundLayout rlSmallMapBorder;
|
||||
private ImageView mIvMapBorder;
|
||||
@@ -248,7 +247,7 @@ public class SmallMapDirectionView
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged2(Location latLng) {
|
||||
Logger.d(MODULE_NAME, "onCarLocationChanged2 latLng:" + latLng);
|
||||
//Logger.d(MODULE_NAME, "onCarLocationChanged2 latLng:" + latLng);
|
||||
if (mAMapNavi != null) {
|
||||
NumberFormat nf = NumberFormat.getNumberInstance();
|
||||
// 保留两位小数
|
||||
@@ -269,7 +268,7 @@ public class SmallMapDirectionView
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MogoLatLng latLng) {
|
||||
Logger.d(MODULE_NAME, "onCarLocationChanged latLng:" + latLng);
|
||||
//Logger.d(MODULE_NAME, "onCarLocationChanged latLng:" + latLng);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -289,13 +288,6 @@ public class SmallMapDirectionView
|
||||
*/
|
||||
public void changeAngle(int angle) {
|
||||
int tempAngle = 360 - angle;
|
||||
|
||||
// if (tempAngle <= 180) {
|
||||
// tempAngle = tempAngle;
|
||||
// } else {
|
||||
// tempAngle = -(360 - tempAngle);
|
||||
// }
|
||||
|
||||
mRotateAnimation.setFromDegrees(lastAngle);
|
||||
mRotateAnimation.setToDegrees(tempAngle);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.module.hmi">
|
||||
package="com.mogo.module.warning">
|
||||
|
||||
</manifest>
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.mogo.module.warning;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.module.warning.ui.MoGoWarningFragment;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.warning.IMoGoWaringProvider;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -18,15 +21,26 @@ import com.mogo.utils.logger.Logger;
|
||||
public class MoGoWarningProvider implements IMoGoWaringProvider {
|
||||
private String TAG = "MoGoWarningProvider";
|
||||
|
||||
|
||||
@Override
|
||||
public void init(FragmentActivity activity, int containerId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Logger.d(TAG, "初始化蘑菇预警模块……");
|
||||
Logger.d(TAG, "初始化蘑菇预警模块 ……");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment createFragment(Context context, Bundle data) {
|
||||
Logger.d(TAG, "初始化蘑菇预警模块 Fragment……");
|
||||
return new MoGoWarningFragment();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return WaringConst.MODULE_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.mogo.module.warning;
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/8/3 4:26 下午
|
||||
*/
|
||||
public class WaringConst {
|
||||
public static String MODULE_NAME = "MODULE_LEFT_PANEL";
|
||||
public static String PATH_NAME = "/left/panel";
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.mogo.module.warning.ui;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.module.warning.R;
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/8/3 2:40 下午
|
||||
*/
|
||||
public class MoGoWarningFragment extends MvpFragment<WaringView, WaringPresenter> implements WaringView {
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_warning;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected WaringPresenter createPresenter() {
|
||||
return new WaringPresenter(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.mogo.module.warning.ui;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/8/3 3:55 下午
|
||||
*/
|
||||
public class WaringPresenter extends Presenter< WaringView > {
|
||||
public WaringPresenter(WaringView view) {
|
||||
super(view);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.mogo.module.warning.ui;
|
||||
|
||||
import com.mogo.commons.mvp.IView;
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/8/3 3:54 下午
|
||||
*/
|
||||
public interface WaringView extends IView {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -38,7 +38,9 @@ public interface IMogoModuleProvider extends IProvider {
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
View createView( Context context );
|
||||
default View createView( Context context ){
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 模块唯一标识
|
||||
|
||||
@@ -1,20 +1,11 @@
|
||||
package com.mogo.service.warning;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/8/2 7:36 下午
|
||||
*/
|
||||
public interface IMoGoWaringProvider extends IProvider {
|
||||
/**
|
||||
* 初始化网约车容器
|
||||
*
|
||||
* @param activity activity
|
||||
* @param containerId 容器ID
|
||||
*/
|
||||
void init(FragmentActivity activity, @IdRes int containerId);
|
||||
public interface IMoGoWaringProvider extends IMogoModuleProvider {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user