wait
@@ -36,7 +36,7 @@ import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.BusRoutesResult;
|
||||
import com.mogo.och.bus.model.BusOrderModel;
|
||||
|
||||
@@ -10,7 +10,6 @@ import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.PagerSnapHelper
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.commons.mvp.MvpActivity
|
||||
import com.mogo.eagle.core.utilcode.util.SharedPrefs
|
||||
@@ -18,7 +17,7 @@ import com.mogo.och.bus.presenter.BusLinePresenter
|
||||
import com.mogo.och.bus.ui.adapter.SwitchLineAdapter
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse
|
||||
import com.mogo.och.bus.ui.adapter.OpenItemAnimator
|
||||
import com.mogo.module.common.view.SpacesItemDecoration
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.SpacesItemDecoration
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.bus.R
|
||||
import com.mogo.och.bus.bean.BusQueryLineTaskResponse
|
||||
@@ -74,7 +73,11 @@ class BusSwitchLineActivity : MvpActivity<BusSwitchLineView?, BusLinePresenter?>
|
||||
mLinesListView.setLayoutManager(linearLayoutManager)
|
||||
mLinesListView.setItemAnimator(OpenItemAnimator())
|
||||
mAdapter = SwitchLineAdapter(applicationContext, mData)
|
||||
mLinesListView.addItemDecoration(SpacesItemDecoration(4))
|
||||
mLinesListView.addItemDecoration(
|
||||
SpacesItemDecoration(
|
||||
4
|
||||
)
|
||||
)
|
||||
mLinesListView.setAdapter(mAdapter)
|
||||
//设置item 点击事件
|
||||
mAdapter.setOnLineItemClickListener(object :SwitchLineAdapter.LineItemClickListener{
|
||||
|
||||
@@ -24,7 +24,6 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
@@ -39,7 +38,7 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.och.common.module.utils.AnimatorDrawableUtil;
|
||||
import com.mogo.och.taxi.R;
|
||||
|
||||
|
||||
@@ -20,8 +20,7 @@ import com.mogo.eagle.core.function.check.api.ICheckResultCallBack;
|
||||
import com.mogo.eagle.core.function.check.net.CheckNetWork;
|
||||
import com.mogo.eagle.core.function.check.net.CheckResultData;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.module.common.view.ImageViewClipBounds;
|
||||
import com.mogo.module.common.view.SpacesItemDecoration;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.SpacesItemDecoration;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.common.view;
|
||||
package com.mogo.eagle.core.function.check.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
@@ -7,6 +7,8 @@ import android.util.AttributeSet;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 2019-08-22
|
||||
@@ -37,7 +39,7 @@ public class ImageViewClipBounds extends AppCompatImageView {
|
||||
}
|
||||
|
||||
public void setClip(Rect clipBounds) {
|
||||
if (clipBounds == mClipBounds || (clipBounds != null && clipBounds.equals(mClipBounds))) {
|
||||
if (Objects.equals(clipBounds, mClipBounds)) {
|
||||
return;
|
||||
}
|
||||
if (clipBounds != null) {
|
||||
@@ -42,7 +42,7 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.module.common.view.ImageViewClipBounds
|
||||
<com.mogo.eagle.core.function.check.view.ImageViewClipBounds
|
||||
android:id="@+id/scan_car_top_image"
|
||||
android:layout_width="@dimen/check_scan_width"
|
||||
android:layout_height="@dimen/check_scan_height"
|
||||
@@ -53,7 +53,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/scan_car_image" />
|
||||
|
||||
|
||||
<com.mogo.module.common.view.ImageViewClipBounds
|
||||
<com.mogo.eagle.core.function.check.view.ImageViewClipBounds
|
||||
android:id="@+id/scan_car_tips"
|
||||
android:layout_width="@dimen/check_scan_width"
|
||||
android:layout_height="@dimen/check_scan_height"
|
||||
@@ -72,7 +72,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_120"
|
||||
android:text="自动驾驶车辆体检中,请稍候……"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="自动驾驶车辆存在风险"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_54"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="@id/error_view"
|
||||
@@ -54,13 +54,14 @@
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
android:src="@drawable/check_wrong"
|
||||
app:layout_constraintTop_toBottomOf="@id/error_title" />
|
||||
app:layout_constraintTop_toBottomOf="@id/error_title"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/error_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_26"
|
||||
android:layout_marginStart="@dimen/dp_26"
|
||||
android:layout_marginTop="@dimen/dp_23"
|
||||
android:text="软件运行异常"
|
||||
android:textColor="@color/check_tip_error_color"
|
||||
@@ -76,9 +77,10 @@
|
||||
android:background="@drawable/check_detail"
|
||||
android:gravity="center"
|
||||
android:text="查看详情"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/check_button_text_size"
|
||||
app:layout_constraintTop_toBottomOf="@id/error_image" />
|
||||
app:layout_constraintTop_toBottomOf="@id/error_image"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -97,8 +99,9 @@
|
||||
android:layout_width="@dimen/dp_520"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="您的自动驾驶系统已经很久没有进行体检了,建议立即体检。"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_44" />
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_44"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/check_button"
|
||||
@@ -108,9 +111,10 @@
|
||||
android:background="@drawable/check_button"
|
||||
android:gravity="center"
|
||||
android:text="立即体检"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/check_button_text_size"
|
||||
app:layout_constraintTop_toBottomOf="@id/check_text_view" />
|
||||
app:layout_constraintTop_toBottomOf="@id/check_text_view"
|
||||
tools:ignore="MissingConstraints" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:gravity="left"
|
||||
android:text="硬件检测:"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -30,7 +30,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:text="(下面 1 项存在异常)"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintLeft_toRightOf="@+id/title"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -45,7 +45,7 @@
|
||||
android:layout_marginTop="@dimen/dp_236"
|
||||
android:gravity="center"
|
||||
android:text="角激光"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -77,7 +77,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:text="Pad"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_32" />
|
||||
<!--前摄像头3-->
|
||||
<TextView
|
||||
@@ -89,7 +89,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_42"
|
||||
android:gravity="center"
|
||||
android:text="摄像头"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_32" />
|
||||
|
||||
<LinearLayout
|
||||
@@ -163,7 +163,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:text="主激光"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_32" />
|
||||
<!--RTK-->
|
||||
<ImageView
|
||||
@@ -184,7 +184,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:text="RTK"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_32" />
|
||||
<!--摄像头-后1-->
|
||||
<ImageView
|
||||
@@ -205,7 +205,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_42"
|
||||
android:gravity="center"
|
||||
android:text="摄像头"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_32" />
|
||||
<!--路由器-->
|
||||
<ImageView
|
||||
@@ -226,7 +226,7 @@
|
||||
android:layout_marginTop="@dimen/dp_42"
|
||||
android:gravity="center"
|
||||
android:text="路由器"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_32" />
|
||||
|
||||
<!--OBU-->
|
||||
@@ -251,7 +251,7 @@
|
||||
android:layout_marginStart="@dimen/dp_1000"
|
||||
android:gravity="center"
|
||||
android:text="角激光"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/check_image" />
|
||||
@@ -265,7 +265,7 @@
|
||||
android:layout_marginTop="@dimen/dp_236"
|
||||
android:gravity="center"
|
||||
android:text="OBU"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -287,7 +287,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_24"
|
||||
android:text="设备故障"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
app:layout_constraintLeft_toRightOf="@+id/error_tip"
|
||||
app:layout_constraintTop_toTopOf="@+id/error_tip" />
|
||||
|
||||
@@ -307,7 +307,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_24"
|
||||
android:text="设备正常"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
app:layout_constraintLeft_toRightOf="@+id/error_tip_green"
|
||||
app:layout_constraintTop_toTopOf="@+id/error_tip_green" />
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
android:layout_marginLeft="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:text="硬件检测:"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -52,7 +52,7 @@
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:maxLines="2"
|
||||
android:text="自动驾驶"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintTop_toBottomOf="@id/icon_auto" />
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:text=" 鹰眼\n版本"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintTop_toBottomOf="@id/icon_auto" />
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
android:layout_marginLeft="@dimen/dp_65"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="暂无数据,请关闭重试"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_64"
|
||||
app:layout_constraintLeft_toRightOf="@+id/check_tip_image"
|
||||
app:layout_constraintTop_toTopOf="@+id/check_tip_image" />
|
||||
|
||||
@@ -8,8 +8,8 @@ import android.view.WindowManager;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.module.common.R;
|
||||
|
||||
/**
|
||||
* 浮在各种wm上面的dialog基类,调用了window.setType
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.mogo.module.common.wm;
|
||||
package com.mogo.eagle.core.function.hmi.dialog;
|
||||
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
|
||||
/**
|
||||
* 采用Dialog实现接口
|
||||
*/
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.common.wm;
|
||||
package com.mogo.eagle.core.function.hmi.dialog;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
@@ -7,8 +7,8 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import com.mogo.module.common.R;
|
||||
import com.mogo.module.common.wm.WindowManagerView;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.common.wm;
|
||||
package com.mogo.eagle.core.function.hmi.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.PixelFormat;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.common.wm;
|
||||
package com.mogo.eagle.core.function.hmi.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -288,7 +288,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
*/
|
||||
protected void loadOthersModules() {
|
||||
// 加载地图,触发地图加载完毕回调,在初始化其他卡片模块,保证卡片模块可以正确获取地图相关服务。
|
||||
MogoModulesManager.getInstance().loadModules();
|
||||
MogoModulesManager.getInstance().loadFunctionModules();
|
||||
mPresenter.delayOperations();
|
||||
MogoModulesManager.getInstance().loadFunctionModulesServer();
|
||||
@@ -305,8 +304,8 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
* 启动后台服务
|
||||
*/
|
||||
private void startBaseService() {
|
||||
Intent intentMainServicee = new Intent(this, MogoMainService.class);
|
||||
startService(intentMainServicee);
|
||||
Intent intentMainService = new Intent(this, MogoMainService.class);
|
||||
startService(intentMainService);
|
||||
|
||||
// USB 摄像头行车记录仪进程
|
||||
// Intent intentCarcorderService = new Intent(this, CarcorderService.class);
|
||||
|
||||
@@ -10,6 +10,8 @@ import com.elegant.utils.UiThreadHandler;
|
||||
import com.mogo.cloud.socket.SocketBuildConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.MogoModule;
|
||||
import com.mogo.commons.module.MogoModulePaths;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig;
|
||||
@@ -24,8 +26,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
|
||||
import com.mogo.map.MapApiPath;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.zhidao.support.obu.ami.AmiClientManager;
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo;
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo;
|
||||
@@ -136,7 +136,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addModuleFunction(new MogoModule("/och/api", "IMoGoFunctionProvider"));
|
||||
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MapApiPath.PATH, "CustomMapApiBuilder"));
|
||||
//todo emArrow 此处业务调用放置map module MogoModulePaths.addBaseModule(new MogoModule(ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY));
|
||||
// MogoModulePaths.addBaseModule(new MogoModule(V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME));
|
||||
|
||||
// OBU 模块
|
||||
|
||||
@@ -8,11 +8,6 @@ package com.mogo.eagle.core.function.main.cards;
|
||||
*/
|
||||
public interface MogoModulesHandler {
|
||||
|
||||
/**
|
||||
* 加载模块
|
||||
*/
|
||||
void loadModules();
|
||||
|
||||
/**
|
||||
* 架构升级v1.1加载功能模块
|
||||
*/
|
||||
|
||||
@@ -5,18 +5,14 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.module.MogoModule;
|
||||
import com.mogo.commons.module.MogoModulePaths;
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.function.main.MainActivity;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
@@ -35,18 +31,15 @@ public class MogoModulesManager implements MogoModulesHandler {
|
||||
|
||||
private MainActivity mActivity;
|
||||
private Application mApp;
|
||||
|
||||
private Map<MogoModule, IMogoModuleProvider> mModuleProviders = new HashMap<>();
|
||||
// 空间换效率
|
||||
private Map<String, IMogoModuleProvider> mModuleNameProviders = new HashMap<>();
|
||||
private static final byte[] obj = new byte[0];
|
||||
|
||||
// 架构升级后的加载功能模块的方式
|
||||
private Map<MogoModule, IMoGoFunctionProvider> mModuleFunctionProviders = new HashMap<>();
|
||||
private Map<String, IMoGoFunctionProvider> mModuleNameFunctionProviders = new HashMap<>();
|
||||
private final Map<MogoModule, IMoGoFunctionProvider> mModuleFunctionProviders = new HashMap<>();
|
||||
private final Map<String, IMoGoFunctionProvider> mModuleNameFunctionProviders = new HashMap<>();
|
||||
|
||||
// 架构升级后的加载功能模块的方式
|
||||
private Map<MogoModule, IMoGoFunctionServerProvider> mModuleFunctionServerProviders = new HashMap<>();
|
||||
private Map<String, IMoGoFunctionServerProvider> mModuleNameFunctionServerProviders = new HashMap<>();
|
||||
private final Map<MogoModule, IMoGoFunctionServerProvider> mModuleFunctionServerProviders = new HashMap<>();
|
||||
private final Map<String, IMoGoFunctionServerProvider> mModuleNameFunctionServerProviders = new HashMap<>();
|
||||
|
||||
private static volatile MogoModulesManager sInstance;
|
||||
|
||||
@@ -55,7 +48,7 @@ public class MogoModulesManager implements MogoModulesHandler {
|
||||
|
||||
public static MogoModulesManager getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (MogoModulesManager.class) {
|
||||
synchronized (obj) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MogoModulesManager();
|
||||
}
|
||||
@@ -84,21 +77,6 @@ public class MogoModulesManager implements MogoModulesHandler {
|
||||
return mApp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadModules() {
|
||||
final List<MogoModule> modules = MogoModulePaths.getModules();
|
||||
if (modules != null && !modules.isEmpty()) {
|
||||
for (MogoModule module : modules) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName());
|
||||
IMogoModuleProvider provider = load(module.getPath());
|
||||
if (provider != null) {
|
||||
mModuleProviders.put(module, provider);
|
||||
mModuleNameProviders.put(module.getName(), provider);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadFunctionModules() {
|
||||
final List<MogoModule> modules = MogoModulePaths.getModuleFunctions();
|
||||
@@ -151,15 +129,6 @@ public class MogoModulesManager implements MogoModulesHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private IMogoModuleProvider load(String path) {
|
||||
try {
|
||||
return (IMogoModuleProvider) ARouter.getInstance().build(path).navigation(getContext());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private IMoGoFunctionProvider loadFunction(String path) {
|
||||
try {
|
||||
return (IMoGoFunctionProvider) ARouter.getInstance().build(path).navigation(getContext());
|
||||
@@ -178,45 +147,8 @@ public class MogoModulesManager implements MogoModulesHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private void addFragment(IMogoModuleProvider provider, int containerId) {
|
||||
if (provider == null) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "add fragment fail cause provider == null, container is " + ResourcesHelper.getResNameById(getApplicationContext(), containerId));
|
||||
return;
|
||||
}
|
||||
Fragment fragment = null;
|
||||
fragment = mActivity.getSupportFragmentManager().findFragmentByTag(provider.getModuleName());
|
||||
if (fragment == null) {
|
||||
fragment = provider.createFragment(getContext(), null);
|
||||
}
|
||||
if (fragment == null) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "add fragment fail cause fragment == null, container is " + ResourcesHelper.getResNameById(getApplicationContext(), containerId));
|
||||
return;
|
||||
}
|
||||
mActivity.getSupportFragmentManager().beginTransaction()
|
||||
.replace(containerId, fragment, provider.getModuleName())
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (mModuleNameProviders != null) {
|
||||
Collection<IMogoModuleProvider> modules = mModuleNameProviders.values();
|
||||
if (modules != null) {
|
||||
for (IMogoModuleProvider module : modules) {
|
||||
try {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "destroy module: " + module.getModuleName());
|
||||
module.onDestroy();
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, e + " onDestroy");
|
||||
}
|
||||
}
|
||||
}
|
||||
mModuleNameProviders.clear();
|
||||
}
|
||||
if (mModuleProviders != null) {
|
||||
mModuleProviders.clear();
|
||||
}
|
||||
if (mModuleFunctionProviders != null) {
|
||||
Collection<IMoGoFunctionProvider> modules = mModuleFunctionProviders.values();
|
||||
if (modules != null) {
|
||||
|
||||
@@ -35,7 +35,6 @@ public
|
||||
class MogoMainService extends Service implements IMogoLocationListener {
|
||||
|
||||
private static final String TAG = "MogoMainService";
|
||||
private IMogoServiceApis mServiceApis;
|
||||
|
||||
/**
|
||||
* 主模块管控定位,可以向各个模块发送统一定位信息
|
||||
@@ -45,7 +44,6 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "基本服务启动");
|
||||
mServiceApis = MogoApisHandler.getInstance().getApis();
|
||||
initAndStartLocation();
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "5秒已过,启动基础服务……");
|
||||
@@ -106,6 +104,5 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
mLocationClient.destroy();
|
||||
mLocationClient = null;
|
||||
}
|
||||
mServiceApis = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"
|
||||
>
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#3E7FFC"
|
||||
android:startColor="#5CC1FF" />
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_30"
|
||||
/>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_30" />
|
||||
</shape>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#50526E"
|
||||
android:startColor="#333F4057" />
|
||||
<corners android:bottomRightRadius="@dimen/dp_30"/>
|
||||
<corners android:bottomRightRadius="@dimen/dp_30" />
|
||||
|
||||
</shape>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/module_commons_dlg_bkg"
|
||||
android:background="@color/color_99000000"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -19,7 +19,7 @@
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:layout_marginTop="@dimen/dp_134"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/sp_40"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
@@ -33,7 +33,7 @@
|
||||
android:layout_height="@dimen/dp_128"
|
||||
android:background="@drawable/module_commons_shape_left_btn_bkg"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
@@ -45,7 +45,7 @@
|
||||
android:layout_height="@dimen/dp_128"
|
||||
android:background="@drawable/module_commons_shape_right_btn_bkg"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
@@ -53,4 +53,19 @@
|
||||
<attr name="defaultColor" format="color"/> <!--档位默认色值-->
|
||||
<attr name="selectColor" format="color"/> <!--当前档位色值-->
|
||||
</declare-styleable>
|
||||
|
||||
<style name="BaseFloatDialogStyle" parent="@android:style/Theme.Dialog">
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:backgroundDimAmount">0.6</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:fullBright">@android:color/transparent</item>
|
||||
<item name="android:fullDark">@android:color/transparent</item>
|
||||
<item name="android:topBright">@android:color/transparent</item>
|
||||
<item name="android:topDark">@android:color/transparent</item>
|
||||
<item name="android:borderlessButtonStyle">@android:color/transparent</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -40,6 +40,7 @@
|
||||
<color name="color_FF2966EC">#FF2966EC</color>
|
||||
<color name="color_FFA7B6F0">#FFA7B6F0</color>
|
||||
<color name="color_B3FFFFFF">#B3FFFFFF</color>
|
||||
<color name="color_99000000">#99000000</color>
|
||||
|
||||
|
||||
<color name="version_latest_start_color">#6D7BAF</color>
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.mogo.map.MogoOverlayManager;
|
||||
import com.mogo.map.overlay.IMogoOverlayManager;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.module.common.utils.DrivingDirectionUtils;
|
||||
import com.mogo.commons.utils.DrivingDirectionUtils;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
@@ -9,8 +9,8 @@ import android.widget.ImageView;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
|
||||
import com.mogo.eagle.core.function.map.R;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.R;
|
||||
|
||||
/**
|
||||
* author : 李小鹏
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.mogo.eagle.core.function.impl.marker;
|
||||
|
||||
import static com.mogo.commons.module.ServiceConst.CARD_TYPE_USER_DATA;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.ModuleNames;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
@@ -26,7 +27,7 @@ public class MapMarkerAdapter {
|
||||
*/
|
||||
public static IMarkerView getMarkerView(Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options) {
|
||||
|
||||
if (TextUtils.equals(markerShowEntity.getMarkerType(), ModuleNames.CARD_TYPE_USER_DATA)) {
|
||||
if (TextUtils.equals(markerShowEntity.getMarkerType(), CARD_TYPE_USER_DATA)) {
|
||||
return OnlineCarMarkerView.getInstance();
|
||||
} else {
|
||||
if (MogoStatusManager.getInstance().isVrMode()) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.eagle.core.function.impl.marker;
|
||||
|
||||
import static com.mogo.commons.module.ServiceConst.CARD_TYPE_ROAD_CONDITION;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -14,7 +16,6 @@ import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
|
||||
import com.mogo.eagle.core.function.map.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.ModuleNames;
|
||||
import com.mogo.eagle.core.data.config.CloudPoiManager;
|
||||
|
||||
/**
|
||||
@@ -69,7 +70,7 @@ public class MapMarkerView extends MapMarkerBaseView {
|
||||
public void updateView( MarkerShowEntity markerShowEntity ) {
|
||||
Object bindObj = markerShowEntity.getBindObj();
|
||||
switch ( markerShowEntity.getMarkerType() ) {
|
||||
case ModuleNames.CARD_TYPE_ROAD_CONDITION:
|
||||
case CARD_TYPE_ROAD_CONDITION:
|
||||
if ( mMarkerShowEntity != null && mMarkerShowEntity.isChecked() ) {
|
||||
clMarkerTopView.setBackgroundResource( R.drawable.module_services_marker_vr_bkg_checked );
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.mogo.eagle.core.function.smp;
|
||||
|
||||
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.BIZ_SLW;
|
||||
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.V2I;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAP;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -9,7 +7,6 @@ import android.graphics.Color;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -35,28 +32,20 @@ import com.amap.api.maps.model.PolylineOptions;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager;
|
||||
import com.mogo.eagle.core.function.map.R;
|
||||
import com.mogo.eagle.core.function.smp.view.ISmallMapDirectionView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.eagle.core.widget.RoundLayout;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.module.common.utils.DrivingDirectionUtils;
|
||||
import com.zhjt.service_biz.BizConfig;
|
||||
import com.mogo.commons.utils.DrivingDirectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* 小地图的方向View
|
||||
*
|
||||
|
||||
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 714 B After Width: | Height: | Size: 714 B |
|
Before Width: | Height: | Size: 455 B After Width: | Height: | Size: 455 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
@@ -11,14 +11,14 @@
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/clMarkerTopView"
|
||||
android:layout_width="@dimen/module_service_marker_bubble_width"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:background="@drawable/module_services_marker_bkg"
|
||||
android:layout_height="@dimen/module_service_marker_bubble_height">
|
||||
android:layout_height="@dimen/dp_130">
|
||||
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivIcon"
|
||||
android:layout_width="@dimen/module_service_marker_bubble_icon_width"
|
||||
android:layout_height="@dimen/module_service_marker_bubble_icon_height"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="@dimen/module_service_marker_bubble_icon_marginBottom"
|
||||
tools:src="@drawable/icon_map_marker_road_block_up2" />
|
||||
@@ -29,6 +29,6 @@
|
||||
android:id="@+id/ivCar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_service_marker_dot_marginTop"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:src="@drawable/icon_map_marker_location_yellow" />
|
||||
</LinearLayout>
|
||||
@@ -11,9 +11,9 @@
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/clMarkerTopView"
|
||||
android:layout_width="@dimen/module_service_marker_bubble_vr_width"
|
||||
android:layout_width="@dimen/dp_55"
|
||||
android:background="@drawable/module_services_marker_vr_bkg"
|
||||
android:layout_height="@dimen/module_service_marker_bubble_vr_height">
|
||||
android:layout_height="@dimen/dp_69">
|
||||
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivIcon"
|
||||
@@ -29,6 +29,6 @@
|
||||
android:id="@+id/ivCar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_service_marker_dot_marginTop"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:src="@drawable/icon_map_marker_location_yellow_vr" />
|
||||
</LinearLayout>
|
||||
@@ -8,6 +8,7 @@ import androidx.core.util.Pair
|
||||
import androidx.localbroadcastmanager.content.*
|
||||
import com.mogo.cloud.commons.utils.*
|
||||
import com.mogo.cloud.passport.*
|
||||
import com.mogo.commons.module.ServiceConst.CARD_TYPE_ROAD_CONDITION
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
@@ -55,7 +56,6 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import com.mogo.map.listener.*
|
||||
import com.mogo.map.marker.*
|
||||
import com.mogo.module.common.*
|
||||
import com.mogo.v2x.*
|
||||
import com.mogo.v2x.callback.*
|
||||
import com.mogo.v2x.config.*
|
||||
@@ -128,7 +128,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
|
||||
BridgeApi.registerCenter()?.let {
|
||||
it.registerMogoMapListener(MODULE_NAME, this)
|
||||
it.registerMogoMarkerClickListener(
|
||||
ModuleNames.CARD_TYPE_ROAD_CONDITION,
|
||||
CARD_TYPE_ROAD_CONDITION,
|
||||
object : IMogoMarkerClickListener {
|
||||
override fun onMarkerClicked(marker: IMogoMarker?): Boolean {
|
||||
handleRoadConditionMarkerClick(marker)
|
||||
@@ -146,7 +146,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
|
||||
CallerMapLocationListenerManager.removeListener(TAG, false)
|
||||
BridgeApi.registerCenter()?.let {
|
||||
it.unregisterMogoMapListener(MODULE_NAME)
|
||||
it.unregisterMogoMarkerClickListener(ModuleNames.CARD_TYPE_ROAD_CONDITION)
|
||||
it.unregisterMogoMarkerClickListener(CARD_TYPE_ROAD_CONDITION)
|
||||
}
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.ACC_STATUS, this)
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.SEEK_HELPING, this)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.manager.impl;
|
||||
|
||||
import static com.mogo.commons.module.ServiceConst.CARD_TYPE_NOVELTY;
|
||||
import static com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_EVENT_ALARM_POI;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
|
||||
|
||||
@@ -57,7 +58,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
private static final CopyOnWriteArraySet<V2XRoadEventEntity> mV2XRoadEventEntityArrayList = new CopyOnWriteArraySet<>();
|
||||
// 上次的道路事件的预警Marker
|
||||
private static IMogoMarker mAlarmInfoMarker;
|
||||
public static final String CARD_TYPE_NOVELTY = "CARD_TYPE_NOVELTY";
|
||||
|
||||
@Override
|
||||
public void drawableLastAllPOI() {
|
||||
|
||||
@@ -10,6 +10,7 @@ import androidx.lifecycle.*
|
||||
import androidx.lifecycle.Lifecycle.Event
|
||||
import androidx.lifecycle.Lifecycle.Event.ON_CREATE
|
||||
import androidx.lifecycle.Lifecycle.Event.ON_DESTROY
|
||||
import com.mogo.commons.utils.DrivingDirectionUtils
|
||||
import com.mogo.eagle.core.data.map.*
|
||||
import com.mogo.eagle.core.data.map.MapRoadInfo.StopLine
|
||||
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.road
|
||||
import android.graphics.*
|
||||
import android.util.*
|
||||
import com.mogo.cloud.commons.utils.*
|
||||
import com.mogo.commons.utils.DrivingDirectionUtils
|
||||
import com.mogo.eagle.core.data.map.*
|
||||
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.context
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.module.common.utils.Trigonometric;
|
||||
import com.mogo.commons.utils.Trigonometric;
|
||||
import com.mogo.v2x.data.V2XLocation;
|
||||
import com.mogo.v2x.data.V2XWarningTarget;
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:alpha="0.6"
|
||||
android:textColor="@color/v2x_FFF_666"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_v2x_event_sub_title_text_size"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivEventDistanceLogo"
|
||||
app:layout_constraintStart_toEndOf="@id/ivEventDistanceLogo"
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:alpha="0.6"
|
||||
android:textColor="@color/v2x_FFF_666"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_v2x_event_sub_title_text_size"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivEventDistanceLogo"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/event_share_load_status"
|
||||
android:layout_width="@dimen/v2x_share_btn_width"
|
||||
android:layout_width="@dimen/dp_150"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/module_dw_common_corner_bkg_light"
|
||||
|
||||
@@ -62,14 +62,14 @@
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:alpha="0.6"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/v2x_FFF_666"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_v2x_event_sub_title_text_size"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tvAddress"
|
||||
app:layout_constraintStart_toStartOf="@+id/tagEventType"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvAddress"
|
||||
tools:text="违章人数:10人" />
|
||||
|
||||
<com.mogo.module.v2x.view.HeartLikeView
|
||||
<com.mogo.eagle.core.function.v2x.events.view.HeartLikeView
|
||||
android:id="@+id/llIllegalParkingLike"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -78,7 +78,7 @@
|
||||
app:layout_constraintEnd_toStartOf="@+id/llIllegalParkingUnLike"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.module.v2x.view.HeartUnLikeView
|
||||
<com.mogo.eagle.core.function.v2x.events.view.HeartUnLikeView
|
||||
android:id="@+id/llIllegalParkingUnLike"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:alpha="0.6"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/v2x_FFF_666"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_v2x_event_sub_title_text_size"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tvAddress"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/v2x_FFF_333"
|
||||
android:textSize="@dimen/share_item_address"
|
||||
android:textSize="@dimen/dp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@+id/llIllegalParkingLike"
|
||||
app:layout_constraintStart_toStartOf="@id/tagEventType"
|
||||
@@ -38,7 +38,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.6"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/v2x_FFF_666"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_26"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tvAddress"
|
||||
app:layout_constraintStart_toStartOf="@+id/tvAddress"
|
||||
@@ -60,7 +60,7 @@
|
||||
android:paddingBottom="@dimen/dp_3"
|
||||
android:text="违章停车"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/panel_list_item_title_size"
|
||||
android:textSize="@dimen/dp_26"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvIllegalNum" />
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_marginEnd="@dimen/dp_30"
|
||||
android:textColor="@color/v2x_FFF_333"
|
||||
android:textSize="@dimen/share_item_address"
|
||||
android:textSize="@dimen/dp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ivFaultHelpEventCall"
|
||||
app:layout_constraintStart_toEndOf="@id/ivFaultHelpHead"
|
||||
@@ -48,7 +48,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
android:alpha="0.59"
|
||||
android:textColor="@color/v2x_FFF_666"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_26"
|
||||
app:layout_constraintStart_toStartOf="@+id/tvFaultHelpName"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvFaultHelpName"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
android:gravity="center"
|
||||
android:text="周边5公里,暂无交通事件\n
|
||||
你可以试着分享一个交通事件给其他车主"
|
||||
android:textColor="@color/v2x_FFF_666"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_36"
|
||||
app:layout_constraintBottom_toTopOf="@+id/btnShear"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -32,8 +32,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btnShear"
|
||||
android:layout_width="@dimen/v2x_share_btn_width"
|
||||
android:layout_height="@dimen/v2x_share_btn_height"
|
||||
android:layout_width="@dimen/dp_150"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginTop="@dimen/dp_60"
|
||||
android:background="@drawable/bg_v2x_go_to_share"
|
||||
android:gravity="center"
|
||||
@@ -46,8 +46,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btnRefresh"
|
||||
android:layout_width="@dimen/v2x_share_btn_width"
|
||||
android:layout_height="@dimen/v2x_share_btn_height"
|
||||
android:layout_width="@dimen/dp_150"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginStart="@dimen/dp_60"
|
||||
android:layout_marginTop="@dimen/dp_60"
|
||||
android:background="@drawable/module_dw_common_corner_bkg_light"
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivIcon"
|
||||
android:layout_width="@dimen/module_service_marker_bubble_width"
|
||||
android:layout_height="@dimen/module_service_marker_bubble_height"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_130"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/v2x_obu_traffic_light_pop" />
|
||||
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
package com.mogo.module.common.view;
|
||||
package com.mogo.eagle.core.utilcode.mogo.view;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/25
|
||||
*
|
||||
* 防止短时间内多次点击
|
||||
*/
|
||||
abstract class OnPreventFastClickListener implements View.OnClickListener {
|
||||
public abstract class OnPreventFastClickListener implements View.OnClickListener {
|
||||
|
||||
public static final long INTERVAL = 1_000L;
|
||||
|
||||
private long mInterval;
|
||||
private final long mInterval;
|
||||
private long mLastClickTime = 0L;
|
||||
|
||||
public OnPreventFastClickListener() {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.common.view;
|
||||
package com.mogo.eagle.core.utilcode.mogo.view;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
@@ -11,7 +11,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class SpacesItemDecoration extends RecyclerView.ItemDecoration {
|
||||
private int space;
|
||||
private final int space;
|
||||
|
||||
public SpacesItemDecoration(int space) {
|
||||
this.space = space;
|
||||
@@ -13,24 +13,20 @@ public class ServiceConst {
|
||||
*/
|
||||
public static final String TYPE = "STRATEGY_REFRESH";
|
||||
|
||||
/**
|
||||
* 刷新策略模块地址
|
||||
*/
|
||||
public static final String PATH_REFRESH_STRATEGY = "/strategy/refresh";
|
||||
|
||||
/**
|
||||
* 卡片 用户数据
|
||||
*/
|
||||
public static final String CARD_TYPE_USER_DATA = "CARD_TYPE_USER_DATA";
|
||||
|
||||
/**
|
||||
* 卡片 探路数据
|
||||
*/
|
||||
public static final String CARD_TYPE_ROAD_CONDITION = "CARD_TYPE_ROAD_CONDITION";
|
||||
|
||||
/**
|
||||
* 卡片 新鲜事
|
||||
*/
|
||||
public static final String CARD_TYPE_NOVELTY = "CARD_TYPE_NOVELTY";
|
||||
|
||||
|
||||
public static final int ONLINE_SEARCH_LIMIT = 20;
|
||||
public static final int ONLINE_SEARCH_RADIUS = 2_000;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.common.utils;
|
||||
package com.mogo.commons.utils;
|
||||
|
||||
import static java.lang.Math.PI;
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
package com.mogo.commons.utils;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
/**
|
||||
* 莫顿编码
|
||||
*
|
||||
* @author linyang
|
||||
* @since 2020.07.09
|
||||
*/
|
||||
public class MortonCode {
|
||||
|
||||
/**
|
||||
* morton 转 经纬度 时的中间常量
|
||||
*/
|
||||
private static final long NDS_180_DEGREES = 0x7fffffff;
|
||||
|
||||
/**
|
||||
* morton 转 经纬度 时的中间常量
|
||||
*/
|
||||
private static final long NDS_360_DEGREES = 4294967295L;
|
||||
|
||||
/**
|
||||
* morton 转 经纬度 时的中间常量
|
||||
*/
|
||||
private static final long NDS_90_DEGREES = 0x3fffffff;
|
||||
|
||||
/**
|
||||
* 经纬度转 morton 时的中间常量
|
||||
*/
|
||||
private static final double RULE_MORTON = Math.pow( 2, 32 ) / 360;
|
||||
|
||||
/**
|
||||
* morton 转 经纬度 时的中间常量
|
||||
*/
|
||||
private static final double RULE_MORTON_TO_LONLAT = 360.0 / Math.pow( 2, 32 );
|
||||
|
||||
/**
|
||||
* @param lon
|
||||
* @param lat
|
||||
* @return
|
||||
*/
|
||||
public static long wrapEncodeMorton( Double lon, Double lat ) {
|
||||
DecimalFormat decimalFormat = new DecimalFormat( "#.######" );
|
||||
return encodeMorton( Double.valueOf( decimalFormat.format( lon ) ),
|
||||
Double.valueOf( decimalFormat.format( lat ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码 morton code
|
||||
*
|
||||
* @param lon
|
||||
* @param lat
|
||||
* @return
|
||||
*/
|
||||
public static long encodeMorton( Double lon, Double lat ) {
|
||||
|
||||
Long bit = 1L;
|
||||
long mortonCode = 0L;
|
||||
long x = ( long ) ( lon * RULE_MORTON );
|
||||
long y = ( long ) ( lat * RULE_MORTON );
|
||||
|
||||
if ( y < 0 ) {
|
||||
y += 0x7FFFFFFF;
|
||||
}
|
||||
y = y << 1;
|
||||
for ( int i = 0; i < 32; i++ ) {
|
||||
// x-part
|
||||
mortonCode = mortonCode | ( x & bit );
|
||||
x = x << 1;
|
||||
bit = bit << 1;
|
||||
// y-part
|
||||
mortonCode = mortonCode | ( y & bit );
|
||||
y = y << 1;
|
||||
bit = bit << 1;
|
||||
}
|
||||
|
||||
return mortonCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将莫顿码解码为坐标
|
||||
*
|
||||
* @param mortonCode
|
||||
* @return
|
||||
*/
|
||||
public static double[] decodeMorton( long mortonCode ) {
|
||||
long[] midPoint = mortonCodeToCoord( mortonCode );
|
||||
normalizeCoord( midPoint );
|
||||
double[] point = new double[2];
|
||||
|
||||
// 将经纬度长整数转化为 浮点类型
|
||||
point[0] = midPoint[0] * RULE_MORTON_TO_LONLAT;
|
||||
point[1] = midPoint[1] * RULE_MORTON_TO_LONLAT;
|
||||
return point;
|
||||
}
|
||||
|
||||
/**
|
||||
* 莫顿码分别拆解为 编码后的经纬度长整数
|
||||
*
|
||||
* @param mortonCode
|
||||
* @return
|
||||
*/
|
||||
private static long[] mortonCodeToCoord( long mortonCode ) {
|
||||
long bit = 1L;
|
||||
long[] longPoint = new long[2];
|
||||
|
||||
for ( int i = 0; i < 32; i++ ) {
|
||||
longPoint[0] |= mortonCode & bit;
|
||||
mortonCode >>= 1;
|
||||
longPoint[1] |= mortonCode & bit;
|
||||
bit <<= 1;
|
||||
}
|
||||
return longPoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对编码后的经纬度长整数进行解码
|
||||
*
|
||||
* @param midPoint
|
||||
*/
|
||||
private static void normalizeCoord( long[] midPoint ) {
|
||||
// if x > 180 degrees, then subtract 360 degrees
|
||||
if ( midPoint[0] > NDS_180_DEGREES ) {
|
||||
midPoint[0] -=
|
||||
NDS_360_DEGREES + 1; // add 1 because 0 must be counted as well
|
||||
} else if ( midPoint[0] < -NDS_180_DEGREES ) // if x < 180 , x += 360
|
||||
{
|
||||
midPoint[0] +=
|
||||
NDS_360_DEGREES + 1; // add 1 because 0 must be counted as well
|
||||
}
|
||||
|
||||
// if y > 90 degrees, then subtract 180 degrees
|
||||
if ( midPoint[1] > NDS_90_DEGREES ) {
|
||||
midPoint[1] -=
|
||||
NDS_180_DEGREES + 1; // add 1 because 0 must be counted as well
|
||||
} else if ( midPoint[1] < -NDS_90_DEGREES ) // if y < 90, y += 180
|
||||
{
|
||||
midPoint[1] +=
|
||||
NDS_180_DEGREES + 1; // add 1 because 0 must be counted as well
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public static void main( String[] args ) {
|
||||
System.out.println( encodeMorton( 116.39584, 39.98152 ) );
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.common.utils;
|
||||
package com.mogo.commons.utils;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.mogo.commons.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.animation.Interpolator;
|
||||
import android.widget.Scroller;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/19
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class ViewPagerSpeedScroller extends Scroller {
|
||||
|
||||
private int mFixedDuration = 1500;
|
||||
|
||||
public ViewPagerSpeedScroller( Context context ) {
|
||||
super( context );
|
||||
}
|
||||
|
||||
public ViewPagerSpeedScroller( Context context, Interpolator interpolator ) {
|
||||
super( context, interpolator );
|
||||
}
|
||||
|
||||
public ViewPagerSpeedScroller( Context context, Interpolator interpolator, boolean flywheel ) {
|
||||
super( context, interpolator, flywheel );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startScroll( int startX, int startY, int dx, int dy ) {
|
||||
startScroll( startX, startY, dx, dy, mFixedDuration );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startScroll( int startX, int startY, int dx, int dy, int duration ) {
|
||||
super.startScroll( startX, startY, dx, dy, mFixedDuration );
|
||||
}
|
||||
|
||||
public void setFixedDuration( int duration ) {
|
||||
this.mFixedDuration = duration;
|
||||
}
|
||||
|
||||
public static void attach( Context context, Object pager, int duration ) {
|
||||
try {
|
||||
Field filed = pager.getClass().getDeclaredField( "mScroller" );
|
||||
filed.setAccessible( true );
|
||||
ViewPagerSpeedScroller scroller = new ViewPagerSpeedScroller( context, new DecelerateInterpolator() );
|
||||
scroller.setFixedDuration( duration );
|
||||
filed.set( pager, scroller );
|
||||
|
||||
Field field = pager.getClass().getDeclaredField( "mTouchSlop" );
|
||||
field.setAccessible( true );
|
||||
field.setInt( pager, 4 );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
# 基础框架
|
||||
|
||||
## 基于 WindowManger.addView 方式实现的弹窗
|
||||
|
||||
## 大而全数据定义
|
||||
|
||||
## 地图中心点控制策略
|
||||
|
||||
## 自研车机类型判断
|
||||
|
||||
## 模块加载类
|
||||
@@ -51,10 +51,6 @@ android {
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
implementation rootProject.ext.dependencies.androidxccorektx
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
@@ -89,4 +85,3 @@ dependencies {
|
||||
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
|
||||
@@ -1,10 +1 @@
|
||||
#-----CommonModule-----
|
||||
-keep class com.mogo.module.common.machinevision.*{*;}
|
||||
-keep class com.mogo.module.common.constants.*{*;}
|
||||
-keep class com.mogo.module.common.drawer.marker.*{*;}
|
||||
-keep class com.mogo.module.common.entity.*{*;}
|
||||
-keep class com.mogo.module.common.view.*{*;}
|
||||
-keep class com.mogo.module.common.widget.*{*;}
|
||||
-keep class com.mogo.module.common.wm.* {*;}
|
||||
-keep class com.mogo.module.common.MogoModulePaths{*;}
|
||||
-keep class com.mogo.hook.*{*;}
|
||||
@@ -21,6 +21,3 @@
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
#-----CommonModule-----
|
||||
-keep class com.mogo.module.common.entity.** {*;}
|
||||
-keep class com.mogo.module.common.wm.** {*;}
|
||||
-keep class com.mogo.module.common.MogoModulePaths
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.mogo.module.common;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-13
|
||||
* <p>
|
||||
* 各个卡片模块类型
|
||||
*/
|
||||
public class ModuleNames {
|
||||
/**
|
||||
* 卡片 探路数据
|
||||
*/
|
||||
public static final String CARD_TYPE_ROAD_CONDITION = "CARD_TYPE_ROAD_CONDITION";
|
||||
|
||||
/**
|
||||
* 卡片 用户数据
|
||||
*/
|
||||
public static final String CARD_TYPE_USER_DATA = "CARD_TYPE_USER_DATA";
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.mogo.module.common;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-31
|
||||
* <p>
|
||||
* 模块描述信息
|
||||
*/
|
||||
public class MogoModule {
|
||||
|
||||
/**
|
||||
* 模块加载路径
|
||||
*/
|
||||
private String mPath;
|
||||
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
private String mName;
|
||||
|
||||
/**
|
||||
* 广播接收者
|
||||
*/
|
||||
private String mBroadcastAction;
|
||||
|
||||
/**
|
||||
* @param path 模块加载路径
|
||||
* @param name 模块名称
|
||||
*/
|
||||
public MogoModule( String path, String name ) {
|
||||
this.mPath = path;
|
||||
this.mName = name;
|
||||
}
|
||||
|
||||
|
||||
public String getPath() {
|
||||
return mPath;
|
||||
}
|
||||
|
||||
public MogoModule setPath( String path ) {
|
||||
this.mPath = path;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return mName;
|
||||
}
|
||||
|
||||
public MogoModule setName( String name ) {
|
||||
this.mName = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBroadcastAction() {
|
||||
return mBroadcastAction;
|
||||
}
|
||||
|
||||
public MogoModule setBroadcastAction( String broadcastAction ) {
|
||||
this.mBroadcastAction = broadcastAction;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
package com.mogo.module.common;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
* <p>
|
||||
* 模块路由路径
|
||||
*/
|
||||
public class MogoModulePaths {
|
||||
|
||||
private static final List<MogoModule> mMogoModules = new ArrayList<>();
|
||||
|
||||
// 不需要启动APP也能运行的模块
|
||||
private static final List<MogoModule> mMogoBaseModules = new ArrayList<>();
|
||||
|
||||
private static final List<MogoModule> mModuleFunctions = new ArrayList<>();
|
||||
|
||||
private static final List<MogoModule> mModuleFunctionServers = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 添加卡片模块
|
||||
*
|
||||
* @param module
|
||||
*/
|
||||
public static void addModule(MogoModule module) {
|
||||
if (module == null || TextUtils.isEmpty(module.getPath().replace(" ", ""))) {
|
||||
throw new IllegalArgumentException("module path can't be empty or null or blank");
|
||||
}
|
||||
mMogoModules.add(module);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加模块功能
|
||||
*
|
||||
* @param module 功能模块
|
||||
*/
|
||||
public static void addModuleFunction(MogoModule module) {
|
||||
if (module == null || TextUtils.isEmpty(module.getPath().replace(" ", ""))) {
|
||||
throw new IllegalArgumentException("module path can't be empty or null or blank");
|
||||
}
|
||||
mModuleFunctions.add(module);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加 功能服务, 不带UI Fragment的
|
||||
*
|
||||
* @param module 功能模块
|
||||
*/
|
||||
public static void addModuleFunctionServer(MogoModule module) {
|
||||
if (module == null || TextUtils.isEmpty(module.getPath().replace(" ", ""))) {
|
||||
throw new IllegalArgumentException("module path can't be empty or null or blank");
|
||||
}
|
||||
mModuleFunctionServers.add(module);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加基础模块
|
||||
*
|
||||
* @param module
|
||||
*/
|
||||
public static void addBaseModule(MogoModule module) {
|
||||
if (module == null || TextUtils.isEmpty(module.getPath().replace(" ", ""))) {
|
||||
throw new IllegalArgumentException("module path can't be empty or null or blank");
|
||||
}
|
||||
mMogoBaseModules.add(module);
|
||||
}
|
||||
|
||||
public static List<MogoModule> getModules() {
|
||||
return mMogoModules;
|
||||
}
|
||||
|
||||
public static List<MogoModule> getBaseModules() {
|
||||
return mMogoBaseModules;
|
||||
}
|
||||
|
||||
public static List<MogoModule> getModuleFunctions() {
|
||||
return mModuleFunctions;
|
||||
}
|
||||
|
||||
public static List<MogoModule> getModuleFunctionServers() {
|
||||
return mModuleFunctionServers;
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerCardResult extends BaseData {
|
||||
|
||||
private List<String> dataType; // 要查询的类型
|
||||
|
||||
private long messageTime;
|
||||
|
||||
public List<String> getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public void setDataType(List<String> dataType) {
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public long getMessageTime() {
|
||||
return messageTime;
|
||||
}
|
||||
|
||||
public void setMessageTime(long messageTime) {
|
||||
this.messageTime = messageTime;
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerResponse extends BaseData implements Serializable {
|
||||
|
||||
// private int code;
|
||||
// private String msg;
|
||||
private MarkerCardResult result;
|
||||
private String sign;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public MarkerCardResult getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public void setResult(MarkerCardResult result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getSign() {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public void setSign(String sign) {
|
||||
this.sign = sign;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerResponse{" + "result=" + result + ", sign='" + sign + '\'' + ", code=" + code + ", msg='" + msg + '\'' + '}';
|
||||
}
|
||||
}
|
||||
@@ -1,125 +0,0 @@
|
||||
package com.mogo.module.common.utils;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-26
|
||||
* <p>
|
||||
* 车机类型
|
||||
*/
|
||||
public class CarSeries {
|
||||
|
||||
private static boolean invokeFlag = false;
|
||||
private static boolean isF8xxSeries = false;
|
||||
|
||||
public static boolean isF8xxSeries() {
|
||||
if ( invokeFlag ) {
|
||||
return isF8xxSeries;
|
||||
}
|
||||
isF8xxSeries = DebugConfig.getProductFlavor().startsWith( "f" );
|
||||
invokeFlag = true;
|
||||
return isF8xxSeries;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static final int CAR_SERIES_C80X = 10;
|
||||
@Deprecated
|
||||
public static final int CAR_SERIES_D80X = 20;
|
||||
@Deprecated
|
||||
public static final int CAR_SERIES_D81X = 21;
|
||||
@Deprecated
|
||||
public static final int CAR_SERIES_D82X = 22;
|
||||
@Deprecated
|
||||
public static final int CAR_SERIES_D84X = 23;
|
||||
@Deprecated
|
||||
public static final int CAR_SERIES_F80X = 30;
|
||||
@Deprecated
|
||||
public static final int CAR_SERIES_G80X = 40;
|
||||
@Deprecated
|
||||
public static final int CAR_SERIES_E84X = 50;
|
||||
@Deprecated
|
||||
public static final int CAR_SERIES_E84XCD = 51;
|
||||
@Deprecated
|
||||
public static final int CAR_SERIES_E85X = 50;
|
||||
@Deprecated
|
||||
public static final int CAR_SERIES_E85XCD = 51;
|
||||
@Deprecated
|
||||
public static final int CAR_SERIES_E85XJD = 51;
|
||||
|
||||
@Deprecated
|
||||
public static int CAR_SERIES = 0;
|
||||
|
||||
/**
|
||||
* Deprecated.
|
||||
* Use {@link DebugConfig#getProductFlavor()} instead.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getSeries() {
|
||||
if ( CAR_SERIES != 0 ) {
|
||||
return CAR_SERIES;
|
||||
}
|
||||
synchronized ( CarSeries.class ) {
|
||||
if ( CAR_SERIES != 0 ) {
|
||||
return CAR_SERIES;
|
||||
}
|
||||
String device = get( "ro.fota.device" );
|
||||
if ( TextUtils.isEmpty( device ) ) {
|
||||
return CAR_SERIES_F80X;
|
||||
}
|
||||
|
||||
if ( "FG166".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_C80X;
|
||||
} else if ( "D801-802".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_D80X;
|
||||
} else if ( "D801B-802B".equals( device ) ) {
|
||||
// 2+16G
|
||||
CAR_SERIES = CAR_SERIES_D80X;
|
||||
} else if ( "D811-812".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_D81X;
|
||||
} else if ( "D821-822".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_D82X;
|
||||
} else if ( "D841-842".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_D84X;
|
||||
} else if ( "G801-802".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_G80X;
|
||||
} else if ( "F801-802".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_F80X;
|
||||
} else if ( "E841-842".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_E84X;
|
||||
} else if ( "E84XCD".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_E84XCD;
|
||||
} else if ( "E851-852".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_E85X;
|
||||
} else if ( "E85XCD".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_E85XCD;
|
||||
} else if ( "E85XJD".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_E85XJD;
|
||||
} else if ( device.startsWith( "E85" ) ) {
|
||||
CAR_SERIES = CAR_SERIES_E85XJD;
|
||||
} else {
|
||||
CAR_SERIES = CAR_SERIES_F80X;
|
||||
}
|
||||
return CAR_SERIES;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
private static String get( String key ) {
|
||||
String value = "";
|
||||
try {
|
||||
Class< ? > c = Class.forName( "android.os.SystemProperties" );
|
||||
Method get = c.getMethod( "get", new Class[]{String.class, String.class} );
|
||||
value = ( String ) get.invoke( c, new Object[]{key, "unknown"} );
|
||||
} catch ( Exception e ) {
|
||||
value = "";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -1,310 +0,0 @@
|
||||
package com.mogo.module.common.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.mogo.module.common.R;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class CustomRatingBar extends LinearLayout {
|
||||
private Context mContext;
|
||||
/*
|
||||
是否可点击
|
||||
* */
|
||||
private boolean mClickable;
|
||||
/*
|
||||
* 单元总数(心形/星星)
|
||||
* */
|
||||
private int elementCount;
|
||||
/*
|
||||
* 单元点击事件
|
||||
* */
|
||||
private OnRatingChangeListener mOnRatingBarChangeListener;
|
||||
/*
|
||||
* 每个单元的大小
|
||||
* */
|
||||
private float elementWidth;
|
||||
|
||||
private float elementHeight;
|
||||
|
||||
public float getElementWidth() {
|
||||
return elementWidth;
|
||||
}
|
||||
|
||||
public void setElementWidth(float elementWidth) {
|
||||
this.elementWidth = elementWidth;
|
||||
}
|
||||
|
||||
public float getElementHeight() {
|
||||
return elementHeight;
|
||||
}
|
||||
|
||||
public void setElementHeight(float elementHeight) {
|
||||
this.elementHeight = elementHeight;
|
||||
}
|
||||
|
||||
/*
|
||||
* 每个单元间的距离
|
||||
* */
|
||||
private float elementPadding;
|
||||
/*
|
||||
*单元的显示数量,支持小数点
|
||||
* */
|
||||
private float elementStep;
|
||||
/*
|
||||
* 空白的默认单元图片
|
||||
* */
|
||||
private Drawable elementEmptyDrawable;
|
||||
/*
|
||||
* 选中后的单元图片
|
||||
* */
|
||||
private Drawable elementFillDrawable;
|
||||
/*
|
||||
* 半颗单元图片
|
||||
* */
|
||||
private Drawable elementHarfDrawable;
|
||||
/*
|
||||
* 每次点击单元所增加的量是半个还是整个
|
||||
* */
|
||||
private StepSize stepSize;
|
||||
|
||||
/*
|
||||
*添加资源(空白心是白色还是灰色自定义属性)
|
||||
* */
|
||||
private boolean otherHeartImg;
|
||||
|
||||
@Override
|
||||
public boolean isClickable() {
|
||||
return mClickable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setClickable(boolean clickable) {
|
||||
mClickable = clickable;
|
||||
}
|
||||
|
||||
public int getElementCount() {
|
||||
return elementCount;
|
||||
}
|
||||
|
||||
public void setElementCount(int elementCount) {
|
||||
this.elementCount = elementCount;
|
||||
}
|
||||
|
||||
public OnRatingChangeListener getOnRatingBarChangeListener() {
|
||||
return mOnRatingBarChangeListener;
|
||||
}
|
||||
|
||||
public void setOnRatingChangeListener(OnRatingChangeListener onRatingBarChangeListener) {
|
||||
mOnRatingBarChangeListener = onRatingBarChangeListener;
|
||||
}
|
||||
|
||||
public float getElementPadding() {
|
||||
return elementPadding;
|
||||
}
|
||||
|
||||
public void setElementPadding(float elementPadding) {
|
||||
this.elementPadding = elementPadding;
|
||||
}
|
||||
|
||||
public float getElementStep() {
|
||||
return elementStep;
|
||||
}
|
||||
|
||||
public void setElementStep(float elementStep) {
|
||||
this.elementStep = elementStep;
|
||||
}
|
||||
|
||||
public Drawable getElementEmptyDrawable() {
|
||||
return elementEmptyDrawable;
|
||||
}
|
||||
|
||||
public void setElementEmptyDrawable(Drawable elementEmptyDrawable) {
|
||||
this.elementEmptyDrawable = elementEmptyDrawable;
|
||||
}
|
||||
|
||||
public Drawable getElementFillDrawable() {
|
||||
return elementFillDrawable;
|
||||
}
|
||||
|
||||
public void setElementFillDrawable(Drawable elementFillDrawable) {
|
||||
this.elementFillDrawable = elementFillDrawable;
|
||||
}
|
||||
|
||||
public Drawable getElementHarfDrawable() {
|
||||
return elementHarfDrawable;
|
||||
}
|
||||
|
||||
public void setElementHarfDrawable(Drawable elementHarfDrawable) {
|
||||
this.elementHarfDrawable = elementHarfDrawable;
|
||||
}
|
||||
|
||||
|
||||
public void setStepSize(StepSize stepSize) {
|
||||
this.stepSize = stepSize;
|
||||
}
|
||||
|
||||
public CustomRatingBar(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
mContext = context;
|
||||
setOrientation(LinearLayout.HORIZONTAL);
|
||||
TypedArray mTypedArray = context.obtainStyledAttributes(attrs, R.styleable.CustomRatingBar);
|
||||
elementWidth = mTypedArray.getDimension(R.styleable.CustomRatingBar_elenmentWidth,
|
||||
context.getResources().getDimension(R.dimen.heart_ratingbar_width));
|
||||
elementHeight = mTypedArray.getDimension(R.styleable.CustomRatingBar_elenmentHeight,
|
||||
context.getResources().getDimension(R.dimen.heart_ratingbar_height));
|
||||
elementPadding = mTypedArray.getDimension(R.styleable.CustomRatingBar_elenmentPadding,
|
||||
context.getResources().getDimension(R.dimen.ratingbar_padding));
|
||||
/*
|
||||
* 白天模式下 热心指数(白色)和个人中心(灰色)使用不同的资源
|
||||
* 默认灰色
|
||||
* */
|
||||
otherHeartImg = mTypedArray.getBoolean(R.styleable.CustomRatingBar_OtherHeartImg, true);
|
||||
|
||||
elementStep = mTypedArray.getFloat(R.styleable.CustomRatingBar_elenmentStep, 1.0f);
|
||||
stepSize = StepSize.fromStep(mTypedArray.getInt(R.styleable.CustomRatingBar_stepSize, 1));
|
||||
elementCount = mTypedArray.getInteger(R.styleable.CustomRatingBar_elenmentCount, 5);
|
||||
stepSize = StepSize.Half;
|
||||
|
||||
Drawable drawable_empty_default = ContextCompat.getDrawable(context,
|
||||
otherHeartImg == false ? R.drawable.icon_heart_unchoose : R.drawable.icon_heart_unchoose_other);
|
||||
Drawable drawable_half_default = ContextCompat.getDrawable(context,
|
||||
otherHeartImg == false ? R.drawable.icon_heart_second : R.drawable.icon_heart_second_other);
|
||||
Drawable drawable_fill_default = ContextCompat.getDrawable(context, R.drawable.icon_heart_choose);
|
||||
|
||||
Drawable drawable_empty = mTypedArray.getDrawable(R.styleable.CustomRatingBar_elenmentEmpty);
|
||||
Drawable drawable_half = mTypedArray.getDrawable(R.styleable.CustomRatingBar_elenmentHarf);
|
||||
Drawable drawable_fill = mTypedArray.getDrawable(R.styleable.CustomRatingBar_elenmentFill);
|
||||
|
||||
elementEmptyDrawable = drawable_empty != null ? drawable_empty : drawable_empty_default;
|
||||
elementFillDrawable = drawable_half != null ? drawable_half : drawable_fill_default;
|
||||
elementHarfDrawable = drawable_fill != null ? drawable_fill : drawable_half_default;
|
||||
mClickable = mTypedArray.getBoolean(R.styleable.CustomRatingBar_clickable, false);
|
||||
mTypedArray.recycle();
|
||||
for (int i = 0; i < elementCount; ++i) {
|
||||
final ImageView imageView = getElenmentImageView();
|
||||
imageView.setImageDrawable(elementEmptyDrawable);
|
||||
imageView.setOnClickListener(
|
||||
new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mClickable) {
|
||||
//浮点数的整数部分
|
||||
int fint = (int) elementStep;
|
||||
BigDecimal b1 = new BigDecimal(Float.toString(elementStep));
|
||||
BigDecimal b2 = new BigDecimal(Integer.toString(fint));
|
||||
//浮点数的小数部分
|
||||
float fPoint = b1.subtract(b2).floatValue();
|
||||
if (fPoint == 0) {
|
||||
fint -= 1;
|
||||
}
|
||||
|
||||
if (indexOfChild(v) > fint) {
|
||||
setRating(indexOfChild(v) + 1);
|
||||
} else if (indexOfChild(v) == fint) {
|
||||
if (stepSize == StepSize.Full) {//如果是满星 就不考虑半颗星了
|
||||
return;
|
||||
}
|
||||
//点击之后默认每次先增加一颗星,再次点击变为半颗星
|
||||
if (imageView.getDrawable().getCurrent().getConstantState().
|
||||
equals(elementHarfDrawable.getConstantState())) {
|
||||
setRating(indexOfChild(v) + 1);
|
||||
} else {
|
||||
setRating(indexOfChild(v) + 0.5f);
|
||||
}
|
||||
} else {
|
||||
setRating(indexOfChild(v) + 1f);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
addView(imageView);
|
||||
}
|
||||
setRating(elementStep);
|
||||
}
|
||||
|
||||
private ImageView getElenmentImageView() {
|
||||
ImageView imageView = new ImageView(getContext());
|
||||
LayoutParams layout = new LayoutParams(
|
||||
Math.round(mContext.getResources().getDimension(R.dimen.heart_ratingbar_width)),
|
||||
Math.round(mContext.getResources().getDimension(R.dimen.heart_ratingbar_width)));//设置每个单元格在线性布局的大小
|
||||
layout.setMargins(0, 0, Math.round(elementPadding), 0);//设置每颗星星在线性布局的间距
|
||||
imageView.setLayoutParams(layout);
|
||||
imageView.setAdjustViewBounds(true);
|
||||
imageView.setImageDrawable(elementEmptyDrawable);
|
||||
imageView.setMinimumWidth((int) elementWidth);
|
||||
imageView.setMaxWidth((int) elementWidth);
|
||||
imageView.setMinimumHeight((int) elementHeight);
|
||||
imageView.setMaxHeight((int) elementHeight);
|
||||
return imageView;
|
||||
}
|
||||
|
||||
public void setRating(float rating) {
|
||||
if (rating > elementCount)
|
||||
rating = elementCount;
|
||||
|
||||
if (mOnRatingBarChangeListener != null) {
|
||||
mOnRatingBarChangeListener.onRatingChange(rating);
|
||||
}
|
||||
this.elementStep = rating;
|
||||
//浮点数的整数部分
|
||||
int fint = (int) rating;
|
||||
BigDecimal b1 = new BigDecimal(Float.toString(rating));
|
||||
BigDecimal b2 = new BigDecimal(Integer.toString(fint));
|
||||
//浮点数的小数部分
|
||||
float fPoint = b1.subtract(b2).floatValue();
|
||||
|
||||
//设置选中的单元
|
||||
for (int i = 0; i < fint; ++i) {
|
||||
((ImageView) getChildAt(i)).setImageDrawable(elementFillDrawable);
|
||||
}
|
||||
//设置没有选中的单元
|
||||
for (int i = fint; i < elementCount; i++) {
|
||||
((ImageView) getChildAt(i)).setImageDrawable(elementEmptyDrawable);
|
||||
}
|
||||
//小数点默认增加半个
|
||||
if (fPoint > 0) {
|
||||
((ImageView) getChildAt(fint)).setImageDrawable(elementHarfDrawable);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public interface OnRatingChangeListener {
|
||||
void onRatingChange(float ratingCount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 每次增加的方式整颗还是半颗,枚举类型
|
||||
* 类似于View.GONE
|
||||
*/
|
||||
public enum StepSize {
|
||||
Half(0), Full(1);
|
||||
int step;
|
||||
|
||||
StepSize(int step) {
|
||||
this.step = step;
|
||||
}
|
||||
|
||||
public static StepSize fromStep(int step) {
|
||||
for (StepSize f : values()) {
|
||||
if (f.step == step) {
|
||||
return f;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 18 KiB |
@@ -1,75 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="1px">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/clMarkerContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:background="@drawable/bg_map_marker_yellow_info">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivUserHead"
|
||||
android:layout_width="@dimen/dp_76"
|
||||
android:layout_height="@dimen/dp_76"
|
||||
android:layout_gravity="center_vertical"
|
||||
app:miv_failureHolder="@drawable/icon_default_user_head"
|
||||
app:miv_overlayImageId="@drawable/icon_default_user_head"
|
||||
app:miv_placeHolder="@drawable/icon_default_user_head"
|
||||
app:miv_shape="circle" />
|
||||
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivIcon"
|
||||
android:layout_width="@dimen/module_service_marker_bubble_icon_width"
|
||||
android:layout_height="@dimen/module_service_marker_bubble_icon_height"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:visibility="invisible"
|
||||
tools:src="@drawable/icon_map_marker_road_block_up"
|
||||
tools:visibility="visible" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMarkerContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/sp_32" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="@+id/clMarkerContent"
|
||||
app:layout_constraintStart_toStartOf="@+id/clMarkerContent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/clMarkerContent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivReverseTriangle"
|
||||
android:layout_width="@dimen/module_service_marker_anchor_size"
|
||||
android:layout_height="@dimen/module_service_marker_anchor_size"
|
||||
android:src="@drawable/bg_shape_reverse_yellow" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_map_marker_location_yellow" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content" android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:id="@+id/module_map_amap_my_location_bg_iv"
|
||||
android:layout_width="@dimen/module_map_amap_my_location_bg_size"
|
||||
android:layout_height="@dimen/module_map_amap_my_location_bg_size"
|
||||
android:src="@drawable/module_common_my_location_bg"/>
|
||||
<ImageView
|
||||
android:id="@+id/module_map_amap_my_location_iv"
|
||||
android:layout_width="@dimen/module_map_amap_my_location_icon_width"
|
||||
android:layout_height="@dimen/module_map_amap_my_location_icon_height"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/module_map_amap_my_location_icon"/>
|
||||
</FrameLayout>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_commons_marker_car_model"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</FrameLayout>
|
||||
@@ -1,64 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="heart_ratingbar_width">18px</dimen>
|
||||
<dimen name="heart_ratingbar_height">16px</dimen>
|
||||
<dimen name="v2x_panel_loading_top">120px</dimen>
|
||||
<dimen name="v2x_share_btn_width">150px</dimen>
|
||||
<dimen name="v2x_share_btn_height">48px</dimen>
|
||||
<dimen name="share_item_address">17.5000px</dimen>
|
||||
|
||||
|
||||
<dimen name="module_service_marker_anchor_size">16dp</dimen>
|
||||
<dimen name="module_service_marker_dot_marginTop">2dp</dimen>
|
||||
<dimen name="module_service_marker_bubble_width">70px</dimen>
|
||||
<dimen name="module_service_marker_bubble_height">76px</dimen>
|
||||
<dimen name="module_service_marker_bubble_icon_width">35px</dimen>
|
||||
<dimen name="module_service_marker_bubble_icon_height">35px</dimen>
|
||||
<dimen name="module_service_marker_bubble_icon_marginBottom">4px</dimen>
|
||||
|
||||
<dimen name="module_service_marker_bounds_leftMargin">550px</dimen>
|
||||
<dimen name="module_service_marker_bounds_topMargin">208px</dimen>
|
||||
<dimen name="module_service_marker_bounds_bottomMargin">100px</dimen>
|
||||
<dimen name="module_service_marker_bounds_rightMargin">100px</dimen>
|
||||
<dimen name="module_services_info_window_paddingStart">100px</dimen>
|
||||
<dimen name="module_services_info_window_paddingEnd">10px</dimen>
|
||||
<dimen name="module_services_info_window_height">54px</dimen>
|
||||
<dimen name="module_service_user_header_width">44px</dimen>
|
||||
<dimen name="module_service_user_header_height">44px</dimen>
|
||||
<dimen name="module_service_content_textSize">14px</dimen>
|
||||
<dimen name="module_service_tag_textSize">12px</dimen>
|
||||
<dimen name="module_service_content_minWidth">64px</dimen>
|
||||
<dimen name="module_service_id_marker_content_paddingRight">6.5px</dimen>
|
||||
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">10px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_marginTop">2px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginBottom">2px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginRight">6px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingLeft">28px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingBottom">16px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_close_margin_top">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_title_margin_top">28px</dimen>
|
||||
<dimen name="module_services_online_car_panel_title_text_size">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_recycler_view_margin_top">84px</dimen>
|
||||
<dimen name="module_services_load_strategy_textSize">18px</dimen>
|
||||
<dimen name="module_services_panel_item_avatar_size">58px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_textSize">14px</dimen>
|
||||
<dimen name="module_services_panel_item_distance_textSize">16px</dimen>
|
||||
<dimen name="module_services_panel_item_nickname_textSize">18px</dimen>
|
||||
<dimen name="module_services_id_panel_item_avatar_border_width">5px</dimen>
|
||||
<dimen name="module_services_panel_item_padding">20px</dimen>
|
||||
<dimen name="module_services_panel_item_nickname_marginLeft">13px</dimen>
|
||||
<dimen name="module_services_id_panel_item_distance_marginLeft">42px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_bkg_corner">8.89px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_padding">13px</dimen>
|
||||
<dimen name="module_services_panel_item_marginBottom">16px</dimen>
|
||||
<dimen name="module_services_panel_strategy_button_bkg_corner">25px</dimen>
|
||||
<dimen name="module_services_load_strategy_paddingTop">13px</dimen>
|
||||
<dimen name="module_services_load_strategy_paddingLeft">26px</dimen>
|
||||
<dimen name="module_services_load_strategy_marginRight">40px</dimen>
|
||||
<dimen name="module_services_empty_tip_textSize">18px</dimen>
|
||||
<dimen name="module_services_empty_tip_marginTop">28px</dimen>
|
||||
<dimen name="module_services_panel_strategy_button_marginTop">108px</dimen>
|
||||
<dimen name="module_services_panel_item_corner">12.5px</dimen>
|
||||
</resources>
|
||||
@@ -1057,24 +1057,7 @@
|
||||
<dimen name="sp_48">48px</dimen>
|
||||
<dimen name="sp_76">76px</dimen>
|
||||
<dimen name="sp_120">120px</dimen>
|
||||
<dimen name="module_common_shadow_width">-10px</dimen>
|
||||
<dimen name="module_common_shadow_width_pos">10px</dimen>
|
||||
<dimen name="heart_ratingbar_width">34px</dimen>
|
||||
<dimen name="heart_ratingbar_height">30px</dimen>
|
||||
<dimen name="v2x_panel_loading_top">300px</dimen>
|
||||
<dimen name="v2x_share_btn_width">281px</dimen>
|
||||
<dimen name="v2x_share_btn_height">90px</dimen>
|
||||
<dimen name="share_item_address">32px</dimen>
|
||||
<dimen name="panel_list_item_title_size">26px</dimen>
|
||||
|
||||
<dimen name="module_service_marker_anchor_size">20dp</dimen>
|
||||
<dimen name="module_service_marker_dot_marginTop">4dp</dimen>
|
||||
<dimen name="module_service_marker_bubble_width">120px</dimen>
|
||||
<dimen name="module_service_marker_bubble_vr_width">55px</dimen>
|
||||
<dimen name="module_service_marker_bubble_height">130px</dimen>
|
||||
<dimen name="module_service_marker_bubble_vr_height">69px</dimen>
|
||||
<dimen name="module_service_marker_bubble_icon_width">60px</dimen>
|
||||
<dimen name="module_service_marker_bubble_icon_height">60px</dimen>
|
||||
<dimen name="module_service_marker_bubble_icon_vr_width">35px</dimen>
|
||||
<dimen name="module_service_marker_bubble_icon_vr_height">35px</dimen>
|
||||
<dimen name="module_service_marker_bubble_icon_marginBottom">8px</dimen>
|
||||
@@ -1094,11 +1077,6 @@
|
||||
<dimen name="module_service_content_minWidth">120px</dimen>
|
||||
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">20px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_marginTop">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginBottom">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginRight">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingLeft">50px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingBottom">28px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_close_margin_top">36px</dimen>
|
||||
<dimen name="module_services_online_car_panel_title_margin_top">50px</dimen>
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<declare-styleable name="DiscreteScrollView">
|
||||
<attr name="dsv_orientation" format="enum">
|
||||
<enum name="horizontal" value="0" />
|
||||
<enum name="vertical" value="1" />
|
||||
</attr>
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
<declare-styleable name="CustomRatingBar">
|
||||
<!--宽-->
|
||||
<attr name="elenmentWidth" format="dimension" />
|
||||
<!--高-->
|
||||
<attr name="elenmentHeight" format="dimension" />
|
||||
<!--单元间距-->
|
||||
<attr name="elenmentPadding" format="dimension" />
|
||||
<!--单元总数-->
|
||||
<attr name="elenmentCount" format="integer" />
|
||||
<!--空资源-->
|
||||
<attr name="elenmentEmpty" format="reference" />
|
||||
<!--满资源-->
|
||||
<attr name="elenmentFill" format="reference" />
|
||||
<!--半资源-->
|
||||
<attr name="elenmentHarf" format="reference" />
|
||||
<!--是否可点击-->
|
||||
<attr name="clickable" format="boolean" />
|
||||
<!--当前进度-->
|
||||
<attr name="elenmentStep" format="float" />
|
||||
<!--进度方式 半个还是整个-->
|
||||
|
||||
<attr name="stepSize">
|
||||
<enum name="Half" value="0" />
|
||||
<enum name="Full" value="1" />
|
||||
</attr>
|
||||
<attr name="OtherHeartImg" format="boolean" />
|
||||
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="module_commons_dlg_bkg">#99000000</color>
|
||||
<color name="module_commons_wm_dialog_text_textColor">#FFFFFF</color>
|
||||
<color name="v2x_FFF_666">#FFFFFF</color>
|
||||
<color name="module_commons_FFF_333">#FFFFFF</color>
|
||||
</resources>
|
||||
@@ -1045,19 +1045,7 @@
|
||||
<dimen name="sp_40">21.8750px</dimen>
|
||||
<dimen name="sp_42">22.9688px</dimen>
|
||||
<dimen name="sp_48">26.2500px</dimen>
|
||||
<dimen name="module_common_shadow_width">-8px</dimen>
|
||||
<dimen name="module_common_shadow_width_pos">8px</dimen>
|
||||
<dimen name="heart_ratingbar_width">18px</dimen>
|
||||
<dimen name="heart_ratingbar_height">16px</dimen>
|
||||
<dimen name="v2x_panel_loading_top">120px</dimen>
|
||||
<dimen name="v2x_share_btn_width">150px</dimen>
|
||||
<dimen name="v2x_share_btn_height">48px</dimen>
|
||||
<dimen name="share_item_address">17.5000px</dimen>
|
||||
<dimen name="panel_list_item_title_size">15.3125px</dimen>
|
||||
<dimen name="ratingbar_padding">6px</dimen>
|
||||
|
||||
<dimen name="module_service_marker_anchor_size">16dp</dimen>
|
||||
<dimen name="module_service_marker_dot_marginTop">2dp</dimen>
|
||||
<dimen name="module_service_marker_bubble_width">70px</dimen>
|
||||
<dimen name="module_service_marker_bubble_height">76px</dimen>
|
||||
<dimen name="module_service_marker_bubble_icon_width">35px</dimen>
|
||||
@@ -1079,11 +1067,6 @@
|
||||
<dimen name="module_service_id_marker_content_paddingRight">6.5px</dimen>
|
||||
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">10px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_marginTop">2px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginBottom">2px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginRight">0px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingLeft">28px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingBottom">16px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_close_margin_top">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_title_margin_top">28px</dimen>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<resources>
|
||||
<string name="app_name">mogo-module-common</string>
|
||||
<string name="module_commons_button_ok">确认</string>
|
||||
<string name="module_commons_button_cancel">取消</string>
|
||||
<string name="module_commons_exit_navi_content">是否退出导航?</string>
|
||||
</resources>
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="BaseFloatDialogStyle" parent="@android:style/Theme.Dialog">
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:backgroundDimAmount">0.6</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:fullBright">@android:color/transparent</item>
|
||||
<item name="android:fullDark">@android:color/transparent</item>
|
||||
<item name="android:topBright">@android:color/transparent</item>
|
||||
<item name="android:topDark">@android:color/transparent</item>
|
||||
<item name="android:borderlessButtonStyle">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="customHeartHeartRatingBarStyle" parent="@style/Widget.AppCompat.RatingBar">
|
||||
<item name="android:maxWidth">@dimen/heart_ratingbar_width</item>
|
||||
<item name="android:minWidth">@dimen/heart_ratingbar_width</item>
|
||||
<item name="android:minHeight">@dimen/heart_ratingbar_height</item>
|
||||
<item name="android:maxHeight">@dimen/heart_ratingbar_height</item>
|
||||
<item name="android:numStars">5</item>
|
||||
<item name="android:rating">1</item>
|
||||
<item name="android:stepSize">0.5</item>
|
||||
<item name="android:progressDrawable">@drawable/module_commons_heart_ratingbar_drawable</item>
|
||||
</style>
|
||||
|
||||
<declare-styleable name="RoundLayout">
|
||||
<attr name="roundLayoutRadius" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||