[清扫车]作业任务小地图和作业任务全览图布局搭建

This commit is contained in:
bxb
2023-02-22 11:34:36 +08:00
parent cba1b8c1aa
commit 87d30e4768
29 changed files with 927 additions and 60 deletions

View File

@@ -0,0 +1,10 @@
package com.mogo.och.sweeper.bean
data class WeltDataBean(
var locLon: Double,//经度
var locLat: Double,//纬度
var weltDistance: Double,//贴边距离
var cleanMode: Int,//清扫模式
var cleanDirection: Int,//清扫方向
var cleanIntensity: Int,//作业强度
)

View File

@@ -7,6 +7,6 @@ import chassis.ChassisStatesOuterClass;
/**
* 上装状态回调
*/
public interface CleaningModeStateCallback {
public interface ICleaningModeStateCallback {
void cleaningModeState(OperateStateEnum cleaningModeState, ChassisStatesOuterClass.SweeperFuTianTaskSystemStates cleanSystemState,boolean isSelectPureSweepMode);
}

View File

@@ -0,0 +1,5 @@
package com.mogo.och.sweeper.callback
interface IWeltMapSwitchToSmallCallback {
fun onWeltMapSwitchToSmall()
}

View File

@@ -24,10 +24,15 @@ import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.och.common.module.map.AmapNaviToDestinationModel;
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
import com.mogo.och.sweeper.R;
import com.mogo.och.sweeper.view.SweeperCurrentTaskInfoView;
import com.mogo.och.sweeper.bean.WeltDataBean;
import com.mogo.och.sweeper.callback.IWeltMapSwitchToSmallCallback;
import com.mogo.och.sweeper.view.SweeperTrafficDataView;
import com.mogo.och.sweeper.view.SweeperWorkModeView;
import com.mogo.och.sweeper.view.WeltSmallMapView;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.Group;
@@ -41,7 +46,7 @@ import androidx.fragment.app.FragmentTransaction;
* @author tongchenfei
*/
public abstract class BaseSweeperTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener,
View.OnClickListener {
View.OnClickListener, IWeltMapSwitchToSmallCallback {
private static final String TAG = "BaseSweeperTabFragment";
//地图放大缩小
@@ -65,8 +70,15 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
private SweeperAmapNaviFragment mOchAmapNaviFragment;
//关闭人工驾驶小地图
private ImageView mCloseNavIcon;
//
//刷新人工驾驶地图按钮
private ImageView mRefreshNavi;
//作业任务贴边数据展示图
private WeltSmallMapView mMapWeltView;
//切换到任务作业全览图
private ImageView mMapSwitchToBig;
//任务作业全览图
private WeltMapOverViewFragment mWeltMapOverViewFragment;
private FrameLayout mFlWeltMapOverView;
@Override
protected int getLayoutId() {
@@ -90,6 +102,9 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl);
mCloseNavIcon = findViewById(R.id.sweeper_close_navi_icon);
mRefreshNavi = findViewById(R.id.sweeper_refresh_navi);
mMapWeltView = findViewById(R.id.sweeper_task_welt_small_map);
mMapSwitchToBig = findViewById(R.id.sweeper_switch_to_big);
mFlWeltMapOverView = findViewById(R.id.sweeper_welt_map_overview);
initListener();
//设置左下角四个按钮监听事件
setBottomBtnListener();
@@ -127,17 +142,22 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
protected void initViews(Bundle savedInstanceState) {
super.initViews(savedInstanceState);
mapBizView.onCreate(savedInstanceState);
mMapWeltView.onCreateView(savedInstanceState);
//mock 贴边数据
setWeltData();
}
@Override
public void onPause() {
super.onPause();
mMapWeltView.onPause();
}
@Override
public void onResume() {
super.onResume();
mapBizView.onResume();
mMapWeltView.onResume();
}
@Override
@@ -163,13 +183,16 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(TAG, this);
mCloseNavIcon.setOnClickListener(this);
mRefreshNavi.setOnClickListener(this);
mMapSwitchToBig.setOnClickListener(this);
}
/**
* 清扫车任务列表面板view在{@link #initViews()}时候添加到container中
*
* @return 站点面板view
*/
public abstract int getTaskListPanelViewId();
/**
* 模拟自动驾驶返回状态
*
@@ -201,6 +224,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
@Override
public void onDestroy() {
super.onDestroy();
mMapWeltView.onDestroy();
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(TAG);
}
@@ -282,10 +306,9 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
/**
* 展示人工驾驶地图导航
*
*/
protected void showAmapNaviToStationFragment(boolean isShow) {
if(isShow){
if (isShow) {
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
mOchAmapNaviFragment = SweeperAmapNaviFragment.newInstance();
if (mOchAmapNaviFragment.isAdded()) {
@@ -294,11 +317,12 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
transaction.add(R.id.module_mogo_och_navi_panel_container, mOchAmapNaviFragment).show(mOchAmapNaviFragment);
transaction.commitAllowingStateLoss();
mGroupNaviPanel.setVisibility(View.VISIBLE);
}else{
} else {
AmapNaviToDestinationModel.getInstance(getContext()).destroyAmaNavi();
mGroupNaviPanel.setVisibility(View.GONE);
}
}
@Override
public void onClick(View v) {
int id = v.getId();
@@ -306,7 +330,65 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
showAmapNaviToStationFragment(false);
} else if (id == R.id.sweeper_refresh_navi) {
refreshNavi();
} else if (id == R.id.sweeper_switch_to_big) {
showOrHideOverMapViewFragment(true);
}
}
public abstract void refreshNavi();
/**
* 设置作业任务全览图隐藏或者显示
* @param isShow
*/
public void showOrHideOverMapViewFragment(boolean isShow) {
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
if (isShow) {
mFlWeltMapOverView.setVisibility(View.VISIBLE);
if (mWeltMapOverViewFragment == null) {
mWeltMapOverViewFragment = mWeltMapOverViewFragment.newInstance(this);
}
if (mWeltMapOverViewFragment.isHidden()) {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.show(mWeltMapOverViewFragment).commitAllowingStateLoss();
return;
}
if (mWeltMapOverViewFragment.isAdded()) {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.show(mWeltMapOverViewFragment).commitAllowingStateLoss();
return;
}
transaction
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.add(R.id.sweeper_welt_map_overview, mWeltMapOverViewFragment)
.show(mWeltMapOverViewFragment).commitAllowingStateLoss();
} else {
mFlWeltMapOverView.setVisibility(View.GONE);
if (mWeltMapOverViewFragment != null) {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE)
.hide(mWeltMapOverViewFragment).commitAllowingStateLoss();
}
}
}
@Override
public void onWeltMapSwitchToSmall() {
showOrHideOverMapViewFragment(false);
}
/**
* mock 贴边假数据
*/
private void setWeltData() {
List<WeltDataBean> weltDataBean = new ArrayList<>();
weltDataBean.add(new WeltDataBean(116.38851540542558, 39.97419244219622, -10, 1, 1, 1));
weltDataBean.add(new WeltDataBean(116.38777443467706, 39.96694323029558, 8, 1, 1, 1));
weltDataBean.add(new WeltDataBean(116.39311478161825, 39.967085313029074, 16, 1, 1, 1));
weltDataBean.add(new WeltDataBean(116.40963237692603, 39.975055860562826, 30, 1, 1, 1));
weltDataBean.add(new WeltDataBean(116.41146331146084, 39.97513910337909, -9999.0, 1, 1, 1));
weltDataBean.add(new WeltDataBean(116.40748849300006, 39.96752223478818, -10000.0, 1, 1, 1));
weltDataBean.add(new WeltDataBean(116.42670283855335, 39.97526250389533, 1000, 1, 1, 1));
mMapWeltView.setWeltData(weltDataBean);
mMapWeltView.drawablePolyline();
}
}

View File

@@ -4,7 +4,6 @@ import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import chassis.ChassisStatesOuterClass
import com.elegant.utils.UiThreadHandler
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.och.sweeper.R
import com.mogo.och.sweeper.bean.SubInfo
@@ -24,7 +23,7 @@ import kotlinx.android.synthetic.main.sweeper_no_data_common_view.*
/**
* 清扫车主界面
*/
class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresenter?>(), MenuPopWindow.OnMenuItemOnClickListener {
class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresenter?>(), MenuPopWindow.OnMenuItemOnClickListener{
private var mAdapter: TaskListAdapter? = null
private var mCurrentSubPosition: Int = 0 //子任务下标
private var mMainMutableList: MutableList<SweeperMainTaskBean>? = null

View File

@@ -0,0 +1,94 @@
package com.mogo.och.sweeper.fragment
import android.os.Bundle
import com.mogo.commons.mvp.BaseFragment
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
import com.mogo.och.sweeper.R
import com.mogo.och.sweeper.bean.WeltDataBean
import com.mogo.och.sweeper.callback.IWeltMapSwitchToSmallCallback
import kotlinx.android.synthetic.main.fragment_welt_map_overview.*
import kotlinx.android.synthetic.main.sweeper_welt_map_overview.*
class WeltMapOverViewFragment(var mIWeltMapSwitchToSmallCallBack: IWeltMapSwitchToSmallCallback?) : BaseFragment() {
override fun getLayoutId(): Int = R.layout.fragment_welt_map_overview
override fun getTagName(): String {
return "WeltMapOverViewFragment"
}
override fun initViews() {
}
override fun initViews(savedInstanceState: Bundle?) {
super.initViews(savedInstanceState)
weltMapOverView.onCreateView(savedInstanceState)
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
setWeltData()
setLegendData()
sweeperSwitchToSmall.setOnClickListener {
mIWeltMapSwitchToSmallCallBack?.onWeltMapSwitchToSmall()
}
}
companion object {
@JvmStatic
fun newInstance(mIWeltMapSwitchToSmallCallBack: IWeltMapSwitchToSmallCallback): WeltMapOverViewFragment {
val args = Bundle()
val fragment = WeltMapOverViewFragment(mIWeltMapSwitchToSmallCallBack)
fragment.arguments = args
return fragment
}
}
override fun onPause() {
super.onPause()
weltMapOverView.onPause()
}
override fun onResume() {
super.onResume()
weltMapOverView.onResume()
}
override fun onDestroy() {
super.onDestroy()
weltMapOverView.onDestroy()
}
/**
* mock 贴边假数据
*/
private fun setWeltData() {
val weltDataBean: MutableList<WeltDataBean> = ArrayList()
weltDataBean.add(WeltDataBean(116.38851540542558, 39.97419244219622, -10.0, 1, 1, 1))
weltDataBean.add(WeltDataBean(116.38777443467706, 39.96694323029558, 8.0, 1, 1, 1))
weltDataBean.add(WeltDataBean(116.39311478161825, 39.967085313029074, 16.0, 1, 1, 1))
weltDataBean.add(WeltDataBean(116.40963237692603, 39.975055860562826, 30.0, 1, 1, 1))
weltDataBean.add(WeltDataBean(116.41146331146084, 39.97513910337909, -9999.0, 1, 1, 1))
weltDataBean.add(WeltDataBean(116.40748849300006, 39.96752223478818, -10000.0, 1, 1, 1))
weltDataBean.add(WeltDataBean(116.42670283855335, 39.97526250389533, 1000.0, 1, 1, 1))
weltMapOverView.setWeltData(weltDataBean)
weltMapOverView.drawablePolyline()
weltMapOverView.addStartAndEndMarker(
CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(context, 116.38851540542558, 39.97419244219622),
CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(
context, 116.42670283855335, 39.97526250389533
)
)
}
/**
* 设置图例数据
*/
private fun setLegendData() {
sweeperLegend1.setData(R.drawable.sweeper_legend1, "a<10")
sweeperLegend2.setData(R.drawable.sweeper_legend2, "0≤a<10")
sweeperLegend3.setData(R.drawable.sweeper_legend3, "10≤a<20")
sweeperLegend4.setData(R.drawable.sweeper_legend4, "a≥20")
sweeperLegend5.setData(R.drawable.sweeper_legend5, "非贴边")
sweeperLegend6.setData(R.drawable.sweeper_legend6, "未经过")
}
}

View File

@@ -292,6 +292,7 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
@Override
public void onSweeperFutianTaskIndexData(@NonNull RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex roboSweeperTaskIndex) {
}
/**

View File

@@ -30,10 +30,9 @@ import androidx.annotation.Nullable;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.och.sweeper.R;
import com.mogo.och.sweeper.callback.CleaningModeStateCallback;
import com.mogo.och.sweeper.callback.ICleaningModeStateCallback;
import com.mogo.och.sweeper.constant.OperateStateEnum;
import com.mogo.och.sweeper.util.SweeperFutianCmdUtil;
import com.mogo.och.sweeper.view.NoTouchConstraintLayout;
@@ -121,7 +120,7 @@ public class SweeperOperatePanelView extends LinearLayout {
};
private boolean isSelectPureSweepMode = false;//用于标注是否选中纯扫
private CleaningModeStateCallback cleaningModeStateCallback;
private ICleaningModeStateCallback cleaningModeStateCallback;
private OperateStateEnum operateStateEnum = OperateStateEnum.SYNCING_STATUS;
@@ -724,7 +723,7 @@ public class SweeperOperatePanelView extends LinearLayout {
}
public void setSweeperFutianCleanSystemState(ChassisStatesOuterClass.SweeperFuTianTaskSystemStates cleanSystemState,
CleaningModeStateCallback cleaningModeStateCallback) {
ICleaningModeStateCallback cleaningModeStateCallback) {
this.cleaningModeStateCallback = cleaningModeStateCallback;
// 有命令正在执行
if (mCurrentCmdRequestCallback != null) {

View File

@@ -8,7 +8,7 @@ import android.view.ViewGroup
import android.widget.PopupWindow
import chassis.ChassisStatesOuterClass
import com.mogo.och.sweeper.R
import com.mogo.och.sweeper.callback.CleaningModeStateCallback
import com.mogo.och.sweeper.callback.ICleaningModeStateCallback
import com.mogo.och.sweeper.constant.OperateStateEnum
import com.mogo.och.sweeper.ui.SweeperOperatePanelView
@@ -35,7 +35,7 @@ class SweeperOperatePanelPopWindow : PopupWindow{
*/
fun setCleanSystemState(
cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates?,
cleaningModeStateCallback: CleaningModeStateCallback
cleaningModeStateCallback: ICleaningModeStateCallback
) {
mOperatePanelView?.setSweeperFutianCleanSystemState(cleanSystemState, cleaningModeStateCallback)
}

View File

@@ -0,0 +1,32 @@
package com.mogo.och.sweeper.view
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.LinearLayout
import com.mogo.och.sweeper.R
import kotlinx.android.synthetic.main.sweeper_item_legend.view.*
/**
* 任务路线全览图图例
*/
class LegendItemView:LinearLayout {
constructor(context: Context) : super(context) {}
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
initView(context)
}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {}
private fun initView(context: Context) {
LayoutInflater.from(context).inflate(R.layout.sweeper_item_legend, this)
}
/**
* 设置数据
*/
fun setData(resId:Int,text:String){
sweeperLegendIcon.setImageResource(resId)
sweeperLegendText.text = text
}
}

View File

@@ -10,7 +10,7 @@ import com.elegant.utils.UiThreadHandler
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.och.sweeper.R
import com.mogo.och.sweeper.callback.CleaningModeStateCallback
import com.mogo.och.sweeper.callback.ICleaningModeStateCallback
import com.mogo.och.sweeper.constant.OperateStateEnum
import com.mogo.och.sweeper.constant.SubTaskTypeEnum
import com.mogo.och.sweeper.ui.popwindow.SweeperOperatePanelPopWindow
@@ -20,7 +20,7 @@ import kotlinx.android.synthetic.main.sweeper_work_mode.view.*
/**
* 清扫车模式信息展示
*/
class SweeperWorkModeView : ConstraintLayout, CleaningModeStateCallback {
class SweeperWorkModeView : ConstraintLayout, ICleaningModeStateCallback {
private var isSelectPureSweepMode: Boolean = false
private val TAG = "SweeperWorkModeView"

View File

@@ -0,0 +1,212 @@
package com.mogo.och.sweeper.view
import android.content.Context
import android.graphics.Color
import android.os.Bundle
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.ImageView
import androidx.constraintlayout.widget.ConstraintLayout
import com.amap.api.maps.AMap
import com.amap.api.maps.CameraUpdateFactory
import com.amap.api.maps.model.*
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
import com.mogo.och.sweeper.R
import com.mogo.och.sweeper.bean.WeltDataBean
import kotlinx.android.synthetic.main.sweeper_welt_map_overview.view.*
/**
* 作业任务全览图
*/
class WeltMapOverView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
private var mWeltData: MutableList<WeltDataBean> = mutableListOf() //任务数据集合
private var mCoordinatesLatLng: MutableList<LatLng> = mutableListOf() //任务坐标点
private var mCarMarker: Marker? = null
private var mAMap: AMap? = null
private var mPolyline: Polyline? = null
private var colorList: MutableList<Int> = mutableListOf()
private val mLineMarkers: MutableList<Marker?> = mutableListOf()
//清扫车任务地图
private val TAG = "WeltMapOverView"
constructor(context: Context) : super(context) {}
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
initView(context)
}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {}
private fun initView(context: Context) {
LayoutInflater.from(context).inflate(R.layout.sweeper_welt_map_overview, this)
initAMapView()
// 注册定位监听
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
setLegendData()
}
private fun initAMapView() {
mAMap = sweeperTextureMapView.map
// 地图文字标注
mAMap?.showMapText(true)
//显示3D建筑物
mAMap?.showBuildings(true)
// 设置导航地图模式aMap是地图控制器对象。
mAMap?.mapType = AMap.MAP_TYPE_NIGHT
// 关闭显示实时路况图层aMap是地图控制器对象。
mAMap?.isTrafficEnabled = false
// 设置 锚点 图标
mCarMarker = mAMap?.addMarker(
MarkerOptions()
.icon(BitmapDescriptorFactory.fromResource(R.drawable.sweeper_car_small))
.anchor(0.5f, 0.5f)
)
// 设置地图的样式
val uiSettings = mAMap?.uiSettings
uiSettings?.isZoomControlsEnabled = false // 地图缩放级别的交换按钮
uiSettings?.setAllGesturesEnabled(false) // 所有手势
uiSettings?.isMyLocationButtonEnabled = false // 显示默认的定位按钮
uiSettings?.setLogoBottomMargin(-150) //设置Logo下边界距离屏幕底部的边距,设置为负值即可
mAMap?.setOnMapLoadedListener(AMap.OnMapLoadedListener {
CallerLogger.d(SceneConstant.M_SWEEPER + TAG, "WeltView---onMapLoaded")
// 实时路况图层关闭必须添加在loaded结束之后,其他位置不生效
mAMap?.isTrafficEnabled = false
mAMap?.showBuildings(true)
})
}
/**
* 添加画线颜色值
*/
private fun addRouteColorList() {
for (i in mWeltData.indices) {
if (mWeltData[i].weltDistance == -9999.0) {//未经过
colorList.add(Color.parseColor("#3BA1CC"))
} else if (mWeltData[i].weltDistance == -10000.0) {//非贴边
colorList.add(Color.parseColor("#236299"))
} else if (mWeltData[i].weltDistance < 0) {
colorList.add(Color.parseColor("#C22101"))
} else if (mWeltData[i].weltDistance >= 0 && mWeltData[i].weltDistance < 10) {
colorList.add(Color.parseColor("#4DFFA4"))
} else if (mWeltData[i].weltDistance >= 10 && mWeltData[i].weltDistance < 20) {
colorList.add(Color.parseColor("#FFDD4D"))
} else if (mWeltData[i].weltDistance >= 20) {
colorList.add(Color.parseColor("#FF912B"))
}
}
}
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
mogoLocation?.let { gnssInfo ->
val currentLatLng = LatLng(gnssInfo.latitude, gnssInfo.longitude)
//更新车辆位置
mCarMarker?.rotateAngle = (360 - gnssInfo.heading).toFloat()
mCarMarker?.position = currentLatLng
mCarMarker?.setToTop()
//圈定地图显示范围
val boundsBuilder = LatLngBounds.Builder()
if (mCoordinatesLatLng.size > 0) {
//存放经纬度
for (i in mCoordinatesLatLng.indices) {
boundsBuilder.include(mCoordinatesLatLng[i])
}
boundsBuilder.include(currentLatLng)
mAMap?.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(), 100, 100, 100, 100))
}
}
}
/**
* 根据贴边数据绘制任务路线
*/
fun drawablePolyline() {
mPolyline?.remove()
if (mAMap != null) {
addRouteColorList()
if (mWeltData.size >= 2 && mCoordinatesLatLng.size > 2) {
//设置线段纹理
val polylineOptions = PolylineOptions()
polylineOptions.addAll(mCoordinatesLatLng)
polylineOptions.width(14f) //线段宽度
polylineOptions.isUseTexture = false
polylineOptions.lineCapType(PolylineOptions.LineCapType.LineCapSquare)
polylineOptions.colorValues(colorList)
// 绘制线
mPolyline = mAMap?.addPolyline(polylineOptions)
}
}
}
/**
* 添加起点和终点的marker
*/
fun addStartAndEndMarker(startPoint: LatLng, endPoint: LatLng) {
val startMarker = mAMap?.addMarker(MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.start_maker_icon)))
startMarker?.position = startPoint
mLineMarkers.add(startMarker)
val endMarker = mAMap?.addMarker(MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.end_maker_icon)))
endMarker?.position = endPoint
mLineMarkers.add(endMarker)
}
/**
* 清除maker
*/
private fun clearMarkers() {
for (i in mLineMarkers.indices) {
mLineMarkers[i]?.isVisible = false
mLineMarkers[i]?.remove()
}
mLineMarkers.clear()
}
/**
* 清除任务路线
*/
fun clearPolyline() {
mPolyline?.remove()
}
/**
* 设置贴边数据
*/
fun setWeltData(weltData: MutableList<WeltDataBean>) {
this.mWeltData = weltData
for (i in mWeltData.indices) {
mCoordinatesLatLng.add(CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(context, mWeltData[i].locLon, mWeltData[i].locLat))
}
}
/**
* 设置图例数据
*/
private fun setLegendData() {
sweeperLegend1.setData(R.drawable.sweeper_legend1, "a<10")
sweeperLegend2.setData(R.drawable.sweeper_legend2, "0≤a<10")
sweeperLegend3.setData(R.drawable.sweeper_legend3, "10≤a<20")
sweeperLegend4.setData(R.drawable.sweeper_legend4, "a≥20")
sweeperLegend5.setData(R.drawable.sweeper_legend5, "非贴边")
sweeperLegend6.setData(R.drawable.sweeper_legend6, "未经过")
}
fun onCreateView(savedInstanceState: Bundle?) {
sweeperTextureMapView.onCreate(savedInstanceState)
}
fun onResume() {
sweeperTextureMapView.onResume()
}
fun onPause() {
sweeperTextureMapView.onPause()
}
fun onDestroy() {
sweeperTextureMapView.onDestroy()
}
fun getSweeperSwitchToSmall(): ImageView {
return sweeperSwitchToSmall
}
}

View File

@@ -0,0 +1,208 @@
package com.mogo.och.sweeper.view
import android.content.Context
import android.graphics.Color
import android.os.Bundle
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.amap.api.maps.AMap
import com.amap.api.maps.CameraUpdateFactory
import com.amap.api.maps.model.*
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
import com.mogo.och.sweeper.R
import com.mogo.och.sweeper.bean.WeltDataBean
import kotlinx.android.synthetic.main.sweeper_welt_small_map_view.view.*
/**
* 作业任务小地图
*/
class WeltSmallMapView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
private var mWeltData: MutableList<WeltDataBean> = mutableListOf() //任务数据集合
private var mCoordinatesLatLng: MutableList<LatLng> = mutableListOf() //任务坐标点
private var mCarMarker: Marker? = null
private var mAMap: AMap? = null
private var mPolyline: Polyline? = null
private var colorList: MutableList<Int> = mutableListOf()
private val mLineMarkers: MutableList<Marker?> = mutableListOf()
//清扫车任务地图
private val TAG = "WeltMapView"
constructor(context: Context) : super(context) {}
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
initView(context)
}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {}
private fun initView(context: Context) {
LayoutInflater.from(context).inflate(R.layout.sweeper_welt_small_map_view, this)
initAMapView()
// 注册定位监听
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
}
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
mogoLocation?.let {
val currentLatLng = LatLng(it.latitude, it.longitude)
drawCarMarker(mogoLocation)
//圈定地图显示范围
val boundsBuilder = LatLngBounds.Builder()
if (mCoordinatesLatLng.size > 0) {
//存放经纬度
for (i in mCoordinatesLatLng.indices) {
boundsBuilder.include(mCoordinatesLatLng[i])
}
}
boundsBuilder.include(currentLatLng)
mAMap!!.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(), 100, 100, 100, 100))
}
}
/**
* 绘制自车
*
* @param location
*/
private fun drawCarMarker(location: MogoLocation?) {
if (location == null) return
val currentLatLng = LatLng(location.latitude, location.longitude)
//更新车辆位置
if (mCarMarker != null) {
mCarMarker!!.rotateAngle = (360 - location.heading).toFloat()
mCarMarker!!.position = currentLatLng
mCarMarker!!.setToTop()
}
}
private fun initAMapView() {
mAMap = sweeperSmallTextureMapView?.map
// 地图文字标注
mAMap?.showMapText(true)
// 设置导航地图模式aMap是地图控制器对象。
mAMap?.mapType = AMap.MAP_TYPE_NIGHT
// 关闭显示实时路况图层aMap是地图控制器对象。
mAMap?.isTrafficEnabled = false
// 设置 锚点 图标
mCarMarker = mAMap?.addMarker(
MarkerOptions()
.icon(BitmapDescriptorFactory.fromResource(R.drawable.sweeper_car_small))
.anchor(0.5f, 0.5f)
)
// 设置地图的样式
val uiSettings = mAMap?.uiSettings
uiSettings?.isZoomControlsEnabled = false // 地图缩放级别的交换按钮
uiSettings?.setAllGesturesEnabled(false) // 所有手势
uiSettings?.isMyLocationButtonEnabled = false // 显示默认的定位按钮
uiSettings?.setLogoBottomMargin(-150) //设置Logo下边界距离屏幕底部的边距,设置为负值即可
mAMap?.setOnMapLoadedListener(AMap.OnMapLoadedListener {
d(SceneConstant.M_SWEEPER + TAG, "WeltView---onMapLoaded")
//mAMap?.setPointToCenter(mAMapNaviView?.width?.div(2) ?: 0, mAMapNaviView?.height?.div(2) ?: 0)
})
}
/**
* 添加画线颜色值
*/
private fun addRouteColorList() {
for (i in mWeltData.indices) {
if (mWeltData[i].weltDistance == -9999.0) {//未经过
colorList.add(Color.parseColor("#3BA1CC"))
} else if (mWeltData[i].weltDistance == -10000.0) {//非贴边
colorList.add(Color.parseColor("#236299"))
} else if (mWeltData[i].weltDistance < 0) {
colorList.add(Color.parseColor("#C22101"))
} else if (mWeltData[i].weltDistance >= 0 && mWeltData[i].weltDistance < 10) {
colorList.add(Color.parseColor("#4DFFA4"))
} else if (mWeltData[i].weltDistance >= 10 && mWeltData[i].weltDistance < 20) {
colorList.add(Color.parseColor("#FFDD4D"))
} else if (mWeltData[i].weltDistance >= 20) {
colorList.add(Color.parseColor("#FF912B"))
}
}
}
/**
* 根据贴边数据绘制任务路线
*/
fun drawablePolyline() {
mPolyline?.remove()
if (mAMap != null) {
addRouteColorList()
if (mWeltData.size >= 2 && mCoordinatesLatLng.size > 2) {
val polylineOptions = PolylineOptions()
polylineOptions.addAll(mCoordinatesLatLng)
polylineOptions.width(14f) //线段宽度
polylineOptions.isUseTexture = false
polylineOptions.lineCapType(PolylineOptions.LineCapType.LineCapSquare)
polylineOptions.colorValues(colorList)
// 绘制线
mPolyline = mAMap?.addPolyline(polylineOptions)
addStartAndEndMarker(mCoordinatesLatLng[0], mCoordinatesLatLng[mCoordinatesLatLng.size - 1])
}
}
}
/**
* 添加起点和终点的marker
*/
private fun addStartAndEndMarker(startPoint: LatLng, endPoint: LatLng) {
val startMarker = mAMap?.addMarker(MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.start_maker_icon)))
startMarker?.position = startPoint
mLineMarkers.add(startMarker)
val endMarker = mAMap?.addMarker(MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.end_maker_icon)))
endMarker?.position = endPoint
mLineMarkers.add(endMarker)
}
/**
* 清除数据
*/
private fun clearMarkers() {
for (i in mLineMarkers.indices) {
mLineMarkers[i]?.isVisible = false
mLineMarkers[i]?.remove()
}
mLineMarkers.clear()
}
/**
* 清除任务路线
*/
fun clearPolyline() {
mPolyline?.remove()
}
/**
* 设置贴边数据
*/
fun setWeltData(weltData: MutableList<WeltDataBean>) {
this.mWeltData = weltData
for (i in mWeltData.indices) {
mCoordinatesLatLng.add(CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(context, mWeltData[i].locLon, mWeltData[i].locLat))
}
}
fun onCreateView(savedInstanceState: Bundle?) {
sweeperSmallTextureMapView?.onCreate(savedInstanceState)
}
fun onResume() {
sweeperSmallTextureMapView?.onResume()
}
fun onPause() {
sweeperSmallTextureMapView?.onPause()
}
fun onDestroy() {
sweeperSmallTextureMapView?.onDestroy()
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#C22101"/>
<corners android:radius="@dimen/dp_10"/>
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#4DFFA4"/>
<corners android:radius="@dimen/dp_10"/>
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#FFDD4D"/>
<corners android:radius="@dimen/dp_10"/>
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#FF912B"/>
<corners android:radius="@dimen/dp_10"/>
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#3BA1CC"/>
<corners android:radius="@dimen/dp_10"/>
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#236299"/>
<corners android:radius="@dimen/dp_10"/>
</shape>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mogo.och.sweeper.view.WeltMapOverView
android:id="@+id/weltMapOverView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>

View File

@@ -2,15 +2,15 @@
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/sweeper_root_View"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_72"
android:id="@+id/sweeper_root_View">
android:layout_marginTop="@dimen/dp_72">
<com.mogo.eagle.core.function.view.MapBizView
android:id="@+id/mapBizView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
<!--车辆基本交通信息-->
<com.mogo.och.sweeper.view.SweeperTrafficDataView
@@ -18,8 +18,8 @@
android:layout_width="@dimen/dp_616"
android:layout_height="@dimen/dp_320"
android:layout_marginLeft="@dimen/dp_13"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--V2X预警红色边框-->
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
@@ -92,11 +92,25 @@
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_41"
android:layout_marginBottom="@dimen/dp_30"
app:layout_constraintBottom_toTopOf="@+id/sweeper_switch_model_layout"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/sweeper_arc"
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call"
app:layout_constraintBottom_toTopOf="@+id/sweeper_switch_model_layout"
android:layout_marginBottom="@dimen/dp_30"/>
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call" />
<com.mogo.och.common.module.wigets.OCHRoundConstraintLayout
android:layout_width="@dimen/dp_711"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_27"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:roundLayoutRadius="@dimen/dp_20"
android:layout_marginEnd="@dimen/dp_36">
<com.mogo.och.sweeper.view.WeltSmallMapView
android:id="@+id/sweeper_task_welt_small_map"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</com.mogo.och.common.module.wigets.OCHRoundConstraintLayout>
<!--切换地图远近事件-->
<LinearLayout
android:id="@+id/sweeper_switch_model_layout"
@@ -131,6 +145,7 @@
android:elevation="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout">
<ImageView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
@@ -148,12 +163,12 @@
android:elevation="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/sweeper_switch_model_layout">
<ImageView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_gravity="center"
android:background="@drawable/sweeper_setting_btn_bg"
/>
android:background="@drawable/sweeper_setting_btn_bg" />
</FrameLayout>
<FrameLayout
@@ -179,30 +194,37 @@
android:id="@+id/module_mogo_och_navi_panel_container"
android:layout_width="@dimen/dp_600"
android:layout_height="@dimen/dp_600"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginEnd="@dimen/module_mogo_och_margin_right"
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"/>
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<ImageView
android:id="@+id/sweeper_close_navi_icon"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:visibility="gone"
android:src="@drawable/sweeper_close_navi_icon"
app:layout_constraintTop_toTopOf="@+id/module_mogo_och_navi_panel_container"
app:layout_constraintStart_toStartOf="@+id/module_mogo_och_navi_panel_container"
android:layout_marginTop="@dimen/dp_26"
android:layout_marginStart="@dimen/dp_24"
/>
android:layout_marginTop="@dimen/dp_26"
android:src="@drawable/sweeper_close_navi_icon"
android:visibility="gone"
app:layout_constraintStart_toStartOf="@+id/module_mogo_och_navi_panel_container"
app:layout_constraintTop_toTopOf="@+id/module_mogo_och_navi_panel_container" />
<ImageView
android:id="@+id/sweeper_refresh_navi"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_marginTop="@dimen/dp_26"
android:layout_marginEnd="@dimen/dp_24"
app:layout_constraintTop_toTopOf="@+id/module_mogo_och_navi_panel_container"
app:layout_constraintEnd_toEndOf="@+id/module_mogo_och_navi_panel_container"
android:src="@drawable/sweeper_navi_refresh"
app:layout_constraintEnd_toEndOf="@+id/module_mogo_och_navi_panel_container"
app:layout_constraintTop_toTopOf="@+id/module_mogo_och_navi_panel_container" />
<FrameLayout
android:id="@+id/sweeper_welt_map_overview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible"
/>
<androidx.constraintlayout.widget.Group
android:id="@+id/group_navi_panel"
@@ -212,6 +234,7 @@
app:constraint_referenced_ids="module_mogo_och_navi_panel_container,sweeper_close_navi_icon
,sweeper_refresh_navi"
tools:visibility="visible" />
<Button
android:id="@+id/btnAutopilotDisable"
android:layout_width="wrap_content"
@@ -241,6 +264,7 @@
android:textSize="30sp"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotEnable" />
<androidx.constraintlayout.widget.Group
android:id="@+id/groupTestPanel"
android:layout_width="wrap_content"

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dp_210"
android:layout_height="@dimen/dp_80"
android:orientation="horizontal">
<ImageView
android:id="@+id/sweeperLegendIcon"
android:layout_width="@dimen/dp_60"
android:layout_height="@dimen/dp_16"
android:layout_gravity="center_vertical"
android:src="@drawable/sweeper_legend1" />
<TextView
android:id="@+id/sweeperLegendText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/dp_15"
android:gravity="center"
android:text="10_a_20"
android:textColor="@color/white"
android:textSize="@dimen/dp_32" />
</LinearLayout>

View File

@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.amap.api.maps.TextureMapView
android:id="@+id/sweeperTextureMapView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ImageView
android:id="@+id/sweeperSwitchToSmall"
android:layout_width="@dimen/dp_73"
android:layout_height="@dimen/dp_73"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:src="@drawable/sweeper_full_screen_icon"
android:layout_marginEnd="@dimen/dp_50"
android:layout_marginTop="@dimen/dp_50"/>
<com.mogo.och.common.module.wigets.OCHRoundConstraintLayout
android:layout_width="@dimen/dp_366"
android:layout_height="@dimen/dp_573"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginBottom="@dimen/dp_80"
android:layout_marginEnd="@dimen/dp_80"
app:roundLayoutRadius="@dimen/dp_16"
android:background="#0E1D38">
<TextView
android:id="@+id/taskProgressTv"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="进度:60%"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="#3f69d9"
android:textColor="@color/white"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textSize="@dimen/dp_34"
app:layout_constraintWidth_percent="0.5"
android:gravity="center"
/>
<TextView
android:id="@+id/taskWeltDistanceTv"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="贴边:8cm"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="#3d98c7"
android:textColor="@color/white"
app:layout_constraintStart_toEndOf="@+id/taskProgressTv"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textSize="@dimen/dp_34"
android:gravity="center"
app:layout_constraintWidth_percent="0.5"/>
<com.mogo.och.sweeper.view.LegendItemView
android:id="@+id/sweeperLegend1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
app:layout_constraintTop_toBottomOf="@+id/taskProgressTv"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
/>
<com.mogo.och.sweeper.view.LegendItemView
android:id="@+id/sweeperLegend2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/sweeperLegend1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<com.mogo.och.sweeper.view.LegendItemView
android:id="@+id/sweeperLegend3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/sweeperLegend2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<com.mogo.och.sweeper.view.LegendItemView
android:id="@+id/sweeperLegend4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/sweeperLegend3"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<com.mogo.och.sweeper.view.LegendItemView
android:id="@+id/sweeperLegend5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/sweeperLegend4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<com.mogo.och.sweeper.view.LegendItemView
android:id="@+id/sweeperLegend6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/sweeperLegend5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
</com.mogo.och.common.module.wigets.OCHRoundConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.amap.api.maps.TextureMapView
android:id="@+id/sweeperSmallTextureMapView"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_400"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<ImageView
android:id="@+id/sweeper_switch_to_big"
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:src="@drawable/sweeper_full_screen_icon"
android:layout_marginEnd="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_20"/>
<TextView
android:id="@+id/taskProgressTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="进度:60%"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="#3f69d9"
android:textColor="@color/white"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
/>
<TextView
android:id="@+id/taskWeltDistanceTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="贴边:8cm"
app:layout_constraintTop_toTopOf="parent"
android:background="#3d98c7"
android:textColor="@color/white"
app:layout_constraintStart_toEndOf="@+id/taskProgressTv"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,23 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SwitchLineDialogStyle" parent="Theme.AppCompat.Dialog">
<item name="theme">@android:style/Theme.Translucent</item>
<!--是否去除标题 -->
<item name="windowNoTitle">true</item>
<!-- 背景透明 -->
<item name="android:background">#00000000</item>
<item name="android:windowBackground">#00000000</item>
<!-- 没有windowActionBar-->
<item name="windowActionBar">false</item>
<item name="android:windowContentOverlay">@null</item>
<!-- 设置窗体外面允不允许点击-->
<item name="android:windowCloseOnTouchOutside">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
<resources xmlns:tools="http://schemas.android.com/tools">
</resources>