浏览代码

feat 需求40、41

lihao1 3 年之前
父节点
当前提交
9b32aa1d36

+ 3 - 1
cadengine/src/main/java/cn/sagacloud/android/cadengine/items/SpaceItem.kt

@@ -10,7 +10,7 @@ import com.sybotan.android.graphy.SGraphyItem
  *
  * @author 付国宝
  */
-class SpaceItem(private val data: Space, parent: SGraphyItem? = null) : SGraphyItem(parent) {
+class SpaceItem(val data: Space, parent: SGraphyItem? = null) : SGraphyItem(parent) {
     /** 画笔 */
     val paint = Paint()
 
@@ -45,6 +45,7 @@ class SpaceItem(private val data: Space, parent: SGraphyItem? = null) : SGraphyI
 
                 for (line in data.outLine!!) {
                     if (line.size < 1) {
+                        mPoints.add(PointF(data.outLine!![0][0].x, data.outLine!![0][0].y))
                         continue
                     }
 
@@ -63,6 +64,7 @@ class SpaceItem(private val data: Space, parent: SGraphyItem? = null) : SGraphyI
                         if (-p.y > maxY) {
                             maxY = -p.y
                         }
+                        mPoints.add(PointF(p.x, p.y))
                         path.lineTo(p.x, -p.y)
                     }
                     path.close()

+ 1 - 0
cadengine/src/main/java/cn/sagacloud/android/cadengine/types/Point.kt

@@ -23,6 +23,7 @@ class Point {
 
     var scalePoint = 1.0f
     var remark: String? = null
+    var name: String? = null
     var type: String? = null
     var position: String? = null
 

+ 100 - 102
demo/src/main/java/com/sybotan/android/demo/activities/GraphyActivity.kt

@@ -85,6 +85,7 @@ import com.sybotan.android.graphy.SGraphyView
 import com.sybotan.android.graphy.events.SGraphyViewMoveEvent
 import com.yuyh.library.imgsel.ImageLoader
 import com.yuyh.library.imgsel.ImgSelConfig
+import com.yuyh.library.imgsel.utils.LogUtils
 import com.zbar.lib.CaptureActivity
 import io.reactivex.ObservableEmitter
 import org.greenrobot.eventbus.EventBus
@@ -629,6 +630,7 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
                         return
                     }
                     var hasChooseEquip = false
+                    var equipList = ArrayList<EquipItem>()
                     for (point in scene.equipList) {
                         val sqrt = Math.sqrt(
                             Math.pow(
@@ -636,84 +638,22 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
                                 2.0
                             ) + Math.pow(Math.abs(y - point.data.mY).toDouble(), 2.0)
                         ).toInt()
-                        if (!hasChooseEquip && sqrt < realDistance) {
+                        if (sqrt < realDistance) {
+                            equipList.add(point)
                             hasChooseEquip = true
-                            equipDetail.alpha = 1f
-                            equipDelete.alpha = 1f
-                            equipDetail.isEnabled = true
-                            equipDelete.isEnabled = true
-                            graphyVM.getContainer(point.data.deviceId!!)
-                            point.data.equipState = 4
-                            equipDetail.setOnClickListener {
-                                val intent =
-                                    Intent(this@GraphyActivity, EquipDetailActivity::class.java)
-                                val bundle = Bundle()
-                                val positon = Position()
-                                positon.x = point.data.mX.toString()
-                                positon.y = point.data.mY.toString()
-                                val z = Z()
-                                val position = gson.fromJson(point.data.position, Z::class.java)
-                                z.offset = position.offset
-                                z.region = position.region
-                                positon.z = z
-                                bundle.putString("spaceId", scene.choseSpace!!.data.id)
-                                bundle.putSerializable("position", positon)
-                                bundle.putString("buildingId", buildingId)
-                                bundle.putString("floorId", floorId)
-                                bundle.putString("deviceId", point.data.deviceId)
-                                bundle.putString("projectId", projectId)
-                                bundle.putString("floorMap", floorMap)
-                                bundle.putFloat("scale", scene.view!!.scale)
-                                bundle.putParcelable(
-                                    "centerPoint",
-                                    graphyView.mapToScene(
-                                        PointF(
-                                            graphyView.width / 2f,
-                                            graphyView.height / 2f
-                                        )
-                                    )
-                                )
-                                intent.putExtra("equip", bundle)
-                                startActivityForResult(intent, REQUEST_CODE_EQUIP)
-                            }
-                            equipContainer.setOnClickListener {
-                                val intent =
-                                    Intent(this@GraphyActivity, EquipContainerActivity::class.java)
-                                val bundle = Bundle()
-                                bundle.putString("buildingId", buildingId)
-                                bundle.putString("floorId", floorId)
-                                bundle.putString("projectId", projectId)
-                                bundle.putString("deviceId", point.data.deviceId)
-                                val position =
-                                    gson.fromJson(point.data.position, Position::class.java)
-                                bundle.putSerializable("position", position)
-                                bundle.putString("spaceId", scene.choseSpace!!.data.id)
-                                intent.putExtra("params", bundle)
-                                startActivity(intent)
-                            }
-                            equipDelete.setOnClickListener {
-                                val builder: AlertDialog.Builder =
-                                    AlertDialog.Builder(this@GraphyActivity)
-                                        .setTitle("确认标记/删除设备吗")
-                                        .setPositiveButton(
-                                            "确定"
-                                        ) { _, _ ->
-                                            graphyVM.insProblemEquip(
-                                                scene.choseSpace!!,
-                                                point.data.deviceId!!
-                                            )
-                                        }.setNegativeButton(
-                                            "取消"
-                                        ) { dialogInterface, _ ->
-                                            dialogInterface.dismiss()
-                                        }
-                                builder.create().show()
-
-
-                            }
-
+                        }
+                        point.data.equipState = point.data.equipType
+                    }
+                    if (!CommonUtils.IsNull(equipList)) {
+                        if (equipList.size == 1) {
+                            val point = equipList[0]
+                            initEquipDetail(point)
                         } else {
-                            point.data.equipState = point.data.equipType
+                            val pop = SelectListSinglePopupWindow(this@GraphyActivity)
+                            pop.setGenList(equipList, Constant.TYPE4)
+                            pop.setBtn(false, "")
+                            pop.showAtLocation(root, Gravity.BOTTOM or Gravity.CENTER_HORIZONTAL, 0, 0)
+                            pop.setOnItemClickListener { initEquipDetail(equipList[it]) }
                         }
                     }
                     if (!hasChooseEquip) {
@@ -980,6 +920,82 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
         })
     }
 
+    private fun initEquipDetail(point: EquipItem) {
+        equipDetail.alpha = 1f
+        equipDelete.alpha = 1f
+        equipDetail.isEnabled = true
+        equipDelete.isEnabled = true
+        graphyVM.getContainer(point.data.deviceId!!)
+        point.data.equipState = 4
+        equipDetail.setOnClickListener {
+            val intent =
+                Intent(this@GraphyActivity, EquipDetailActivity::class.java)
+            val bundle = Bundle()
+            val positon = Position()
+            positon.x = point.data.mX.toString()
+            positon.y = point.data.mY.toString()
+            val z = Z()
+            val position = gson.fromJson(point.data.position, Z::class.java)
+            z.offset = position.offset
+            z.region = position.region
+            positon.z = z
+            bundle.putString("spaceId", scene.choseSpace!!.data.id)
+            bundle.putSerializable("position", positon)
+            bundle.putString("buildingId", buildingId)
+            bundle.putString("floorId", floorId)
+            bundle.putString("deviceId", point.data.deviceId)
+            bundle.putString("projectId", projectId)
+            bundle.putString("floorMap", floorMap)
+            bundle.putFloat("scale", scene.view!!.scale)
+            bundle.putParcelable(
+                "centerPoint",
+                graphyView.mapToScene(
+                    PointF(
+                        graphyView.width / 2f,
+                        graphyView.height / 2f
+                    )
+                )
+            )
+            intent.putExtra("equip", bundle)
+            startActivityForResult(intent, REQUEST_CODE_EQUIP)
+        }
+        equipContainer.setOnClickListener {
+            val intent =
+                Intent(this@GraphyActivity, EquipContainerActivity::class.java)
+            val bundle = Bundle()
+            bundle.putString("buildingId", buildingId)
+            bundle.putString("floorId", floorId)
+            bundle.putString("projectId", projectId)
+            bundle.putString("deviceId", point.data.deviceId)
+            val position =
+                gson.fromJson(point.data.position, Position::class.java)
+            bundle.putSerializable("position", position)
+            bundle.putString("spaceId", scene.choseSpace!!.data.id)
+            intent.putExtra("params", bundle)
+            startActivity(intent)
+        }
+        equipDelete.setOnClickListener {
+            val builder: AlertDialog.Builder =
+                AlertDialog.Builder(this@GraphyActivity)
+                    .setTitle("确认标记/删除设备吗")
+                    .setPositiveButton(
+                        "确定"
+                    ) { _, _ ->
+                        graphyVM.insProblemEquip(
+                            scene.choseSpace!!,
+                            point.data.deviceId!!
+                        )
+                    }.setNegativeButton(
+                        "取消"
+                    ) { dialogInterface, _ ->
+                        dialogInterface.dismiss()
+                    }
+            builder.create().show()
+
+
+        }
+    }
+
     private fun checkSdCardEnabled(): Boolean {
         if (!InstaCameraManager.getInstance().isSdCardEnabled()) {
             Toast.makeText(this, "No SD card inserted or Not enough free space", Toast.LENGTH_SHORT)
@@ -1294,8 +1310,12 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
                         refreshEquip(spaceEqList)
                     }
                     onlySpace.setOnCheckedChangeListener { buttonView, isChecked ->
-                        initEquipChoose(spaceEqList)
-                        refreshEquip(spaceEqList)
+                        if (isChecked) {
+                            initEquipChoose(spaceEqList)
+                            refreshEquip(spaceEqList)
+                        } else {
+                            graphyVM.getSpaceEq(scene.choseSpace)
+                        }
                     }
                     sift.setOnClickListener {
                         graphyVM.getMajor()
@@ -1458,6 +1478,7 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
                 }
             }
         }
+        equipList.sortBy { it.type }
         for (model in equipList) {
             val textview = TextView(this)
             textview.apply {
@@ -1571,30 +1592,6 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
         }
     }
 
-    @Throws(Exception::class)
-    fun deepClone(data: PipeLine): Any? {
-        // 序列化
-        val bos = ByteArrayOutputStream()
-        val oos = ObjectOutputStream(bos)
-        oos.writeObject(data)
-        // 反序列化
-        val bis = ByteArrayInputStream(bos.toByteArray())
-        val ois = ObjectInputStream(bis)
-        return ois.readObject()
-    }
-
-    @Throws(Exception::class)
-    fun deepClone(data: ArrayList<SpaceEqModel>): Any? {
-        // 序列化
-        val bos = ByteArrayOutputStream()
-        val oos = ObjectOutputStream(bos)
-        oos.writeObject(data)
-        // 反序列化
-        val bis = ByteArrayInputStream(bos.toByteArray())
-        val ois = ObjectInputStream(bis)
-        return ois.readObject()
-    }
-
     /**
      * 刷新地图上设备
      */
@@ -1611,6 +1608,7 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
                     point.remark = child.remark
                     point.type = model.type
                     point.equipState = child.type
+                    point.name = child.name
                     point.equipType = child.type
                     point.position = child.position
                     point.deviceId = child.deviceId

+ 111 - 35
demo/src/main/java/com/sybotan/android/demo/activities/ServeAreaActivity.kt

@@ -28,9 +28,12 @@ import android.content.DialogInterface
 import android.graphics.Color
 import android.graphics.PointF
 import android.os.Bundle
+import android.widget.CheckBox
+import android.widget.RadioButton
 import android.widget.TextView
 import androidx.appcompat.app.AlertDialog
 import cn.sagacloud.android.cadengine.FloorScene
+import cn.sagacloud.android.cadengine.Lasso
 import cn.sagacloud.android.cadengine.Opt
 import cn.sagacloud.android.cadengine.items.*
 import cn.sagacloud.android.cadengine.types.*
@@ -39,6 +42,7 @@ import com.google.gson.Gson
 import com.sybotan.android.demo.R
 import com.sybotan.android.demo.bean.result.*
 import com.sybotan.android.demo.graphy.GraphyHelper
+import com.sybotan.android.demo.tools.CommonUtils
 import com.sybotan.android.demo.tools.ToastUtils
 import com.sybotan.android.demo.viewmodel.GraphyVM
 import com.sybotan.android.demo.viewmodel.SpaceMapVM
@@ -71,6 +75,7 @@ class ServeAreaActivity : BaseActivity(), DIAware {
     private lateinit var area: ServeAreaItem
     private lateinit var centerPoint: PointF
     private lateinit var position: Position
+    var tunableSpaceList = ArrayList<TunableSpaceItem>()
 
     /** 楼层地图 */
     private lateinit var floorMap: String
@@ -85,7 +90,8 @@ class ServeAreaActivity : BaseActivity(), DIAware {
     private lateinit var close: TextView
     private lateinit var save: TextView
     private lateinit var delete: TextView
-    val graphyHelper: GraphyHelper = GraphyHelper(scene, this)
+    private lateinit var rect: RadioButton
+    private lateinit var space: RadioButton
 
     /**
      * 创建Activity时的回调函数
@@ -117,6 +123,8 @@ class ServeAreaActivity : BaseActivity(), DIAware {
         close = findViewById(R.id.close)
         save = findViewById(R.id.save)
         delete = findViewById(R.id.delete)
+        rect = findViewById(R.id.rect)
+        space = findViewById(R.id.space)
     }
 
     /**
@@ -148,31 +156,55 @@ class ServeAreaActivity : BaseActivity(), DIAware {
         scene.setOnSingleTopUp(object : FloorScene.OnSingleTopUp {
             @SuppressLint("SetJavaScriptEnabled")
             override fun onSingUp(x: Float, y: Float) {
-                if (points.size < 2) {
-                    val point = PointF(x, -y)
-                    points.add(point)
-                    val item = AreaNodeItem(point)
-                    item.zOrder = 100000f
-                    scene.addItem(item)
-                    items.add(item)
-                    item.setOnScrollListener(object : AreaNodeItem.OnScroll {
-                        override fun onScroll(x: Float, y: Float) {
-                            hasMove = true
-                            scene.removeItem(area)
-                            points.clear()
-                            for (it in items) {
-                                points.add(PointF(it.x, it.y))
+                if (rect.isChecked) {
+                    if (points.size < 2) {
+                        val point = PointF(x, -y)
+                        points.add(point)
+                        val item = AreaNodeItem(point)
+                        item.zOrder = 100000f
+                        scene.addItem(item)
+                        items.add(item)
+                        item.setOnScrollListener(object : AreaNodeItem.OnScroll {
+                            override fun onScroll(x: Float, y: Float) {
+                                hasMove = true
+                                scene.removeItem(area)
+                                points.clear()
+                                for (it in items) {
+                                    points.add(PointF(it.x, it.y))
+                                }
+                                area = ServeAreaItem(points)
+                                area.zOrder = 100000f
+                                scene.addItem(area)
                             }
-                            area = ServeAreaItem(points)
-                            area.zOrder = 100000f
-                            scene.addItem(area)
+                        })
+                    }
+                    if (points.size == 2 && !hasMove) {
+                        hasMove = true
+                        area = ServeAreaItem(points)
+                        area.zOrder = 100000f
+                        scene.addItem(area)
+                    }
+                } else {
+                    for (space in tunableSpaceList) {
+                        val isContain = Lasso.isPolygonContainsPoint(space.mPoints, android.graphics.Point(x.toInt(), -y.toInt()))
+                        if (isContain) {
+                            scene.removeItem(space)
+                            tunableSpaceList.remove(space)
+                            return
                         }
-                    })
-                }
-                if (points.size == 2 && !hasMove) {
-                    area = ServeAreaItem(points)
-                    area.zOrder = 100000f
-                    scene.addItem(area)
+                    }
+
+                    for (space in scene.spaceList) {
+                        val isContain = Lasso.isPolygonContainsPoint(space.mPoints, android.graphics.Point(x.toInt(), -y.toInt()))
+                        if (isContain) {
+                            val tunableSpace = TunableSpace()
+                            tunableSpace.outLine = space.data.outLine
+                            val item = TunableSpaceItem(tunableSpace)
+                            item.zOrder = 99996f
+                            tunableSpaceList.add(item)
+                            scene.addItem(item)
+                        }
+                    }
                 }
             }
         })
@@ -184,11 +216,19 @@ class ServeAreaActivity : BaseActivity(), DIAware {
     private fun initListener() {
         close.setOnClickListener { finish() }
         save.setOnClickListener {
-            if (points.size < 2) {
-                ToastUtils.showMyToast("请绘制服务区域")
-                return@setOnClickListener
+            if (rect.isChecked) {
+                if (points.size < 2) {
+                    ToastUtils.showMyToast("请绘制服务区域")
+                    return@setOnClickListener
+                }
+                spaceMapVM.insServeArea(deviceId, points)
+            } else {
+                if (CommonUtils.IsNull(tunableSpaceList)) {
+                    ToastUtils.showMyToast("请绘制服务区域")
+                    return@setOnClickListener
+                }
+                spaceMapVM.insServeAreas(deviceId, tunableSpaceList)
             }
-            spaceMapVM.insServeArea(deviceId, points)
         }
         delete.setOnClickListener {
             val builder: AlertDialog.Builder =
@@ -197,13 +237,20 @@ class ServeAreaActivity : BaseActivity(), DIAware {
                     .setPositiveButton("确定",
                         DialogInterface.OnClickListener { dialogInterface, i ->
                             spaceMapVM.deleteServeArea(deviceId)
-                            scene.removeItem(area)
-                            for (item in items) {
-                                scene.removeItem(item)
+                            if (rect.isChecked) {
+                                scene.removeItem(area)
+                                for (item in items) {
+                                    scene.removeItem(item)
+                                }
+                                items.clear()
+                                points.clear()
+                                hasMove = false
+                            } else {
+                                for (space in tunableSpaceList) {
+                                    scene.removeItem(space)
+                                }
+                                tunableSpaceList.clear()
                             }
-                            items.clear()
-                            points.clear()
-                            hasMove = false
 
                         }).setNegativeButton("取消",
                         DialogInterface.OnClickListener { dialogInterface, i ->
@@ -211,6 +258,21 @@ class ServeAreaActivity : BaseActivity(), DIAware {
                         })
             builder.create().show()
         }
+
+        rect.setOnClickListener {
+            if (!CommonUtils.IsNull(tunableSpaceList)) {
+                ToastUtils.showMyToast("请先删除服务区域")
+                space.isChecked = true
+                return@setOnClickListener
+            }
+        }
+        space.setOnClickListener {
+            if (!CommonUtils.IsNull(points)) {
+                ToastUtils.showMyToast("请先删除服务区域")
+                rect.isChecked = true
+                return@setOnClickListener
+            }
+        }
     }
 
     /**
@@ -273,8 +335,9 @@ class ServeAreaActivity : BaseActivity(), DIAware {
                     }
                 }
 
-                /** 查询空间和任务 */
+                /** 矩形 */
                 SpaceMapVM.SERVE_AREA -> {
+                    rect.isChecked = true
                     val pa = params as ArrayList<PointF>
                     for (i in 0..pa.size) {
                         if (i == 0 || i == 2) {
@@ -304,6 +367,19 @@ class ServeAreaActivity : BaseActivity(), DIAware {
                     area.zOrder = 100000f
                     scene.addItem(area)
                 }
+                /** 物业空间 */
+                SpaceMapVM.SERVE_AREAS -> {
+                    space.isChecked = true
+                    val param = params as ArrayList<ArrayList<ArrayList<PointZ>>>
+                    for (space in param) {
+                        val tunableSpace = TunableSpace()
+                        tunableSpace.outLine = space
+                        val item = TunableSpaceItem(tunableSpace)
+                        item.zOrder = 99996f
+                        tunableSpaceList.add(item)
+                        scene.addItem(item)
+                    }
+                }
 
             }
         }, this, buildingId, floorId, projectId)

+ 7 - 1
demo/src/main/java/com/sybotan/android/demo/adapter/PersonalSelectSingleAdapter.java

@@ -21,6 +21,8 @@ import com.sybotan.android.demo.retrofit.Constant;
 import java.util.ArrayList;
 import java.util.List;
 
+import cn.sagacloud.android.cadengine.items.EquipItem;
+
 /**
  * Created by cunwen on 16/6/21.
  */
@@ -49,7 +51,7 @@ public class PersonalSelectSingleAdapter extends RecyclerView.Adapter<PersonalSe
     }
 
     @Override
-    public void onBindViewHolder(final BuildViewHolder holder, final int position) {
+    public void onBindViewHolder(final BuildViewHolder holder, int position) {
         final Object item = items.get(position);
         if (type.equals(Constant.TYPE1)) {
             Options options = (Options) item;
@@ -67,6 +69,10 @@ public class PersonalSelectSingleAdapter extends RecyclerView.Adapter<PersonalSe
             MajorEntity options = (MajorEntity) item;
             holder.choice_name.setText(options.getLabel());
         }
+        if (type.equals(Constant.TYPE4)) {
+            EquipItem options = (EquipItem) item;
+            holder.choice_name.setText(options.getData().getType()+":"+options.getData().getName());
+        }
         if (selectPosition > 0 && selectPosition - 1 == position) {
             holder.choice_name.setTextColor(context.getResources().getColor(R.color.blue_2f48b7));
         } else {

+ 1 - 0
demo/src/main/java/com/sybotan/android/demo/retrofit/Constant.java

@@ -22,4 +22,5 @@ public class Constant {
     public static final String TYPE1 = "String";
     public static final String TYPE2 = "equip";
     public static final String TYPE3 = "major";
+    public static final String TYPE4 = "EquipItem";
 }

+ 49 - 5
demo/src/main/java/com/sybotan/android/demo/viewmodel/SpaceMapVM.kt

@@ -437,15 +437,58 @@ class SpaceMapVM(
         }
     }
 
+    fun insServeAreas(deviceId: String, spaces: ArrayList<TunableSpaceItem>) {
+        viewModelScope.launch {
+            val geom = ArrayList<ArrayList<ArrayList<PointZ>>>()
+            for (space in spaces) {
+                geom.add(space.data.outLine!!)
+            }
+            var entity = repo.getServeAreaByObjId(deviceId)
+            if (entity == null) {
+                entity = ServeAreaEntity(
+                    id = IdUtil.simpleUUID(),
+                    projectId = projectId,
+                    buildingId = buildingId,
+                    floorId = floorId,
+                    state = "1",
+                    uploadFlag = null,
+                    valid = 1,
+                    creator = null,
+                    creationTime = null,
+                    modifier = null,
+                    modifiedTime = null,
+                    objId = deviceId,
+                    geomType = "polygon",
+                    geom = gson.toJsonTree(geom),
+                    serveType = null, remark = null
+                )
+            } else {
+                entity.geom = gson.toJsonTree(geom)
+                entity.state = "1"
+            }
+            repo.insServeArea(entity)
+            mActivity.finish()
+        }
+    }
+
     fun getServeArea(deviceId: String) {
         viewModelScope.launch {
             val entity = repo.getServeAreaByObjId(deviceId)
             if (entity != null) {
-                val ar = gson.fromJson<List<PointF>>(
-                    gson.toJson(entity.geom),
-                    object : TypeToken<List<PointF?>?>() {}.type
-                )
-                mEmitter.SendDirective(SERVE_AREA, ar)
+                val array = entity.geom!!.asJsonArray
+                if (array[0].isJsonObject) {
+                    val ar = gson.fromJson<List<PointF>>(
+                        gson.toJson(entity.geom),
+                        object : TypeToken<List<PointF?>?>() {}.type
+                    )
+                    mEmitter.SendDirective(SERVE_AREA, ar)
+                } else {
+                    val ar = gson.fromJson<List<ArrayList<ArrayList<PointZ>>>>(
+                        gson.toJson(entity.geom),
+                        object : TypeToken<List<ArrayList<ArrayList<PointZ>>>>() {}.type
+                    )
+                    mEmitter.SendDirective(SERVE_AREAS, ar)
+                }
             }
         }
     }
@@ -492,6 +535,7 @@ class SpaceMapVM(
 
         //服务区域
         const val SERVE_AREA = "SERVE_AREA"
+        const val SERVE_AREAS = "SERVE_AREAS"
 
     }
 }

+ 0 - 1
demo/src/main/res/layout/activity_graphy.xml

@@ -169,7 +169,6 @@
                     android:layout_height="wrap_content"
                     android:layout_marginLeft="40dp"
                     android:background="@color/grey_300"
-                    android:drawableLeft="@mipmap/sift"
                     android:drawablePadding="5dp"
                     android:padding="5dp"
                     android:paddingLeft="5dp"

+ 4 - 3
demo/src/main/res/layout/activity_serve_area.xml

@@ -58,6 +58,7 @@
             android:orientation="horizontal">
 
             <RadioButton
+                android:id="@+id/rect"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:checked="true"
@@ -67,14 +68,14 @@
                 android:textSize="16sp" />
 
             <RadioButton
+                android:id="@+id/space"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginLeft="40dp"
                 android:paddingLeft="10dp"
-                android:text="圆形"
+                android:text="物业空间"
                 android:textColor="@color/black_272727"
-                android:textSize="16sp"
-                android:visibility="gone" />
+                android:textSize="16sp" />
         </RadioGroup>
 
         <androidx.appcompat.widget.LinearLayoutCompat