feat: 增加交限和交通灯的渲染图标
@ -5,6 +5,11 @@
|
|||||||
"code": 2001,
|
"code": 2001,
|
||||||
"name": "道路线"
|
"name": "道路线"
|
||||||
},
|
},
|
||||||
|
"2002": {
|
||||||
|
"table": "OMDB_RD_LINK_FUNCTION_CLASS",
|
||||||
|
"code": 2002,
|
||||||
|
"name": "道路功能等级"
|
||||||
|
},
|
||||||
"2008": {
|
"2008": {
|
||||||
"table": "OMDB_RD_LINK_KIND",
|
"table": "OMDB_RD_LINK_KIND",
|
||||||
"code": 2008,
|
"code": 2008,
|
||||||
@ -15,6 +20,51 @@
|
|||||||
"code": 2010,
|
"code": 2010,
|
||||||
"name": "道路方向"
|
"name": "道路方向"
|
||||||
},
|
},
|
||||||
|
"2019": {
|
||||||
|
"table": "OMDB_LINK_SPEEDLIMIT",
|
||||||
|
"code": 2019,
|
||||||
|
"name": "常规线限速"
|
||||||
|
},
|
||||||
|
"2020": {
|
||||||
|
"table": "OMDB_LINK_SPEEDLIMIT_COND",
|
||||||
|
"code": 2020,
|
||||||
|
"name": "条件线限速"
|
||||||
|
},
|
||||||
|
"2021": {
|
||||||
|
"table": "OMDB_LINK_SPEEDLIMIT_VAR",
|
||||||
|
"code": 2021,
|
||||||
|
"name": "可变线限速"
|
||||||
|
},
|
||||||
|
"2022": {
|
||||||
|
"table": "OMDB_CON_ACCESS",
|
||||||
|
"code": 2022,
|
||||||
|
"name": "全封闭"
|
||||||
|
},
|
||||||
|
"2037": {
|
||||||
|
"table": "OMDB_FORM_OF_WAY",
|
||||||
|
"code": 2037,
|
||||||
|
"name": "匝道"
|
||||||
|
},
|
||||||
|
"2040": {
|
||||||
|
"table": "OMDB_MULTI_DIGITIZED",
|
||||||
|
"code": 2040,
|
||||||
|
"name": "上下线分离"
|
||||||
|
},
|
||||||
|
"2041":{
|
||||||
|
"table": "OMDB_LANE_NUM",
|
||||||
|
"code": 2041,
|
||||||
|
"name": "车道数"
|
||||||
|
},
|
||||||
|
"2201":{
|
||||||
|
"table": "OMDB_BRIDGE",
|
||||||
|
"code": 2201,
|
||||||
|
"name": "桥"
|
||||||
|
},
|
||||||
|
"2202":{
|
||||||
|
"table": "OMDB_TUNNEL",
|
||||||
|
"code": 2202,
|
||||||
|
"name": "隧道"
|
||||||
|
},
|
||||||
"4002": {
|
"4002": {
|
||||||
"table": "OMDB_SPEEDLIMIT",
|
"table": "OMDB_SPEEDLIMIT",
|
||||||
"code": 4002,
|
"code": 4002,
|
||||||
@ -72,18 +122,36 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"4006":{
|
||||||
|
"table": "OMDB_RESTRICTION",
|
||||||
|
"code": 4006,
|
||||||
|
"name": "普通交限",
|
||||||
|
"transformer": [
|
||||||
|
{
|
||||||
|
"k": "geometry",
|
||||||
|
"v": "~",
|
||||||
|
"klib": "geometry",
|
||||||
|
"vlib": "translateRight()"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"4022": {
|
||||||
|
"table": "OMDB_TRAFFICLIGHT",
|
||||||
|
"code": 4022,
|
||||||
|
"name": "交通灯",
|
||||||
|
"transformer": [
|
||||||
|
{
|
||||||
|
"k": "angle",
|
||||||
|
"v": "~",
|
||||||
|
"klib": "angle",
|
||||||
|
"vlib": "0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"5001":{
|
"5001":{
|
||||||
"table": "OMDB_LANE_LINK_LG",
|
"table": "OMDB_LANE_LINK_LG",
|
||||||
"code": 5001,
|
"code": 5001,
|
||||||
"name": "车道中心线"
|
"name": "车道中心线"
|
||||||
},
|
|
||||||
"2041":{
|
|
||||||
"table": "OMDB_LANE_NUM",
|
|
||||||
"code": 2041,
|
|
||||||
"name": "车道数",
|
|
||||||
"transformer": [
|
|
||||||
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -75,7 +75,7 @@ class Constant {
|
|||||||
const val SELECT_TAKEPHOTO_OR_RECORD = "select_takephoto_or_record"
|
const val SELECT_TAKEPHOTO_OR_RECORD = "select_takephoto_or_record"
|
||||||
|
|
||||||
const val OMDB_CONFIG = "omdb_config.json"
|
const val OMDB_CONFIG = "omdb_config.json"
|
||||||
const val OTHER_CONFIG = "other.config"
|
const val OTHER_CONFIG = "other_config.json"
|
||||||
|
|
||||||
val OMDB_LAYER_VISIBLE_LIST: MutableList<String> = mutableListOf() // 记录OMDB数据显示的图层名称列表
|
val OMDB_LAYER_VISIBLE_LIST: MutableList<String> = mutableListOf() // 记录OMDB数据显示的图层名称列表
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import kotlinx.parcelize.Parcelize
|
|||||||
@Parcelize
|
@Parcelize
|
||||||
data class SignBean(
|
data class SignBean(
|
||||||
//图标ID
|
//图标ID
|
||||||
val iconId: Int,
|
var iconId: Int = 0,
|
||||||
//定位点到目标距离
|
//定位点到目标距离
|
||||||
val distance: Int = 0,
|
val distance: Int = 0,
|
||||||
//图表中的问题
|
//图表中的问题
|
||||||
@ -17,8 +17,8 @@ data class SignBean(
|
|||||||
val linkId: String,
|
val linkId: String,
|
||||||
//坐标
|
//坐标
|
||||||
val geometry: String,
|
val geometry: String,
|
||||||
//底部文字
|
//名称
|
||||||
val bottomText: String,
|
val name: String,
|
||||||
//底部右侧文字
|
//底部右侧文字
|
||||||
val bottomRightText: String,
|
val bottomRightText: String,
|
||||||
//要素code类型
|
//要素code类型
|
||||||
|
@ -182,9 +182,9 @@ class LoginViewModel @Inject constructor(
|
|||||||
Realm.setDefaultConfiguration(config)
|
Realm.setDefaultConfiguration(config)
|
||||||
// 拷贝配置文件到用户目录下
|
// 拷贝配置文件到用户目录下
|
||||||
val omdbConfigFile = File(userFolder.absolutePath, Constant.OMDB_CONFIG);
|
val omdbConfigFile = File(userFolder.absolutePath, Constant.OMDB_CONFIG);
|
||||||
if (!omdbConfigFile.exists()) {
|
// if (!omdbConfigFile.exists()) {
|
||||||
ResourceUtils.copyFileFromAssets(Constant.OMDB_CONFIG, omdbConfigFile.absolutePath)
|
ResourceUtils.copyFileFromAssets(Constant.OMDB_CONFIG, omdbConfigFile.absolutePath)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,6 +12,7 @@ import androidx.databinding.DataBindingUtil
|
|||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.navigation.findNavController
|
import androidx.navigation.findNavController
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.blankj.utilcode.util.SPStaticUtils
|
import com.blankj.utilcode.util.SPStaticUtils
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.google.gson.reflect.TypeToken
|
import com.google.gson.reflect.TypeToken
|
||||||
@ -23,6 +24,7 @@ import com.navinfo.omqs.databinding.ActivityMainBinding
|
|||||||
import com.navinfo.omqs.http.offlinemapdownload.OfflineMapDownloadManager
|
import com.navinfo.omqs.http.offlinemapdownload.OfflineMapDownloadManager
|
||||||
import com.navinfo.omqs.tools.LayerConfigUtils
|
import com.navinfo.omqs.tools.LayerConfigUtils
|
||||||
import com.navinfo.omqs.ui.activity.BaseActivity
|
import com.navinfo.omqs.ui.activity.BaseActivity
|
||||||
|
import com.navinfo.omqs.ui.widget.RecycleViewDivider
|
||||||
import com.navinfo.omqs.util.FlowEventBus
|
import com.navinfo.omqs.util.FlowEventBus
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@ -52,14 +54,13 @@ class MainActivity : BaseActivity() {
|
|||||||
findNavController(R.id.main_activity_right_fragment)
|
findNavController(R.id.main_activity_right_fragment)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提前显示要素看板
|
||||||
|
*/
|
||||||
private val signAdapter by lazy {
|
private val signAdapter by lazy {
|
||||||
SignAdapter { position, signBean ->
|
SignAdapter { position, signBean ->
|
||||||
// val directions =
|
|
||||||
// EmptyFragmentDirections.emptyFragmentToEvaluationResultFragment(
|
|
||||||
// )
|
|
||||||
// rightController.navigate(directions)
|
|
||||||
rightController.currentDestination?.let {
|
rightController.currentDestination?.let {
|
||||||
if (it.id == R.id.EmptyFragment) {
|
if (it.id == R.id.RightEmptyFragment) {
|
||||||
val bundle = Bundle()
|
val bundle = Bundle()
|
||||||
bundle.putParcelable("SignBean", signBean)
|
bundle.putParcelable("SignBean", signBean)
|
||||||
rightController.navigate(R.id.EvaluationResultFragment, bundle)
|
rightController.navigate(R.id.EvaluationResultFragment, bundle)
|
||||||
@ -68,6 +69,22 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 道路信息看板
|
||||||
|
*/
|
||||||
|
private val topSignAdapter by lazy {
|
||||||
|
TopSignAdapter { position, signBean ->
|
||||||
|
rightController.currentDestination?.let {
|
||||||
|
if (it.id == R.id.RightEmptyFragment) {
|
||||||
|
val bundle = Bundle()
|
||||||
|
bundle.putParcelable("SignBean", signBean)
|
||||||
|
rightController.navigate(R.id.EvaluationResultFragment, bundle)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
@ -125,6 +142,18 @@ class MainActivity : BaseActivity() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//道路属性面板
|
||||||
|
binding.mainActivityTopSignRecyclerview.layoutManager = LinearLayoutManager(
|
||||||
|
this,
|
||||||
|
RecyclerView.HORIZONTAL, false
|
||||||
|
)
|
||||||
|
// binding.mainActivityTopSignRecyclerview.addItemDecoration(
|
||||||
|
// RecycleViewDivider(this, LinearLayoutManager.HORIZONTAL)
|
||||||
|
// )
|
||||||
|
binding.mainActivityTopSignRecyclerview.adapter = topSignAdapter
|
||||||
|
|
||||||
|
|
||||||
|
//提前显示面板
|
||||||
binding.mainActivitySignRecyclerview.layoutManager = LinearLayoutManager(this)
|
binding.mainActivitySignRecyclerview.layoutManager = LinearLayoutManager(this)
|
||||||
binding.mainActivitySignRecyclerview.adapter = signAdapter
|
binding.mainActivitySignRecyclerview.adapter = signAdapter
|
||||||
//增加4dp的间隔
|
//增加4dp的间隔
|
||||||
@ -139,6 +168,10 @@ class MainActivity : BaseActivity() {
|
|||||||
signAdapter.refreshData(it)
|
signAdapter.refreshData(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel.liveDataTopSignList.observe(this) {
|
||||||
|
topSignAdapter.refreshData(it)
|
||||||
|
}
|
||||||
|
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
// 初始化地图图层控制接收器
|
// 初始化地图图层控制接收器
|
||||||
FlowEventBus.subscribe<List<ImportConfig>>(
|
FlowEventBus.subscribe<List<ImportConfig>>(
|
||||||
@ -243,7 +276,7 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*展开或收起右侧面板
|
||||||
*/
|
*/
|
||||||
fun onSwitchFragment() {
|
fun onSwitchFragment() {
|
||||||
switchFragment = !switchFragment
|
switchFragment = !switchFragment
|
||||||
@ -255,6 +288,13 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 隐藏或显示右侧展开按钮
|
||||||
|
*/
|
||||||
|
fun setRightSwitchButton(visibility: Int) {
|
||||||
|
binding.mainActivityFragmentSwitch.visibility = visibility
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 点击录音按钮
|
* 点击录音按钮
|
||||||
*/
|
*/
|
||||||
|
@ -67,9 +67,12 @@ class MainViewModel @Inject constructor(
|
|||||||
//地图点击捕捉到的质检数据ID列表
|
//地图点击捕捉到的质检数据ID列表
|
||||||
val liveDataQsRecordIdList = MutableLiveData<List<String>>()
|
val liveDataQsRecordIdList = MutableLiveData<List<String>>()
|
||||||
|
|
||||||
//看板数据
|
//左侧看板数据
|
||||||
val liveDataSignList = MutableLiveData<List<SignBean>>()
|
val liveDataSignList = MutableLiveData<List<SignBean>>()
|
||||||
|
|
||||||
|
//顶部看板数据
|
||||||
|
val liveDataTopSignList = MutableLiveData<List<SignBean>>()
|
||||||
|
|
||||||
// var testPoint = GeoPoint(0, 0)
|
// var testPoint = GeoPoint(0, 0)
|
||||||
|
|
||||||
//语音窗体
|
//语音窗体
|
||||||
@ -150,8 +153,7 @@ class MainViewModel @Inject constructor(
|
|||||||
// location.latitude = testPoint.latitude
|
// location.latitude = testPoint.latitude
|
||||||
val geometry = GeometryTools.createGeometry(
|
val geometry = GeometryTools.createGeometry(
|
||||||
GeoPoint(
|
GeoPoint(
|
||||||
location.latitude,
|
location.latitude, location.longitude
|
||||||
location.longitude
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
val tileX = RealmSet<Int>()
|
val tileX = RealmSet<Int>()
|
||||||
@ -176,8 +178,7 @@ class MainViewModel @Inject constructor(
|
|||||||
mapController.locationLayerHandler.niLocationFlow.collectLatest { location ->
|
mapController.locationLayerHandler.niLocationFlow.collectLatest { location ->
|
||||||
// location.longitude = testPoint.longitude
|
// location.longitude = testPoint.longitude
|
||||||
// location.latitude = testPoint.latitude
|
// location.latitude = testPoint.latitude
|
||||||
if (!isSelectRoad())
|
if (!isSelectRoad()) captureLink(GeoPoint(location.latitude, location.longitude))
|
||||||
captureLink(GeoPoint(location.latitude, location.longitude))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,6 +197,8 @@ class MainViewModel @Inject constructor(
|
|||||||
)
|
)
|
||||||
//看板数据
|
//看板数据
|
||||||
val signList = mutableListOf<SignBean>()
|
val signList = mutableListOf<SignBean>()
|
||||||
|
val topSignList = mutableListOf<SignBean>()
|
||||||
|
|
||||||
if (linkList.isNotEmpty()) {
|
if (linkList.isNotEmpty()) {
|
||||||
val link = linkList[0]
|
val link = linkList[0]
|
||||||
val linkId = link.properties[RenderEntity.Companion.LinkTable.linkPid]
|
val linkId = link.properties[RenderEntity.Companion.LinkTable.linkPid]
|
||||||
@ -204,27 +207,36 @@ class MainViewModel @Inject constructor(
|
|||||||
var elementList = realmOperateHelper.queryLinkByLinkPid(it)
|
var elementList = realmOperateHelper.queryLinkByLinkPid(it)
|
||||||
for (element in elementList) {
|
for (element in elementList) {
|
||||||
val distance = GeometryTools.distanceToDouble(
|
val distance = GeometryTools.distanceToDouble(
|
||||||
point,
|
point, GeometryTools.createGeoPoint(element.geometry)
|
||||||
GeometryTools.createGeoPoint(element.geometry)
|
|
||||||
)
|
)
|
||||||
signList.add(
|
|
||||||
SignBean(
|
val signBean = SignBean(
|
||||||
iconId = SignUtil.getSignIcon(element),
|
iconId = SignUtil.getSignIcon(element),
|
||||||
iconText = SignUtil.getSignIconText(element),
|
iconText = SignUtil.getSignIconText(element),
|
||||||
distance = distance.toInt(),
|
distance = distance.toInt(),
|
||||||
elementId = element.id,
|
elementId = element.id,
|
||||||
linkId = linkId,
|
linkId = linkId,
|
||||||
geometry = element.geometry,
|
geometry = element.geometry,
|
||||||
bottomText = SignUtil.getSignBottomText(element),
|
name = SignUtil.getSignNameText(element),
|
||||||
bottomRightText = SignUtil.getSignBottomRightText(element),
|
bottomRightText = SignUtil.getSignBottomRightText(element),
|
||||||
elementCode = element.code
|
elementCode = element.code
|
||||||
|
)
|
||||||
|
|
||||||
|
when (element.code) {
|
||||||
|
2041, 2008, 2010 -> topSignList.add(
|
||||||
|
signBean
|
||||||
)
|
)
|
||||||
)
|
else -> signList.add(
|
||||||
|
signBean
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
liveDataSignList.postValue(signList)
|
liveDataTopSignList.postValue(topSignList.distinctBy { it.elementCode })
|
||||||
|
liveDataSignList.postValue(signList.distinctBy { it.elementCode })
|
||||||
Log.e("jingo", "自动捕捉数据 共${signList.size}条")
|
Log.e("jingo", "自动捕捉数据 共${signList.size}条")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -374,8 +386,7 @@ class MainViewModel @Inject constructor(
|
|||||||
if (layerConfigList != null && !layerConfigList.isEmpty()) {
|
if (layerConfigList != null && !layerConfigList.isEmpty()) {
|
||||||
val omdbVisibleList = layerConfigList.filter { importConfig ->
|
val omdbVisibleList = layerConfigList.filter { importConfig ->
|
||||||
importConfig.tableGroupName == "OMDB数据"
|
importConfig.tableGroupName == "OMDB数据"
|
||||||
}.first().tableMap.filter {
|
}.first().tableMap.filter { entry ->
|
||||||
entry ->
|
|
||||||
val tableInfo = entry.value
|
val tableInfo = entry.value
|
||||||
!tableInfo.checked
|
!tableInfo.checked
|
||||||
}.map { entry ->
|
}.map { entry ->
|
||||||
@ -414,7 +425,7 @@ class MainViewModel @Inject constructor(
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
when (navDestination.id) {
|
when (navDestination.id) {
|
||||||
R.id.EmptyFragment -> {
|
R.id.RightEmptyFragment -> {
|
||||||
if (list.size == 1) {
|
if (list.size == 1) {
|
||||||
val bundle = Bundle()
|
val bundle = Bundle()
|
||||||
bundle.putString("QsId", list[0])
|
bundle.putString("QsId", list[0])
|
||||||
|
@ -23,9 +23,10 @@ class SignAdapter(private var itemListener: ((Int, SignBean) -> Unit?)? = null)
|
|||||||
override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
|
||||||
val bd = holder.viewBinding as AdapterSignBinding
|
val bd = holder.viewBinding as AdapterSignBinding
|
||||||
val item = data[position]
|
val item = data[position]
|
||||||
bd.signMainIcon.background = holder.viewBinding.root.context.getDrawable(item.iconId)
|
if (item.iconId != 0)
|
||||||
|
bd.signMainIcon.background = holder.viewBinding.root.context.getDrawable(item.iconId)
|
||||||
bd.signMainIcon.text = item.iconText
|
bd.signMainIcon.text = item.iconText
|
||||||
bd.signBottomText.text = item.bottomText
|
bd.signBottomText.text = item.name
|
||||||
bd.signBottomRightText.text = item.bottomRightText
|
bd.signBottomRightText.text = item.bottomRightText
|
||||||
bd.root.setOnClickListener {
|
bd.root.setOnClickListener {
|
||||||
itemListener?.invoke(position, item)
|
itemListener?.invoke(position, item)
|
||||||
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.navinfo.omqs.ui.activity.map
|
||||||
|
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import com.navinfo.omqs.R
|
||||||
|
import com.navinfo.omqs.bean.SignBean
|
||||||
|
import com.navinfo.omqs.databinding.AdapterTopSignBinding
|
||||||
|
import com.navinfo.omqs.ui.other.BaseRecyclerViewAdapter
|
||||||
|
import com.navinfo.omqs.ui.other.BaseViewHolder
|
||||||
|
|
||||||
|
class TopSignAdapter(private var itemListener: ((Int, SignBean) -> Unit?)? = null) :
|
||||||
|
BaseRecyclerViewAdapter<SignBean>() {
|
||||||
|
override fun getItemViewRes(position: Int): Int {
|
||||||
|
return R.layout.adapter_top_sign
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
|
||||||
|
val viewBinding =
|
||||||
|
AdapterTopSignBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||||
|
return BaseViewHolder(viewBinding)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
|
||||||
|
val bd = holder.viewBinding as AdapterTopSignBinding
|
||||||
|
val item = data[position]
|
||||||
|
if (item.iconId != 0)
|
||||||
|
bd.topSignText.background = holder.viewBinding.root.context.getDrawable(item.iconId)
|
||||||
|
bd.topSignName.text = item.name
|
||||||
|
bd.topSignText.text = item.iconText
|
||||||
|
if (data.size == 1) {
|
||||||
|
bd.topSignLeftLine.visibility = View.GONE
|
||||||
|
bd.topSignRightLine.visibility = View.GONE
|
||||||
|
bd.topSignName.background =
|
||||||
|
holder.viewBinding.root.context.getDrawable(R.drawable.shape_road_info_top_bg)
|
||||||
|
bd.topSignText.background =
|
||||||
|
holder.viewBinding.root.context.getDrawable(R.drawable.shape_road_info_bottom_bg)
|
||||||
|
} else if (position == 0) {
|
||||||
|
bd.topSignLeftLine.visibility = View.GONE
|
||||||
|
bd.topSignRightLine.visibility = View.VISIBLE
|
||||||
|
bd.topSignName.background =
|
||||||
|
holder.viewBinding.root.context.getDrawable(R.drawable.shape_road_info_left_top_bg)
|
||||||
|
bd.topSignText.background =
|
||||||
|
holder.viewBinding.root.context.getDrawable(R.drawable.shape_road_info_left_bottom_bg)
|
||||||
|
} else if (position == data.size - 1) {
|
||||||
|
bd.topSignLeftLine.visibility = View.VISIBLE
|
||||||
|
bd.topSignRightLine.visibility = View.GONE
|
||||||
|
bd.topSignName.background =
|
||||||
|
holder.viewBinding.root.context.getDrawable(R.drawable.shape_road_info_right_top_bg)
|
||||||
|
bd.topSignText.background =
|
||||||
|
holder.viewBinding.root.context.getDrawable(R.drawable.shape_road_info_right_bottom_bg)
|
||||||
|
} else {
|
||||||
|
bd.topSignLeftLine.visibility = View.VISIBLE
|
||||||
|
bd.topSignRightLine.visibility = View.VISIBLE
|
||||||
|
bd.topSignName.background =
|
||||||
|
holder.viewBinding.root.context.getDrawable(R.drawable.shape_road_info_middle_top_bg)
|
||||||
|
bd.topSignText.background =
|
||||||
|
holder.viewBinding.root.context.getDrawable(R.drawable.shape_road_info_middle_bottom_bg)
|
||||||
|
}
|
||||||
|
|
||||||
|
bd.root.setOnClickListener {
|
||||||
|
itemListener?.invoke(position, item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -5,13 +5,17 @@ import android.view.LayoutInflater
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
|
import androidx.navigation.fragment.findNavController
|
||||||
|
import com.navinfo.omqs.R
|
||||||
import com.navinfo.omqs.databinding.FragmentEmptyBinding
|
import com.navinfo.omqs.databinding.FragmentEmptyBinding
|
||||||
|
import com.navinfo.omqs.ui.activity.map.MainActivity
|
||||||
|
|
||||||
class EmptyFragment :Fragment(){
|
class EmptyFragment : Fragment() {
|
||||||
private var _binding: FragmentEmptyBinding? = null
|
private var _binding: FragmentEmptyBinding? = null
|
||||||
|
private var currentDestinationLabel = ""
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
// private val viewModel by lazy { viewModels<EvaluationResultViewModel>().value}
|
|
||||||
|
// private val viewModel by lazy { viewModels<EvaluationResultViewModel>().value}
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
inflater: LayoutInflater, container: ViewGroup?,
|
inflater: LayoutInflater, container: ViewGroup?,
|
||||||
savedInstanceState: Bundle?
|
savedInstanceState: Bundle?
|
||||||
@ -25,6 +29,22 @@ class EmptyFragment :Fragment(){
|
|||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onStart() {
|
||||||
|
super.onStart()
|
||||||
|
val currentDestination = findNavController().currentDestination
|
||||||
|
if (currentDestination?.label == "右侧空页面") {
|
||||||
|
currentDestinationLabel = "右侧空页面"
|
||||||
|
(activity as MainActivity).setRightSwitchButton(View.GONE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStop() {
|
||||||
|
super.onStop()
|
||||||
|
if (currentDestinationLabel == "右侧空页面") {
|
||||||
|
(activity as MainActivity).setRightSwitchButton(View.VISIBLE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
_binding = null
|
_binding = null
|
||||||
|
@ -103,7 +103,7 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
|||||||
* 读取元数据
|
* 读取元数据
|
||||||
*/
|
*/
|
||||||
// val id = args.qsId
|
// val id = args.qsId
|
||||||
var id: String = ""
|
var id = ""
|
||||||
var signBean: SignBean? = null
|
var signBean: SignBean? = null
|
||||||
var filePath: String = ""
|
var filePath: String = ""
|
||||||
arguments?.let {
|
arguments?.let {
|
||||||
@ -235,7 +235,7 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
|||||||
val controller = findNavController(R.id.main_activity_middle_fragment)
|
val controller = findNavController(R.id.main_activity_middle_fragment)
|
||||||
controller.currentDestination?.let {
|
controller.currentDestination?.let {
|
||||||
//如果之前页面是空fragment,直接打开面板
|
//如果之前页面是空fragment,直接打开面板
|
||||||
if (it.id == R.id.EmptyFragment) {
|
if (it.id == R.id.MiddleEmptyFragment) {
|
||||||
findNavController(
|
findNavController(
|
||||||
R.id.main_activity_middle_fragment
|
R.id.main_activity_middle_fragment
|
||||||
).navigate(R.id.PhenomenonFragment)
|
).navigate(R.id.PhenomenonFragment)
|
||||||
@ -258,7 +258,7 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
|||||||
val controller = findNavController(R.id.main_activity_middle_fragment)
|
val controller = findNavController(R.id.main_activity_middle_fragment)
|
||||||
controller.currentDestination?.let {
|
controller.currentDestination?.let {
|
||||||
//如果之前页面是空fragment,直接打开面板
|
//如果之前页面是空fragment,直接打开面板
|
||||||
if (it.id == R.id.EmptyFragment) {
|
if (it.id == R.id.MiddleEmptyFragment) {
|
||||||
findNavController(
|
findNavController(
|
||||||
R.id.main_activity_middle_fragment
|
R.id.main_activity_middle_fragment
|
||||||
).navigate(R.id.ProblemLinkFragment)
|
).navigate(R.id.ProblemLinkFragment)
|
||||||
@ -282,13 +282,13 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun voiceOnTouchStart() {
|
fun voiceOnTouchStart() {
|
||||||
viewModel!!.startSoundMetter(requireActivity(), binding.evaluationVoice)
|
viewModel.startSoundMetter(requireActivity(), binding.evaluationVoice)
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.Q)
|
@RequiresApi(Build.VERSION_CODES.Q)
|
||||||
fun voiceOnTouchStop() {
|
fun voiceOnTouchStop() {
|
||||||
if (Constant.IS_VIDEO_SPEED) {
|
if (Constant.IS_VIDEO_SPEED) {
|
||||||
viewModel!!.stopSoundMeter()
|
viewModel.stopSoundMeter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ class EvaluationResultViewModel @Inject constructor(
|
|||||||
/**
|
/**
|
||||||
* 问题类型 liveData 给[MiddleAdapter]展示的数据
|
* 问题类型 liveData 给[MiddleAdapter]展示的数据
|
||||||
*/
|
*/
|
||||||
val liveDataMiddleTypeList = MutableLiveData<List<String>>()
|
// val liveDataMiddleTypeList = MutableLiveData<List<String>>()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 问题现象 liveData 给[RightGroupHeaderAdapter]展示的数据
|
* 问题现象 liveData 给[RightGroupHeaderAdapter]展示的数据
|
||||||
@ -190,19 +190,22 @@ class EvaluationResultViewModel @Inject constructor(
|
|||||||
list?.let {
|
list?.let {
|
||||||
if (list.isNotEmpty()) {
|
if (list.isNotEmpty()) {
|
||||||
//通知页面更新
|
//通知页面更新
|
||||||
|
var classType = list[0]
|
||||||
liveDataLeftTypeList.postValue(it)
|
liveDataLeftTypeList.postValue(it)
|
||||||
var classType = it[0]
|
|
||||||
if (bean != null) {
|
if (bean != null) {
|
||||||
val classType2 = roomAppDatabase.getScProblemTypeDao()
|
val classType2 = roomAppDatabase.getScProblemTypeDao()
|
||||||
.findClassTypeByCode(bean.elementCode)
|
.findClassTypeByCode(bean.elementCode)
|
||||||
if (classType2 != null)
|
if (classType2 != null) {
|
||||||
classType = classType2
|
classType = classType2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//如果右侧栏没数据,给个默认值
|
//如果右侧栏没数据,给个默认值
|
||||||
if (liveDataQsRecordBean.value!!.classType.isEmpty()) {
|
if (liveDataQsRecordBean.value!!.classType.isEmpty()) {
|
||||||
|
|
||||||
liveDataQsRecordBean.value!!.classType = classType
|
liveDataQsRecordBean.value!!.classType = classType
|
||||||
classTypeTemp = classType
|
classTypeTemp = classType
|
||||||
|
} else {
|
||||||
|
classType = liveDataQsRecordBean.value!!.classType
|
||||||
}
|
}
|
||||||
getProblemList(classType)
|
getProblemList(classType)
|
||||||
}
|
}
|
||||||
@ -240,7 +243,7 @@ class EvaluationResultViewModel @Inject constructor(
|
|||||||
Log.e("jingo", "getProblemLinkList ${rightList[0].text}")
|
Log.e("jingo", "getProblemLinkList ${rightList[0].text}")
|
||||||
}
|
}
|
||||||
liveDataQsRecordBean.postValue(liveDataQsRecordBean.value)
|
liveDataQsRecordBean.postValue(liveDataQsRecordBean.value)
|
||||||
liveDataMiddleTypeList.postValue(middleList)
|
// liveDataMiddleTypeList.postValue(middleList)
|
||||||
liveDataRightTypeList.postValue(rightList)
|
liveDataRightTypeList.postValue(rightList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -272,7 +275,7 @@ class EvaluationResultViewModel @Inject constructor(
|
|||||||
liveDataQsRecordBean.value!!.problemType = typeTitleList[0]
|
liveDataQsRecordBean.value!!.problemType = typeTitleList[0]
|
||||||
Log.e("jingo", "getProblemList ${typeTitleList[0]}")
|
Log.e("jingo", "getProblemList ${typeTitleList[0]}")
|
||||||
}
|
}
|
||||||
liveDataMiddleTypeList.postValue(typeTitleList)
|
// liveDataMiddleTypeList.postValue(typeTitleList)
|
||||||
if (liveDataQsRecordBean.value!!.phenomenon.isEmpty()) {
|
if (liveDataQsRecordBean.value!!.phenomenon.isEmpty()) {
|
||||||
liveDataQsRecordBean.value!!.phenomenon = phenomenonRightList[0].text
|
liveDataQsRecordBean.value!!.phenomenon = phenomenonRightList[0].text
|
||||||
Log.e("jingo", "getProblemList ${phenomenonRightList[0].text}")
|
Log.e("jingo", "getProblemList ${phenomenonRightList[0].text}")
|
||||||
@ -313,7 +316,7 @@ class EvaluationResultViewModel @Inject constructor(
|
|||||||
fun saveData() {
|
fun saveData() {
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
val realm = Realm.getDefaultInstance()
|
val realm = Realm.getDefaultInstance()
|
||||||
liveDataQsRecordBean.value!!.checkTime = DateTimeUtil.getDataTime()
|
liveDataQsRecordBean.value!!.checkTime = DateTimeUtil.getDataTime()
|
||||||
realm.executeTransaction {
|
realm.executeTransaction {
|
||||||
it.copyToRealmOrUpdate(liveDataQsRecordBean.value)
|
it.copyToRealmOrUpdate(liveDataQsRecordBean.value)
|
||||||
}
|
}
|
||||||
@ -444,7 +447,6 @@ class EvaluationResultViewModel @Inject constructor(
|
|||||||
|
|
||||||
Constant.IS_VIDEO_SPEED = true
|
Constant.IS_VIDEO_SPEED = true
|
||||||
//录音动画
|
//录音动画
|
||||||
//录音动画
|
|
||||||
if (pop != null) {
|
if (pop != null) {
|
||||||
pop!!.showAtLocation(v, Gravity.CENTER, 0, 0)
|
pop!!.showAtLocation(v, Gravity.CENTER, 0, 0)
|
||||||
}
|
}
|
||||||
|
@ -28,13 +28,7 @@ class LeftAdapter(private var itemListener: ((Int, String) -> Unit?)? = null) :
|
|||||||
val bd = holder.viewBinding as TextItemSelectBinding
|
val bd = holder.viewBinding as TextItemSelectBinding
|
||||||
val title = data[position]
|
val title = data[position]
|
||||||
bd.itemId.text = title
|
bd.itemId.text = title
|
||||||
if (selectTitle == title) {
|
holder.viewBinding.root.isSelected = selectTitle == title
|
||||||
bd.itemId.setBackgroundResource(R.drawable.shape_rect_white_2dp_bg)
|
|
||||||
bd.itemId.setTextColor(holder.viewBinding.root.context.getColor(R.color.highFontColor))
|
|
||||||
} else {
|
|
||||||
bd.itemId.setBackgroundResource(R.drawable.shape_rect_white_2dp_bg)
|
|
||||||
bd.itemId.setTextColor(holder.viewBinding.root.context.getColor(R.color.black))
|
|
||||||
}
|
|
||||||
bd.root.setOnClickListener {
|
bd.root.setOnClickListener {
|
||||||
if (selectTitle != title) {
|
if (selectTitle != title) {
|
||||||
selectTitle = title
|
selectTitle = title
|
||||||
@ -50,10 +44,9 @@ class LeftAdapter(private var itemListener: ((Int, String) -> Unit?)? = null) :
|
|||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setRightTitle(title: String) {
|
fun setSelectTitle(title: String) {
|
||||||
if (title != selectTitle) {
|
if (title != selectTitle) {
|
||||||
selectTitle = title
|
selectTitle = title
|
||||||
notifyDataSetChanged()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,9 +6,12 @@ import android.util.Log
|
|||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import androidx.navigation.findNavController
|
||||||
|
import androidx.navigation.fragment.findNavController
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import androidx.recyclerview.widget.RecyclerView.OnScrollListener
|
import androidx.recyclerview.widget.RecyclerView.OnScrollListener
|
||||||
|
import com.navinfo.omqs.R
|
||||||
import com.navinfo.omqs.databinding.FragmentPhenomenonBinding
|
import com.navinfo.omqs.databinding.FragmentPhenomenonBinding
|
||||||
import com.navinfo.omqs.ui.fragment.BaseFragment
|
import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||||
import com.navinfo.omqs.ui.other.shareViewModels
|
import com.navinfo.omqs.ui.other.shareViewModels
|
||||||
@ -19,6 +22,7 @@ class PhenomenonFragment :
|
|||||||
BaseFragment() {
|
BaseFragment() {
|
||||||
private var _binding: FragmentPhenomenonBinding? = null
|
private var _binding: FragmentPhenomenonBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 和[PhenomenonFragment],[ProblemLinkFragment],[EvaluationResultFragment]共用同一个viewModel
|
* 和[PhenomenonFragment],[ProblemLinkFragment],[EvaluationResultFragment]共用同一个viewModel
|
||||||
*/
|
*/
|
||||||
@ -50,6 +54,7 @@ class PhenomenonFragment :
|
|||||||
binding.phenomenonLeftRecyclerview.adapter = leftAdapter
|
binding.phenomenonLeftRecyclerview.adapter = leftAdapter
|
||||||
//左侧菜单查询结果监听
|
//左侧菜单查询结果监听
|
||||||
viewModel.liveDataLeftTypeList.observe(viewLifecycleOwner) {
|
viewModel.liveDataLeftTypeList.observe(viewLifecycleOwner) {
|
||||||
|
leftAdapter.setSelectTitle(viewModel.liveDataQsRecordBean.value!!.classType)
|
||||||
leftAdapter.refreshData(it)
|
leftAdapter.refreshData(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,6 +68,9 @@ class PhenomenonFragment :
|
|||||||
*/
|
*/
|
||||||
val rightAdapter = RightGroupHeaderAdapter { _, bean ->
|
val rightAdapter = RightGroupHeaderAdapter { _, bean ->
|
||||||
viewModel.setPhenomenonMiddleBean(bean)
|
viewModel.setPhenomenonMiddleBean(bean)
|
||||||
|
if (activity != null) {
|
||||||
|
requireActivity().findNavController(R.id.main_activity_middle_fragment).navigateUp()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
binding.phenomenonRightRecyclerview.adapter = rightAdapter
|
binding.phenomenonRightRecyclerview.adapter = rightAdapter
|
||||||
//右侧菜单增加组标题
|
//右侧菜单增加组标题
|
||||||
@ -75,6 +83,7 @@ class PhenomenonFragment :
|
|||||||
}
|
}
|
||||||
//右侧菜单查询数据监听
|
//右侧菜单查询数据监听
|
||||||
viewModel.liveDataRightTypeList.observe(viewLifecycleOwner) {
|
viewModel.liveDataRightTypeList.observe(viewLifecycleOwner) {
|
||||||
|
rightAdapter.setSelectTitle(viewModel.liveDataQsRecordBean.value!!.classType)
|
||||||
rightAdapter.refreshData(it)
|
rightAdapter.refreshData(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,15 +115,15 @@ class PhenomenonFragment :
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
//中间菜单
|
// //中间菜单
|
||||||
binding.phenomenonMiddleRecyclerview.setHasFixedSize(true)
|
// binding.phenomenonMiddleRecyclerview.setHasFixedSize(true)
|
||||||
binding.phenomenonMiddleRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
// binding.phenomenonMiddleRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||||
|
//
|
||||||
binding.phenomenonMiddleRecyclerview.adapter = middleAdapter
|
// binding.phenomenonMiddleRecyclerview.adapter = middleAdapter
|
||||||
//中间侧菜单查询结果监听
|
//中间侧菜单查询结果监听
|
||||||
viewModel.liveDataMiddleTypeList.observe(viewLifecycleOwner) {
|
// viewModel.liveDataMiddleTypeList.observe(viewLifecycleOwner) {
|
||||||
middleAdapter.refreshData(it)
|
// middleAdapter.refreshData(it)
|
||||||
}
|
// }
|
||||||
// binding.phenomenonDrawer.setOnClickListener {
|
// binding.phenomenonDrawer.setOnClickListener {
|
||||||
// when (binding.group.visibility) {
|
// when (binding.group.visibility) {
|
||||||
// View.INVISIBLE, View.GONE ->
|
// View.INVISIBLE, View.GONE ->
|
||||||
|
@ -75,14 +75,14 @@ class ProblemLinkFragment : BaseFragment() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//中间菜单
|
// //中间菜单
|
||||||
binding.linkMiddleRecyclerview.setHasFixedSize(true)
|
// binding.linkMiddleRecyclerview.setHasFixedSize(true)
|
||||||
binding.linkMiddleRecyclerview.layoutManager = LinearLayoutManager(requireContext())
|
// binding.linkMiddleRecyclerview.layoutManager = LinearLayoutManager(requireContext())
|
||||||
binding.linkMiddleRecyclerview.adapter = middleAdapter
|
// binding.linkMiddleRecyclerview.adapter = middleAdapter
|
||||||
//中间侧菜单查询结果监听
|
//中间侧菜单查询结果监听
|
||||||
viewModel.liveDataMiddleTypeList.observe(viewLifecycleOwner) {
|
// viewModel.liveDataMiddleTypeList.observe(viewLifecycleOwner) {
|
||||||
middleAdapter.refreshData(it)
|
// middleAdapter.refreshData(it)
|
||||||
}
|
// }
|
||||||
binding.linkDrawer.setOnClickListener {
|
binding.linkDrawer.setOnClickListener {
|
||||||
when (binding.group.visibility) {
|
when (binding.group.visibility) {
|
||||||
View.INVISIBLE, View.GONE ->
|
View.INVISIBLE, View.GONE ->
|
||||||
|
@ -3,27 +3,35 @@ package com.navinfo.omqs.ui.fragment.evaluationresult
|
|||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import com.navinfo.omqs.R
|
import com.navinfo.omqs.R
|
||||||
import com.navinfo.omqs.databinding.TextItemSelectBinding
|
import com.navinfo.omqs.databinding.TextItemSelect2Binding
|
||||||
import com.navinfo.omqs.ui.other.BaseRecyclerViewAdapter
|
import com.navinfo.omqs.ui.other.BaseRecyclerViewAdapter
|
||||||
import com.navinfo.omqs.ui.other.BaseViewHolder
|
import com.navinfo.omqs.ui.other.BaseViewHolder
|
||||||
|
|
||||||
class RightGroupHeaderAdapter(private var itemListener: ((Int, RightBean) -> Unit?)? = null) :
|
class RightGroupHeaderAdapter(private var itemListener: ((Int, RightBean) -> Unit?)? = null) :
|
||||||
BaseRecyclerViewAdapter<RightBean>() {
|
BaseRecyclerViewAdapter<RightBean>() {
|
||||||
|
private var selectTitle = ""
|
||||||
private var groupTitleList = mutableListOf<String>()
|
private var groupTitleList = mutableListOf<String>()
|
||||||
override fun getItemViewRes(position: Int): Int {
|
override fun getItemViewRes(position: Int): Int {
|
||||||
return R.layout.text_item_select
|
return R.layout.text_item_select2
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
|
||||||
val viewBinding =
|
val viewBinding =
|
||||||
TextItemSelectBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
TextItemSelect2Binding.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||||
return BaseViewHolder(viewBinding)
|
return BaseViewHolder(viewBinding)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
|
||||||
val bd = holder.viewBinding as TextItemSelectBinding
|
val bd = holder.viewBinding as TextItemSelect2Binding
|
||||||
bd.itemId.text = data[position].text
|
val title = data[position].text
|
||||||
|
bd.itemId.text = title
|
||||||
|
|
||||||
|
holder.viewBinding.root.isSelected = selectTitle == title
|
||||||
bd.root.setOnClickListener {
|
bd.root.setOnClickListener {
|
||||||
|
if (selectTitle != title) {
|
||||||
|
selectTitle = title
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
itemListener?.invoke(position, data[position])
|
itemListener?.invoke(position, data[position])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -86,7 +94,6 @@ class RightGroupHeaderAdapter(private var itemListener: ((Int, RightBean) -> Uni
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun refreshData(newData: List<RightBean>) {
|
override fun refreshData(newData: List<RightBean>) {
|
||||||
super.refreshData(newData)
|
|
||||||
groupTitleList.clear()
|
groupTitleList.clear()
|
||||||
for (item in newData) {
|
for (item in newData) {
|
||||||
if (groupTitleList.size > 0) {
|
if (groupTitleList.size > 0) {
|
||||||
@ -97,7 +104,15 @@ class RightGroupHeaderAdapter(private var itemListener: ((Int, RightBean) -> Uni
|
|||||||
groupTitleList.add(item.title)
|
groupTitleList.add(item.title)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
super.refreshData(newData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置当前选中的哪条数据
|
||||||
|
*/
|
||||||
|
fun setSelectTitle(title: String) {
|
||||||
|
if (title != selectTitle) {
|
||||||
|
selectTitle = title
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -40,7 +40,7 @@ class RightGroupHeaderDecoration(context: Context) : ItemDecoration() {
|
|||||||
mTextPaint.textSize = 46f
|
mTextPaint.textSize = 46f
|
||||||
mTextPaint.color = Color.WHITE
|
mTextPaint.color = Color.WHITE
|
||||||
mLinePaint = Paint(Paint.ANTI_ALIAS_FLAG)
|
mLinePaint = Paint(Paint.ANTI_ALIAS_FLAG)
|
||||||
mLinePaint.color = Color.GRAY
|
mLinePaint.color = Color.WHITE
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -111,7 +111,7 @@ class PersonalCenterFragment : BaseFragment(), FSAFActivityCallbacks {
|
|||||||
viewModel.readRealmData()
|
viewModel.readRealmData()
|
||||||
// 定位到指定位置
|
// 定位到指定位置
|
||||||
niMapController.mMapView.vtmMap.animator()
|
niMapController.mMapView.vtmMap.animator()
|
||||||
.animateTo(GeoPoint(30.26491197757836, 113.8408333015833 ))
|
.animateTo(GeoPoint(28.724637921467508 ,115.83412668023867 ))
|
||||||
}
|
}
|
||||||
R.id.personal_center_menu_task_list -> {
|
R.id.personal_center_menu_task_list -> {
|
||||||
findNavController().navigate(R.id.TaskManagerFragment)
|
findNavController().navigate(R.id.TaskManagerFragment)
|
||||||
|
@ -12,32 +12,67 @@ class SignUtil {
|
|||||||
*/
|
*/
|
||||||
fun getSignIconText(data: RenderEntity): String {
|
fun getSignIconText(data: RenderEntity): String {
|
||||||
return when (data.code) {
|
return when (data.code) {
|
||||||
|
//道路功能等级
|
||||||
|
2002 -> getLinkFunctionClassText(data)
|
||||||
|
//道路种别
|
||||||
|
2008 -> getKindText(data)
|
||||||
|
//道路方向
|
||||||
|
2010 -> getRoadDirectionText(data)
|
||||||
|
//车道数
|
||||||
|
2041 -> getLaneNumText(data)
|
||||||
//常规点限速,条件点限速
|
//常规点限速,条件点限速
|
||||||
4002, 4003 -> getSpeedLimitText(data)
|
4002, 4003 -> getSpeedLimitText(data)
|
||||||
// //道路种别
|
|
||||||
// 2008 -> getKindCodeIcon(data)
|
|
||||||
// //道路方向
|
|
||||||
// 2010 -> getRoadDirection(data)
|
|
||||||
// //车道数
|
|
||||||
// 2041 -> getLaneNumIcon(data)
|
|
||||||
else -> ""
|
else -> ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getSignBottomText(data: RenderEntity): String {
|
/**
|
||||||
|
*获取道路功能等级文字
|
||||||
|
*/
|
||||||
|
private fun getLinkFunctionClassText(data: RenderEntity): String {
|
||||||
|
return "等级${data.properties["functionClass"]}"
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取道路方向文字
|
||||||
|
*/
|
||||||
|
private fun getRoadDirectionText(data: RenderEntity): String {
|
||||||
|
val direct = data.properties["direct"]
|
||||||
|
when (direct?.toInt()) {
|
||||||
|
0 -> return "不应用"
|
||||||
|
1 -> return "双方向"
|
||||||
|
2 -> return "顺方向"
|
||||||
|
3 -> return "逆方向"
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取车道数展示文字
|
||||||
|
*/
|
||||||
|
private fun getLaneNumText(data: RenderEntity): String {
|
||||||
|
return "${data.properties["laneNum"]}|${data.properties["laneS2e"]}|${data.properties["laneE2s"]}"
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取要素名称
|
||||||
|
*/
|
||||||
|
fun getSignNameText(data: RenderEntity): String {
|
||||||
return when (data.code) {
|
return when (data.code) {
|
||||||
//可变点限速
|
//道路功能等级
|
||||||
4004 -> "可变点限速"
|
2002 -> "功能等级"
|
||||||
|
//道路种别
|
||||||
|
2008 -> "种别"
|
||||||
|
//道路方向
|
||||||
|
2010 -> "方向"
|
||||||
|
//车道数
|
||||||
|
2041 -> "车道数"
|
||||||
//常规点限速
|
//常规点限速
|
||||||
4002 -> "常规点限速"
|
4002 -> "常规点限速"
|
||||||
//常点限速
|
//常点限速
|
||||||
4003 -> "条件点限速"
|
4003 -> "条件点限速"
|
||||||
//道路种别
|
//可变点限速
|
||||||
2008 -> "道路种别"
|
4004 -> "可变点限速"
|
||||||
//道路方向
|
|
||||||
2010 -> "道路方向"
|
|
||||||
//车道数
|
|
||||||
2041 -> "车道数"
|
|
||||||
else -> ""
|
else -> ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -56,8 +91,7 @@ class SignUtil {
|
|||||||
/**
|
/**
|
||||||
* 条件点限速文字
|
* 条件点限速文字
|
||||||
*/
|
*/
|
||||||
|
private fun getConditionLimitText(data: RenderEntity): String {
|
||||||
fun getConditionLimitText(data: RenderEntity): String {
|
|
||||||
var stringBuffer = StringBuffer()
|
var stringBuffer = StringBuffer()
|
||||||
try {
|
try {
|
||||||
val dependent = data.properties["speedDependent"]
|
val dependent = data.properties["speedDependent"]
|
||||||
@ -118,10 +152,17 @@ class SignUtil {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取种别名称
|
||||||
|
*/
|
||||||
|
private fun getKindText(data: RenderEntity): String {
|
||||||
|
return data.properties["kind"].toString()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 限速图标
|
* 限速图标
|
||||||
*/
|
*/
|
||||||
fun getSpeedLimitIcon(data: RenderEntity): Int {
|
private fun getSpeedLimitIcon(data: RenderEntity): Int {
|
||||||
try {
|
try {
|
||||||
//限速标志 0 限速开始 1 限速解除
|
//限速标志 0 限速开始 1 限速解除
|
||||||
return when (data.properties["speed_flag"]) {
|
return when (data.properties["speed_flag"]) {
|
||||||
@ -131,7 +172,23 @@ class SignUtil {
|
|||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e("jingo", "获取限速面板ICON出错2 $e")
|
Log.e("jingo", "获取限速面板ICON出错2 $e")
|
||||||
}
|
}
|
||||||
return R.drawable.icon_speed_limit
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条件限速图标
|
||||||
|
*/
|
||||||
|
private fun getConditionalSpeedLimitIcon(data: RenderEntity): Int {
|
||||||
|
try {
|
||||||
|
//限速标志 0 限速开始 1 限速解除
|
||||||
|
return when (data.properties["speed_flag"]) {
|
||||||
|
"1" -> return R.drawable.icon_conditional_speed_limit_off
|
||||||
|
else -> return R.drawable.icon_conditional_speed_limit
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("jingo", "获取限速面板ICON出错2 $e")
|
||||||
|
}
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -140,17 +197,19 @@ class SignUtil {
|
|||||||
|
|
||||||
fun getSignIcon(data: RenderEntity): Int {
|
fun getSignIcon(data: RenderEntity): Int {
|
||||||
return when (data.code) {
|
return when (data.code) {
|
||||||
//道路种别
|
// //道路种别
|
||||||
2008 -> getKindCodeIcon(data)
|
// 2008 -> getKindCodeIcon(data)
|
||||||
//道路方向
|
// //道路方向
|
||||||
2010 -> getRoadDirection(data)
|
// 2010 -> getRoadDirection(data)
|
||||||
//车道数
|
// //车道数
|
||||||
2041 -> getLaneNumIcon(data)
|
// 2041 -> getLaneNumIcon(data)
|
||||||
//限速
|
//普通点限速
|
||||||
4002, 4003 -> getSpeedLimitIcon(data)
|
4002 -> getSpeedLimitIcon(data)
|
||||||
|
//条件点限速
|
||||||
|
4003 -> getConditionalSpeedLimitIcon(data)
|
||||||
//可变点限速
|
//可变点限速
|
||||||
4004 -> R.drawable.icon_change_limit
|
4004 -> R.drawable.icon_change_limit
|
||||||
else -> R.drawable.icon_speed_limit
|
else -> 0
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -159,7 +218,7 @@ class SignUtil {
|
|||||||
/**
|
/**
|
||||||
* 获取种别图标
|
* 获取种别图标
|
||||||
*/
|
*/
|
||||||
fun getKindCodeIcon(data: RenderEntity): Int {
|
private fun getKindCodeIcon(data: RenderEntity): Int {
|
||||||
try {
|
try {
|
||||||
val kind = data.properties["kind"]
|
val kind = data.properties["kind"]
|
||||||
return when (kind!!.toInt()) {
|
return when (kind!!.toInt()) {
|
||||||
@ -186,7 +245,7 @@ class SignUtil {
|
|||||||
/**
|
/**
|
||||||
* 获取到路线
|
* 获取到路线
|
||||||
*/
|
*/
|
||||||
fun getLaneNumIcon(data: RenderEntity): Int {
|
private fun getLaneNumIcon(data: RenderEntity): Int {
|
||||||
try {
|
try {
|
||||||
val lineNum = data.properties["laneNum"]
|
val lineNum = data.properties["laneNum"]
|
||||||
return when (lineNum!!.toInt()) {
|
return when (lineNum!!.toInt()) {
|
||||||
@ -210,7 +269,7 @@ class SignUtil {
|
|||||||
return R.drawable.icon_road_direction
|
return R.drawable.icon_road_direction
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getRoadDirection(data: RenderEntity): Int {
|
private fun getRoadDirection(data: RenderEntity): Int {
|
||||||
try {
|
try {
|
||||||
val direct = data.properties["direct"]
|
val direct = data.properties["direct"]
|
||||||
return when (direct!!.toInt()) {
|
return when (direct!!.toInt()) {
|
||||||
|
5
app/src/main/res/color/selector_black_blue_color.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_selected="true" android:color="@color/default_blue_text_color" />
|
||||||
|
<item android:color="@color/black" />
|
||||||
|
</selector>
|
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_traffic_light.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@color/default_blue_text_color" android:state_selected="true"></item>
|
||||||
|
<item android:drawable="@color/black" />
|
||||||
|
</selector>
|
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_selected="true">
|
||||||
|
<shape android:shape="oval">
|
||||||
|
<size android:width="10dp" android:height="10dp" />
|
||||||
|
<solid android:color="@color/default_button_blue_color" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<shape android:shape="oval">
|
||||||
|
<size android:width="10dp" android:height="10dp" />
|
||||||
|
<solid android:color="@color/white" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
@ -1,19 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<!-- <padding-->
|
<padding
|
||||||
<!-- android:bottom="2dp"-->
|
android:bottom="2dp"
|
||||||
<!-- android:left="2dp"-->
|
android:left="2dp"
|
||||||
<!-- android:right="0dp"-->
|
android:right="2dp"
|
||||||
<!-- android:top="2dp" />-->
|
android:top="2dp" />
|
||||||
<solid android:color="#FFFFFF" />
|
<solid android:color="#FFFFFF" />
|
||||||
<stroke
|
<stroke
|
||||||
android:width="1dp"
|
android:width="1dp"
|
||||||
android:color="#3756DF" />
|
android:color="#3756DF" />
|
||||||
<corners
|
<corners
|
||||||
android:bottomLeftRadius="4dp"
|
android:bottomLeftRadius="5dp"
|
||||||
android:bottomRightRadius="0dp"
|
android:bottomRightRadius="0dp"
|
||||||
android:topLeftRadius="4dp"
|
android:topLeftRadius="5dp"
|
||||||
android:topRightRadius="0dp" />
|
android:topRightRadius="0dp" />
|
||||||
</shape>
|
</shape>
|
||||||
|
|
||||||
|
11
app/src/main/res/drawable/shape_road_info_bottom_bg.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="#BA0C122B" />
|
||||||
|
<corners
|
||||||
|
android:topLeftRadius="0dp"
|
||||||
|
android:topRightRadius="0dp"
|
||||||
|
android:bottomLeftRadius="6dp"
|
||||||
|
android:bottomRightRadius="6dp"/>
|
||||||
|
</shape>
|
10
app/src/main/res/drawable/shape_road_info_left_bottom_bg.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="#BA0C122B" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="6dp"
|
||||||
|
android:bottomRightRadius="0dp"
|
||||||
|
android:topLeftRadius="0dp"
|
||||||
|
android:topRightRadius="0dp" />
|
||||||
|
</shape>
|
10
app/src/main/res/drawable/shape_road_info_left_top_bg.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="#990C122B" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="0dp"
|
||||||
|
android:bottomRightRadius="0dp"
|
||||||
|
android:topLeftRadius="6dp"
|
||||||
|
android:topRightRadius="0dp" />
|
||||||
|
</shape>
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="#BA0C122B" />
|
||||||
|
</shape>
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="#990C122B" />
|
||||||
|
</shape>
|
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="#BA0C122B" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="0dp"
|
||||||
|
android:bottomRightRadius="6dp"
|
||||||
|
android:topLeftRadius="0dp"
|
||||||
|
android:topRightRadius="0dp" />
|
||||||
|
</shape>
|
11
app/src/main/res/drawable/shape_road_info_right_top_bg.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="#990C122B" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="0dp"
|
||||||
|
android:bottomRightRadius="0dp"
|
||||||
|
android:topLeftRadius="0dp"
|
||||||
|
android:topRightRadius="6dp" />
|
||||||
|
</shape>
|
11
app/src/main/res/drawable/shape_road_info_top_bg.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="#990C122B" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="0dp"
|
||||||
|
android:bottomRightRadius="0dp"
|
||||||
|
android:topLeftRadius="6dp"
|
||||||
|
android:topRightRadius="6dp" />
|
||||||
|
</shape>
|
@ -51,6 +51,14 @@
|
|||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/main_activity_top_sign_recyclerview"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/main_activity_person_center"
|
android:id="@+id/main_activity_person_center"
|
||||||
@ -136,9 +144,8 @@
|
|||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/main_activity_fragment_switch"
|
android:id="@+id/main_activity_fragment_switch"
|
||||||
android:layout_width="32dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="32dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="-10dp"
|
|
||||||
android:background="@drawable/selector_fragment_switch"
|
android:background="@drawable/selector_fragment_switch"
|
||||||
android:elevation="2dp"
|
android:elevation="2dp"
|
||||||
android:onClick="@{()->mainActivity.onSwitchFragment()}"
|
android:onClick="@{()->mainActivity.onSwitchFragment()}"
|
||||||
@ -259,8 +266,8 @@
|
|||||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||||
android:layout_width="323dp"
|
android:layout_width="323dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="30dp"
|
|
||||||
android:layout_gravity="left"
|
android:layout_gravity="left"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
app:navGraph="@navigation/left_drawer_nav_graph" />
|
app:navGraph="@navigation/left_drawer_nav_graph" />
|
||||||
|
|
||||||
</androidx.drawerlayout.widget.DrawerLayout>
|
</androidx.drawerlayout.widget.DrawerLayout>
|
||||||
|
54
app/src/main/res/layout/adapter_top_sign.xml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<RelativeLayout 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="70dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context="com.navinfo.omqs.ui.activity.map.TopSignAdapter">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/top_sign_name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginBottom="0.5dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:text="名称"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/top_sign_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/top_sign_name"
|
||||||
|
android:layout_alignLeft="@id/top_sign_name"
|
||||||
|
android:layout_alignRight="@id/top_sign_name"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:text="道路名"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/top_sign_left_line"
|
||||||
|
android:layout_width="0.5dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignTop="@id/top_sign_text"
|
||||||
|
android:layout_alignBottom="@id/top_sign_text"
|
||||||
|
android:background="#0C122B"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/top_sign_right_line"
|
||||||
|
android:layout_width="0.5dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignTop="@id/top_sign_text"
|
||||||
|
android:layout_alignBottom="@id/top_sign_text"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:background="#0C122B"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</RelativeLayout>
|
@ -18,31 +18,30 @@
|
|||||||
<!-- android:paddingBottom="30dp"-->
|
<!-- android:paddingBottom="30dp"-->
|
||||||
<!-- android:src="@drawable/btn_back_xml" />-->
|
<!-- android:src="@drawable/btn_back_xml" />-->
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<!-- <androidx.recyclerview.widget.RecyclerView-->
|
||||||
android:id="@+id/phenomenon_middle_recyclerview"
|
<!-- android:id="@+id/phenomenon_middle_recyclerview"-->
|
||||||
android:layout_width="0dp"
|
<!-- android:layout_width="0dp"-->
|
||||||
android:layout_height="35dp"
|
<!-- android:layout_height="35dp"-->
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
||||||
app:layout_constraintRight_toLeftOf="@id/phenomenon_right_recyclerview"
|
<!-- app:layout_constraintRight_toLeftOf="@id/phenomenon_right_recyclerview"-->
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/phenomenon_left_recyclerview"
|
android:id="@+id/phenomenon_left_recyclerview"
|
||||||
android:layout_width="0dp"
|
android:layout_width="148dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toLeftOf="@id/phenomenon_right_recyclerview"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
app:layout_constraintTop_toBottomOf="@id/phenomenon_middle_recyclerview" />
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/phenomenon_right_recyclerview"
|
android:id="@+id/phenomenon_right_recyclerview"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toRightOf="@id/phenomenon_left_recyclerview"
|
app:layout_constraintLeft_toRightOf="@id/phenomenon_left_recyclerview"
|
||||||
app:layout_constraintRight_toRightOf="parent" />
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<!-- <LinearLayout-->
|
<!-- <LinearLayout-->
|
||||||
<!-- android:id="@+id/group"-->
|
<!-- android:id="@+id/group"-->
|
||||||
|
@ -1,20 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/item_layout"
|
android:id="@+id/item_layout"
|
||||||
android:background="@color/white"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/selector_adapter_item_select_bg">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/item_id"
|
android:id="@+id/item_id"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="3dp"
|
android:layout_margin="4dp"
|
||||||
android:padding = "3dp"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="@color/black"
|
android:padding="4dp"
|
||||||
android:textSize="18sp">
|
android:drawablePadding="10dp"
|
||||||
|
android:drawableLeft="@drawable/selector_text_drawable_left_white_blue"
|
||||||
|
android:textColor="@color/selector_black_blue_color"
|
||||||
|
android:textSize="14sp"/>
|
||||||
|
|
||||||
</TextView>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
19
app/src/main/res/layout/text_item_select2.xml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/item_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/selector_adapter_item_select_bg">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_id"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:textColor="@color/selector_black_blue_color"
|
||||||
|
android:textSize="14sp"/>
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
@ -2,12 +2,12 @@
|
|||||||
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
app:startDestination="@id/EmptyFragment">
|
app:startDestination="@id/MiddleEmptyFragment">
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/EmptyFragment"
|
android:id="@+id/MiddleEmptyFragment"
|
||||||
android:name="com.navinfo.omqs.ui.fragment.empty.EmptyFragment"
|
android:name="com.navinfo.omqs.ui.fragment.empty.EmptyFragment"
|
||||||
android:label="空页面"
|
android:label="中间空页面"
|
||||||
tools:layout="@layout/fragment_empty"></fragment>
|
tools:layout="@layout/fragment_empty"></fragment>
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
|
@ -3,24 +3,24 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/right_fragment_nav_graph"
|
android:id="@+id/right_fragment_nav_graph"
|
||||||
app:startDestination="@id/EmptyFragment">
|
app:startDestination="@id/RightEmptyFragment">
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/EmptyFragment"
|
android:id="@+id/RightEmptyFragment"
|
||||||
android:name="com.navinfo.omqs.ui.fragment.empty.EmptyFragment"
|
android:name="com.navinfo.omqs.ui.fragment.empty.EmptyFragment"
|
||||||
android:label="空页面"
|
android:label="右侧空页面"
|
||||||
tools:layout="@layout/fragment_empty">
|
tools:layout="@layout/fragment_empty">
|
||||||
<!-- <action-->
|
<!-- <action-->
|
||||||
<!-- android:id="@+id/EmptyFragment_to_EvaluationResultFragment"-->
|
<!-- android:id="@+id/EmptyFragment_to_EvaluationResultFragment"-->
|
||||||
<!-- app:destination="@id/EvaluationResultFragment" />-->
|
<!-- app:destination="@id/EvaluationResultFragment" />-->
|
||||||
<!-- <argument-->
|
<!-- <argument-->
|
||||||
<!-- android:name="QsId"-->
|
<!-- android:name="QsId"-->
|
||||||
<!-- app:argType="string"-->
|
<!-- app:argType="string"-->
|
||||||
<!-- app:nullable="true" />-->
|
<!-- app:nullable="true" />-->
|
||||||
<!-- <argument-->
|
<!-- <argument-->
|
||||||
<!-- android:name="SignBean"-->
|
<!-- android:name="SignBean"-->
|
||||||
<!-- app:argType="com.navinfo.omqs.ui.activity.map.SignBean"-->
|
<!-- app:argType="com.navinfo.omqs.ui.activity.map.SignBean"-->
|
||||||
<!-- />-->
|
<!-- />-->
|
||||||
</fragment>
|
</fragment>
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
|
@ -8,5 +8,5 @@
|
|||||||
<dimen name="right_fragment_w" comment="右侧fragment宽度">256dp</dimen>
|
<dimen name="right_fragment_w" comment="右侧fragment宽度">256dp</dimen>
|
||||||
<dimen name="main_activity_geometry_w" comment="地图主页坐标框宽度">230dp</dimen>
|
<dimen name="main_activity_geometry_w" comment="地图主页坐标框宽度">230dp</dimen>
|
||||||
<dimen name="main_activity_geometry_h" comment="地图主页坐标框高度">28dp</dimen>
|
<dimen name="main_activity_geometry_h" comment="地图主页坐标框高度">28dp</dimen>
|
||||||
|
<dimen name="fragment_phenomenon_width" comment="问题现象面板宽度">360dp</dimen>
|
||||||
</resources>
|
</resources>
|
@ -1,4 +1,4 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<dimen name="fab_margin">48dp</dimen>
|
<dimen name="fab_margin">48dp</dimen>
|
||||||
<dimen name="fragment_phenomenon_width" comment="问题现象面板宽度">310dp</dimen>
|
<dimen name="fragment_phenomenon_width" comment="问题现象面板宽度">360dp</dimen>
|
||||||
</resources>
|
</resources>
|
@ -1860,7 +1860,7 @@
|
|||||||
<m k="direct">
|
<m k="direct">
|
||||||
<m v="2">
|
<m v="2">
|
||||||
<!-- <lineSymbol src="assets:omdb/oneway_right.svg"></lineSymbol>-->
|
<!-- <lineSymbol src="assets:omdb/oneway_right.svg"></lineSymbol>-->
|
||||||
<symbol src="assets:omdb/oneway_right.svg" repeat-start="99.9" repeat="false" ></symbol>
|
<symbol src="assets:omdb/oneway_right.svg" ></symbol>
|
||||||
</m>
|
</m>
|
||||||
<m v="3">
|
<m v="3">
|
||||||
<!-- <lineSymbol src="assets:omdb/oneway_left.svg"></lineSymbol>-->
|
<!-- <lineSymbol src="assets:omdb/oneway_left.svg"></lineSymbol>-->
|
||||||
@ -1868,5 +1868,13 @@
|
|||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
<!--交通灯-->
|
||||||
|
<m v="OMDB_TRAFFICLIGHT">
|
||||||
|
<symbol src="assets:omdb/icon_4022_0.png" repeat="false" symbol-width="14" symbol-height="40" rotate="false"></symbol>
|
||||||
|
</m>
|
||||||
|
<!--普通交限-->
|
||||||
|
<m v="OMDB_RESTRICTION">
|
||||||
|
<symbol src="assets:omdb/icon_4006_0.png" repeat="false" symbol-width="46" symbol-height="46" rotate="false"></symbol>
|
||||||
|
</m>
|
||||||
</m>
|
</m>
|
||||||
</rendertheme>
|
</rendertheme>
|
BIN
collect-library/src/main/assets/omdb/icon_4006_0.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
collect-library/src/main/assets/omdb/icon_4022_0.png
Normal file
After Width: | Height: | Size: 26 KiB |