调试通过获取设备信息实时更新二级页面重量,首页和二级页面列表页增加空数据展示
This commit is contained in:
@@ -2,6 +2,7 @@ package com.shuwei.intelligent.shelves
|
|||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.graphics.Color
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
@@ -12,6 +13,7 @@ import androidx.activity.viewModels
|
|||||||
import androidx.lifecycle.Lifecycle
|
import androidx.lifecycle.Lifecycle
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.lifecycle.repeatOnLifecycle
|
import androidx.lifecycle.repeatOnLifecycle
|
||||||
|
import androidx.recyclerview.widget.DefaultItemAnimator
|
||||||
import androidx.recyclerview.widget.GridLayoutManager
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
import com.chad.library.adapter4.util.setOnDebouncedItemClick
|
import com.chad.library.adapter4.util.setOnDebouncedItemClick
|
||||||
import com.shuwei.intelligent.shelves.adapter.ShelfAdapter
|
import com.shuwei.intelligent.shelves.adapter.ShelfAdapter
|
||||||
@@ -25,20 +27,26 @@ import com.shuwei.intelligent.shelves.net.RespData
|
|||||||
import com.shuwei.intelligent.shelves.net.UiState
|
import com.shuwei.intelligent.shelves.net.UiState
|
||||||
import com.shuwei.intelligent.shelves.serial.SerialPortManager
|
import com.shuwei.intelligent.shelves.serial.SerialPortManager
|
||||||
import com.shuwei.intelligent.shelves.task.TaskManager
|
import com.shuwei.intelligent.shelves.task.TaskManager
|
||||||
import com.shuwei.intelligent.shelves.utils.UIUtils
|
import com.shuwei.intelligent.shelves.utils.binaryToHex
|
||||||
|
import com.shuwei.intelligent.shelves.utils.ext.gone
|
||||||
|
import com.shuwei.intelligent.shelves.utils.ext.toast
|
||||||
|
import com.shuwei.intelligent.shelves.utils.ext.visible
|
||||||
import com.shuwei.intelligent.shelves.utils.f2C
|
import com.shuwei.intelligent.shelves.utils.f2C
|
||||||
|
import com.shuwei.intelligent.shelves.utils.hexToBinary
|
||||||
import com.shuwei.intelligent.shelves.utils.hexToDec
|
import com.shuwei.intelligent.shelves.utils.hexToDec
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import kotlin.getValue
|
|
||||||
|
|
||||||
class HomeActivity : BaseActivity() {
|
class HomeActivity : BaseActivity() {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val TAG = "HomeActivity"
|
private const val TAG = "HomeActivity"
|
||||||
|
|
||||||
|
private const val MM_DD_EEEE__HH_MM_SS = "MM月dd日 EEEE HH:mm:ss"
|
||||||
|
|
||||||
//协议头
|
//协议头
|
||||||
const val HEADER = "D6DADEDB"
|
const val HEADER = "D6DADEDB"
|
||||||
|
|
||||||
@@ -63,6 +71,8 @@ class HomeActivity : BaseActivity() {
|
|||||||
|
|
||||||
private val viewModel: NetViewModel by viewModels()
|
private val viewModel: NetViewModel by viewModels()
|
||||||
|
|
||||||
|
private val weightArray by lazy { SparseArray<Double?>() }
|
||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged", "HardwareIds")
|
@SuppressLint("NotifyDataSetChanged", "HardwareIds")
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
@@ -71,7 +81,6 @@ class HomeActivity : BaseActivity() {
|
|||||||
|
|
||||||
updateLeftStatus("1-1冷藏柜 -°C / -%")
|
updateLeftStatus("1-1冷藏柜 -°C / -%")
|
||||||
|
|
||||||
initList()
|
|
||||||
initRecyclerView()
|
initRecyclerView()
|
||||||
|
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
@@ -94,7 +103,7 @@ class HomeActivity : BaseActivity() {
|
|||||||
when (state) {
|
when (state) {
|
||||||
is UiState.Loading -> {}
|
is UiState.Loading -> {}
|
||||||
is UiState.Success<*> -> getTokenSuccess(state.data)
|
is UiState.Success<*> -> getTokenSuccess(state.data)
|
||||||
is UiState.Error -> UIUtils.toast(state.msg)
|
is UiState.Error -> toast(state.msg)
|
||||||
else -> {}
|
else -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -113,7 +122,8 @@ class HomeActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
TaskManager.startTask()
|
TaskManager.startTask()
|
||||||
|
|
||||||
val androidId = Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID)
|
var androidId = Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID)
|
||||||
|
// androidId = "d0e7a2d5f25c775c"
|
||||||
Log.d(TAG, "onCreate: androidId=${androidId}")
|
Log.d(TAG, "onCreate: androidId=${androidId}")
|
||||||
App.getInstance().deviceId = androidId
|
App.getInstance().deviceId = androidId
|
||||||
//"53babf69-0d2f-3875-a649-f2e12f80ad4c1"
|
//"53babf69-0d2f-3875-a649-f2e12f80ad4c1"
|
||||||
@@ -130,6 +140,29 @@ class HomeActivity : BaseActivity() {
|
|||||||
// receiveSerialPortData(data)
|
// receiveSerialPortData(data)
|
||||||
// delay(500)
|
// delay(500)
|
||||||
// }
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// lifecycleScope.launch {
|
||||||
|
// repeat(100) {
|
||||||
|
// val sb = StringBuilder().apply {
|
||||||
|
//// 610200000000000001000000050000800000000006000000050000000400008006000000010000001019008070180080
|
||||||
|
// repeat(12) {
|
||||||
|
// val num = (0..99).random()
|
||||||
|
// val num2 = (0..99).random()
|
||||||
|
// val num3 = (0..99).random()
|
||||||
|
// val num4 = (0..1).random()
|
||||||
|
// val numStr = if (num <= 9) "0${num}" else "" + num
|
||||||
|
// val numStr2 = if (num2 <= 9) "0${num2}" else "" + num2
|
||||||
|
// val numStr3 = if (num3 <= 9) "0${num3}" else "" + num3
|
||||||
|
// val numStr4 = if (num4 == 1) "80" else "00"
|
||||||
|
// append(numStr).append(numStr2).append(numStr3).append(numStr4)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// val data =
|
||||||
|
// "${HEADER}0302000000000C${sb}5037414645333633333334333731373056322E313069${FOOTER}"
|
||||||
|
// receiveSerialPortData(data)
|
||||||
|
// delay(500)
|
||||||
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,19 +181,20 @@ class HomeActivity : BaseActivity() {
|
|||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
private fun updateUI(data: RespData<*>) {
|
private fun updateUI(data: RespData<*>) {
|
||||||
|
binding.include?.root?.gone()
|
||||||
Loading.dismiss()
|
Loading.dismiss()
|
||||||
if (data.result !is ShelfResult) {
|
if (data.result !is ShelfResult) {
|
||||||
UIUtils.toast("数据错误")
|
loadEmptyView()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
App.getInstance().canteenId = data.result.canteenId
|
App.getInstance().canteenId = data.result.canteenId
|
||||||
val tempList = data.result.containerGoodsList
|
val tempList = data.result.containerGoodsList
|
||||||
if (tempList.isNullOrEmpty()) {
|
if (tempList.isNullOrEmpty()) {
|
||||||
UIUtils.toast("数据为空")
|
loadEmptyView()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (tempList.size < 10) {
|
if (tempList.size < 10) {
|
||||||
UIUtils.toast("数据错误")
|
toast("数据错误")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
list.clear()
|
list.clear()
|
||||||
@@ -175,7 +209,8 @@ class HomeActivity : BaseActivity() {
|
|||||||
|
|
||||||
private fun showError(message: String) {
|
private fun showError(message: String) {
|
||||||
Loading.dismiss()
|
Loading.dismiss()
|
||||||
UIUtils.toast(message)
|
toast(message)
|
||||||
|
loadEmptyView()
|
||||||
}
|
}
|
||||||
|
|
||||||
private val serialReader by lazy { StringBuilder() }
|
private val serialReader by lazy { StringBuilder() }
|
||||||
@@ -199,7 +234,7 @@ class HomeActivity : BaseActivity() {
|
|||||||
val endIndex = srcData.indexOf(FOOTER) + FOOTER.length
|
val endIndex = srcData.indexOf(FOOTER) + FOOTER.length
|
||||||
serialReader.append(srcData.substring(0, endIndex))
|
serialReader.append(srcData.substring(0, endIndex))
|
||||||
Log.d(TAG, "receiveSerialPortData:serialReader: $serialReader")
|
Log.d(TAG, "receiveSerialPortData:serialReader: $serialReader")
|
||||||
data = serialReader.toString().replace(",","")
|
data = serialReader.toString().replace(",", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
val cmd = data.substring(HEADER.length, HEADER.length + 4)
|
val cmd = data.substring(HEADER.length, HEADER.length + 4)
|
||||||
@@ -215,10 +250,10 @@ class HomeActivity : BaseActivity() {
|
|||||||
// heartBeat(data)
|
// heartBeat(data)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// "0302" -> {
|
"0302" -> {
|
||||||
// //获取设备状态
|
//获取设备状态
|
||||||
// getDeviceInfo(data)
|
getDeviceInfo(data)
|
||||||
// }
|
}
|
||||||
|
|
||||||
else -> {}
|
else -> {}
|
||||||
}
|
}
|
||||||
@@ -262,13 +297,16 @@ class HomeActivity : BaseActivity() {
|
|||||||
substring(6, 8) + substring(4, 6) + substring(2, 4) + substring(0, 2)
|
substring(6, 8) + substring(4, 6) + substring(2, 4) + substring(0, 2)
|
||||||
}
|
}
|
||||||
var realWeight = 0
|
var realWeight = 0
|
||||||
if (weightHex.first() in '8'..'F') {
|
var firstByteBinary = hexToBinary(weightHex.substring(0, 2))
|
||||||
//负数
|
if (firstByteBinary.startsWith("0")) {
|
||||||
val weightHex2 = "0${weightHex.substring(1)}"
|
//正数
|
||||||
realWeight = -1 * weightHex2.toInt()
|
|
||||||
} else {
|
|
||||||
//整数
|
|
||||||
realWeight = weightHex.toInt()
|
realWeight = weightHex.toInt()
|
||||||
|
} else {
|
||||||
|
//负数
|
||||||
|
firstByteBinary = "0${firstByteBinary.substring(1)}"
|
||||||
|
val firstByteHex = binaryToHex(firstByteBinary)
|
||||||
|
weightHex = firstByteHex + weightHex.substring(2)
|
||||||
|
realWeight = -1 * weightHex.toInt()
|
||||||
}
|
}
|
||||||
val realWeightDouble = realWeight / 1000.0
|
val realWeightDouble = realWeight / 1000.0
|
||||||
weightArray.put(index, realWeightDouble)
|
weightArray.put(index, realWeightDouble)
|
||||||
@@ -287,27 +325,33 @@ class HomeActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getDeviceInfo(data: String) {
|
private fun getDeviceInfo(data: String) {
|
||||||
// val weightStartIndex = HEADER.length + 4 + 10
|
Log.d(TAG, "getDeviceInfo: data=$data")
|
||||||
// val temperatureStartIndex = weightStartIndex + 12 * 8
|
val weightStartIndex = HEADER.length + 14
|
||||||
// val temperatureEndIndex = temperatureStartIndex + 2
|
val temperatureStartIndex = weightStartIndex + 12 * 8
|
||||||
// val temperatureHex = data.substring(temperatureStartIndex, temperatureEndIndex)
|
val temperatureEndIndex = temperatureStartIndex + 2
|
||||||
// val temperature = hexToDec(temperatureHex)
|
val temperatureHex = data.substring(temperatureStartIndex, temperatureEndIndex)
|
||||||
// updateLeftStatus("1-1冷藏柜 $temperature°C / 87%")
|
val temperature = hexToDec(temperatureHex)
|
||||||
//
|
val tempC = f2C(temperature.toDouble())
|
||||||
// getWeightInfo(
|
val showTemp = "%.1f".format(tempC)
|
||||||
// start = weightStartIndex,
|
|
||||||
// end = temperatureStartIndex,
|
val percent = 10 * list.count { it.goodsName.isNullOrBlank().not() }
|
||||||
// data = data
|
|
||||||
// )
|
updateLeftStatus("1-1冷藏柜 ${showTemp}°C / ${percent}%")
|
||||||
//
|
|
||||||
// val intent = Intent(ShelfActivity.RECEIVER_DEVICE_INFO)
|
getWeightInfo(
|
||||||
// intent.putExtra(ShelfActivity.SHELF_WEIGHT, weightArray[clickIndex])
|
start = weightStartIndex,
|
||||||
// intent.putExtra(ShelfActivity.RECEIVER_DEVICE_INFO, data)
|
end = temperatureStartIndex,
|
||||||
// sendBroadcast(intent)
|
data = data
|
||||||
|
)
|
||||||
|
|
||||||
|
if (list.isNotEmpty()) {
|
||||||
|
val intent = Intent(ShelfActivity.RECEIVER_DEVICE_INFO + list[shelfIndex].deviceNo)
|
||||||
|
intent.putExtra(ShelfActivity.SHELF_WEIGHT, weightArray[shelfIndex])
|
||||||
|
sendBroadcast(intent)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val weightArray by lazy { SparseArray<Double?>() }
|
private var shelfIndex = 0
|
||||||
private var clickIndex = 0
|
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
@@ -319,10 +363,9 @@ class HomeActivity : BaseActivity() {
|
|||||||
|
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
private val shelfAdapter by lazy {
|
private val shelfAdapter by lazy {
|
||||||
// val list = viewModel.getCurrentItems()
|
|
||||||
ShelfAdapter(list).apply {
|
ShelfAdapter(list).apply {
|
||||||
setOnDebouncedItemClick { adapter, view, position ->
|
setOnDebouncedItemClick { adapter, view, position ->
|
||||||
this@HomeActivity.clickIndex = position
|
this@HomeActivity.shelfIndex = position
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
val openCmd = if (list[position].deviceNo in 1..5)
|
val openCmd = if (list[position].deviceNo in 1..5)
|
||||||
LEFT_SHELF_OPEN_CMD
|
LEFT_SHELF_OPEN_CMD
|
||||||
@@ -330,7 +373,7 @@ class HomeActivity : BaseActivity() {
|
|||||||
RIGHT_SHELF_OPEN_CMD
|
RIGHT_SHELF_OPEN_CMD
|
||||||
val openState = SerialPortManager.send(openCmd)
|
val openState = SerialPortManager.send(openCmd)
|
||||||
if (openState.not()) {
|
if (openState.not()) {
|
||||||
UIUtils.toast("${list[position].goodsName}柜门开启失败")
|
toast("${list[position].goodsName}柜门开启失败")
|
||||||
return@launch
|
return@launch
|
||||||
}
|
}
|
||||||
launch(Intent(this@HomeActivity, ShelfActivity::class.java).also {
|
launch(Intent(this@HomeActivity, ShelfActivity::class.java).also {
|
||||||
@@ -358,26 +401,15 @@ class HomeActivity : BaseActivity() {
|
|||||||
layoutManager =
|
layoutManager =
|
||||||
GridLayoutManager(this@HomeActivity, 2, GridLayoutManager.VERTICAL, false)
|
GridLayoutManager(this@HomeActivity, 2, GridLayoutManager.VERTICAL, false)
|
||||||
adapter = shelfAdapter
|
adapter = shelfAdapter
|
||||||
|
|
||||||
|
itemAnimator.let {
|
||||||
|
if (it is DefaultItemAnimator) {
|
||||||
|
it.supportsChangeAnimations = false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initList() {
|
|
||||||
//// val list: MutableList<ShelfModel> = mutableListOf()
|
|
||||||
// list.add(ShelfModel(deviceNo = 1))
|
|
||||||
// list.add(ShelfModel(deviceNo = 6))
|
|
||||||
// list.add(ShelfModel(deviceNo = 2))
|
|
||||||
// list.add(ShelfModel(deviceNo = 7))
|
|
||||||
// list.add(ShelfModel(deviceNo = 3))
|
|
||||||
// list.add(ShelfModel(deviceNo = 8))
|
|
||||||
// list.add(ShelfModel(deviceNo = 4))
|
|
||||||
// list.add(ShelfModel(deviceNo = 9))
|
|
||||||
// list.add(ShelfModel(deviceNo = 5))
|
|
||||||
// list.add(ShelfModel(deviceNo = 10))
|
|
||||||
//// viewModel.updateItems(list)
|
|
||||||
}
|
|
||||||
|
|
||||||
private val MM_DD_EEEE__HH_MM_SS = "MM月dd日 EEEE HH:mm:ss"
|
|
||||||
|
|
||||||
private fun updateDateTime() {
|
private fun updateDateTime() {
|
||||||
val sdf = SimpleDateFormat(MM_DD_EEEE__HH_MM_SS, Locale.CHINA)
|
val sdf = SimpleDateFormat(MM_DD_EEEE__HH_MM_SS, Locale.CHINA)
|
||||||
val dateTime = sdf.format(Date())
|
val dateTime = sdf.format(Date())
|
||||||
@@ -402,4 +434,19 @@ class HomeActivity : BaseActivity() {
|
|||||||
super.onPause()
|
super.onPause()
|
||||||
handler.removeCallbacks(updateTask)
|
handler.removeCallbacks(updateTask)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
private fun loadEmptyView() {
|
||||||
|
list.clear()
|
||||||
|
shelfAdapter.notifyDataSetChanged()
|
||||||
|
|
||||||
|
binding.include?.let {
|
||||||
|
it.root.visible()
|
||||||
|
it.root.setOnClickListener {
|
||||||
|
viewModel.getAccessToken(App.getInstance().deviceId)
|
||||||
|
}
|
||||||
|
it.ivEmptyIcon.setImageResource(R.drawable.ic_empty_white)
|
||||||
|
it.tvEmptyContent.setTextColor(Color.WHITE)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,7 @@ import android.os.Handler
|
|||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
|
import androidx.core.widget.addTextChangedListener
|
||||||
import androidx.lifecycle.Lifecycle
|
import androidx.lifecycle.Lifecycle
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.lifecycle.repeatOnLifecycle
|
import androidx.lifecycle.repeatOnLifecycle
|
||||||
@@ -30,11 +31,12 @@ import com.shuwei.intelligent.shelves.net.UiState
|
|||||||
import com.shuwei.intelligent.shelves.serial.SerialPortManager
|
import com.shuwei.intelligent.shelves.serial.SerialPortManager
|
||||||
import com.shuwei.intelligent.shelves.utils.DateTimeUtil
|
import com.shuwei.intelligent.shelves.utils.DateTimeUtil
|
||||||
import com.shuwei.intelligent.shelves.utils.KeyboardUtil
|
import com.shuwei.intelligent.shelves.utils.KeyboardUtil
|
||||||
import com.shuwei.intelligent.shelves.utils.UIUtils
|
|
||||||
import com.shuwei.intelligent.shelves.utils.ext.addOnActionSearchListener
|
import com.shuwei.intelligent.shelves.utils.ext.addOnActionSearchListener
|
||||||
import com.shuwei.intelligent.shelves.utils.ext.clickWithDebounce
|
import com.shuwei.intelligent.shelves.utils.ext.clickWithDebounce
|
||||||
|
import com.shuwei.intelligent.shelves.utils.ext.gone
|
||||||
import com.shuwei.intelligent.shelves.utils.ext.toJsonString
|
import com.shuwei.intelligent.shelves.utils.ext.toJsonString
|
||||||
import com.shuwei.intelligent.shelves.utils.ext.toast
|
import com.shuwei.intelligent.shelves.utils.ext.toast
|
||||||
|
import com.shuwei.intelligent.shelves.utils.ext.visible
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
@@ -45,11 +47,14 @@ class ShelfActivity : BaseActivity() {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val TAG = "ShelfActivity"
|
private const val TAG = "ShelfActivity"
|
||||||
|
|
||||||
|
private const val YYYY_MM_DD__EEEE_HH_MM_SS = "yyyy年MM月dd日 EEEE***HH:mm:ss"
|
||||||
const val SHELF_MODEL = "shelfModel"
|
const val SHELF_MODEL = "shelfModel"
|
||||||
const val RECEIVER_DEVICE_INFO = "receiverDeviceInfo"
|
const val RECEIVER_DEVICE_INFO = "receiverDeviceInfo"
|
||||||
const val SHELF_WEIGHT = "shelfWeight"
|
const val SHELF_WEIGHT = "shelfWeight"
|
||||||
|
const val SHELF_INDEX = "shelfIndex"
|
||||||
|
|
||||||
const val PAGE_SIZE = 50
|
const val PAGE_SIZE = 100
|
||||||
}
|
}
|
||||||
|
|
||||||
private lateinit var binding: ActivityShelfBinding
|
private lateinit var binding: ActivityShelfBinding
|
||||||
@@ -60,6 +65,7 @@ class ShelfActivity : BaseActivity() {
|
|||||||
|
|
||||||
private var realWeight: Int = 0
|
private var realWeight: Int = 0
|
||||||
private var pageNo: Int = 1
|
private var pageNo: Int = 1
|
||||||
|
private var shelfIndex: Int = 0
|
||||||
|
|
||||||
private val viewModel: NetViewModel by viewModels()
|
private val viewModel: NetViewModel by viewModels()
|
||||||
|
|
||||||
@@ -81,19 +87,23 @@ class ShelfActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initRecyclerView()
|
initRecyclerView()
|
||||||
// initWeight()
|
|
||||||
binding.etInputFood.run {
|
binding.etInputFood.run {
|
||||||
addOnActionSearchListener {
|
addOnActionSearchListener {
|
||||||
if (text.isNullOrBlank()) {
|
if (text.isNullOrBlank()) {
|
||||||
toast(hint.toString())
|
toast(hint.toString())
|
||||||
return@addOnActionSearchListener
|
return@addOnActionSearchListener
|
||||||
}
|
}
|
||||||
// loadSearchData()
|
pageNo = 1
|
||||||
viewModel.getGoodsList(
|
getGoodsList()
|
||||||
canteenId = "1599670511042785282", goodsName = text.toString().trim()
|
|
||||||
)
|
|
||||||
KeyboardUtil.hideKeyboard(context, this)
|
KeyboardUtil.hideKeyboard(context, this)
|
||||||
}
|
}
|
||||||
|
addTextChangedListener(afterTextChanged = {editable ->
|
||||||
|
if (editable.isNullOrBlank()) {
|
||||||
|
pageNo = 1
|
||||||
|
getGoodsList()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.btnConfirm.clickWithDebounce {
|
binding.btnConfirm.clickWithDebounce {
|
||||||
@@ -103,7 +113,7 @@ class ShelfActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
val data = ShelfModel(
|
val data = ShelfModel(
|
||||||
shelfName = shelfModel?.shelfName,
|
shelfName = shelfModel?.shelfName,
|
||||||
goodsId = list[clickIndex].goodsId?:"",
|
goodsId = list[clickIndex].goodsId ?: "",
|
||||||
goodsName = list[clickIndex].goodsName,
|
goodsName = list[clickIndex].goodsName,
|
||||||
weight = realWeight / 1000.0,
|
weight = realWeight / 1000.0,
|
||||||
createTime = DateTimeUtil.formatDateTime(dateTime = Date())
|
createTime = DateTimeUtil.formatDateTime(dateTime = Date())
|
||||||
@@ -128,6 +138,8 @@ class ShelfActivity : BaseActivity() {
|
|||||||
//清零
|
//清零
|
||||||
realWeight = 0
|
realWeight = 0
|
||||||
binding.tvFoodWeight.text = "${realWeight}克"
|
binding.tvFoodWeight.text = "${realWeight}克"
|
||||||
|
|
||||||
|
SerialPortManager.send(DEVICE_INFO_CMD)
|
||||||
}
|
}
|
||||||
KeyboardUtil.hideKeyboard(v.context, v)
|
KeyboardUtil.hideKeyboard(v.context, v)
|
||||||
}
|
}
|
||||||
@@ -147,7 +159,7 @@ class ShelfActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
registerReceiver(receiver, IntentFilter(RECEIVER_DEVICE_INFO))
|
registerReceiver(receiver, IntentFilter(RECEIVER_DEVICE_INFO + shelfModel?.deviceNo))
|
||||||
|
|
||||||
binding.refreshLayout.let {
|
binding.refreshLayout.let {
|
||||||
it.setEnableRefresh(true)
|
it.setEnableRefresh(true)
|
||||||
@@ -176,7 +188,10 @@ class ShelfActivity : BaseActivity() {
|
|||||||
|
|
||||||
private fun getGoodsList() {
|
private fun getGoodsList() {
|
||||||
viewModel.getGoodsList(
|
viewModel.getGoodsList(
|
||||||
canteenId = App.getInstance().canteenId, pageNo = pageNo, pageSize = PAGE_SIZE
|
canteenId = App.getInstance().canteenId,
|
||||||
|
goodsName = binding.etInputFood.text.trim().toString(),
|
||||||
|
pageNo = pageNo,
|
||||||
|
pageSize = PAGE_SIZE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,15 +201,20 @@ class ShelfActivity : BaseActivity() {
|
|||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
private fun updateUI(data: RespData<*>) {
|
private fun updateUI(data: RespData<*>) {
|
||||||
|
binding.include?.root?.gone()
|
||||||
finishRefresh()
|
finishRefresh()
|
||||||
Loading.dismiss()
|
binding.root.postDelayed({ Loading.dismiss() }, 200)
|
||||||
Log.d(TAG, "updateUI: ${data.toJsonString()}")
|
Log.d(TAG, "updateUI: ${data.toJsonString()}")
|
||||||
if (data.result !is GoodsRecord) {
|
if (data.result !is GoodsRecord) {
|
||||||
UIUtils.toast("数据错误")
|
if (pageNo == 1) {
|
||||||
|
loadEmptyView()
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (data.result.records.isNullOrEmpty()) {
|
if (data.result.records.isNullOrEmpty()) {
|
||||||
UIUtils.toast("数据错误")
|
if (pageNo == 1) {
|
||||||
|
loadEmptyView()
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (pageNo == 1) {
|
if (pageNo == 1) {
|
||||||
@@ -213,15 +233,18 @@ class ShelfActivity : BaseActivity() {
|
|||||||
private fun showError(message: String) {
|
private fun showError(message: String) {
|
||||||
finishRefresh()
|
finishRefresh()
|
||||||
Loading.dismiss()
|
Loading.dismiss()
|
||||||
UIUtils.toast(message)
|
toast(message)
|
||||||
|
if (pageNo == 1) {
|
||||||
|
loadEmptyView()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val receiver = object : BroadcastReceiver() {
|
private val receiver = object : BroadcastReceiver() {
|
||||||
override fun onReceive(context: Context?, intent: Intent?) {
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
intent?.let {
|
intent?.let {
|
||||||
val data = it.getStringExtra(RECEIVER_DEVICE_INFO)
|
// val data = it.getStringExtra(RECEIVER_DEVICE_INFO)
|
||||||
Log.d(TAG, "onReceive: $data")
|
|
||||||
val weight = it.getDoubleExtra(SHELF_WEIGHT, 0.0)
|
val weight = it.getDoubleExtra(SHELF_WEIGHT, 0.0)
|
||||||
|
Log.d(TAG, "getDeviceInfo:onReceive: weight=$weight")
|
||||||
realWeight = (weight * 1000).toInt()
|
realWeight = (weight * 1000).toInt()
|
||||||
binding.tvFoodWeight.text = "${realWeight}克"
|
binding.tvFoodWeight.text = "${realWeight}克"
|
||||||
}
|
}
|
||||||
@@ -233,31 +256,6 @@ class ShelfActivity : BaseActivity() {
|
|||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
// private fun initWeight() {
|
|
||||||
// realWeight = Random.nextInt(1, 5001)
|
|
||||||
// }
|
|
||||||
|
|
||||||
// private fun loadSearchData() {
|
|
||||||
// list.add(SearchModel(foodId = 1000, foodName = "菲律宾乳猪五花肉"))
|
|
||||||
// list.add(SearchModel(foodId = 1001, foodName = "金针菇"))
|
|
||||||
// list.add(SearchModel(foodId = 1002, foodName = "大菠菜"))
|
|
||||||
// list.add(SearchModel(foodId = 1003, foodName = "清远麻鸡块"))
|
|
||||||
// list.add(SearchModel(foodId = 1004, foodName = "普罗旺斯番茄"))
|
|
||||||
// list.add(SearchModel(foodId = 1005, foodName = "长条茄子"))
|
|
||||||
// list.add(SearchModel(foodId = 1006, foodName = "得莫利鱼"))
|
|
||||||
// list.add(SearchModel(foodId = 1007, foodName = "土豆丝"))
|
|
||||||
// list.add(SearchModel(foodId = 1008, foodName = "辣椒炒肉"))
|
|
||||||
// list.add(SearchModel(foodId = 1009, foodName = "雪菜烧豆腐"))
|
|
||||||
// list.add(SearchModel(foodId = 1010, foodName = "冬虫夏草炝拌芥兰苗"))
|
|
||||||
// list.add(
|
|
||||||
// SearchModel(
|
|
||||||
// foodId = 1011,
|
|
||||||
// foodName = "蘑菇玉米山药莲藕胡萝卜红枣莲子枸杞清炖排骨汤"
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// searchAdapter.notifyDataSetChanged()
|
|
||||||
// }
|
|
||||||
|
|
||||||
private val list: MutableList<GoodsModel> = mutableListOf()
|
private val list: MutableList<GoodsModel> = mutableListOf()
|
||||||
private val searchAdapter by lazy {
|
private val searchAdapter by lazy {
|
||||||
SearchAdapter(list).apply {
|
SearchAdapter(list).apply {
|
||||||
@@ -279,8 +277,6 @@ class ShelfActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val YYYY_MM_DD__EEEE_HH_MM_SS = "yyyy年MM月dd日 EEEE***HH:mm:ss"
|
|
||||||
|
|
||||||
private fun updateDateTime() {
|
private fun updateDateTime() {
|
||||||
val sdf = SimpleDateFormat(YYYY_MM_DD__EEEE_HH_MM_SS, Locale.CHINA)
|
val sdf = SimpleDateFormat(YYYY_MM_DD__EEEE_HH_MM_SS, Locale.CHINA)
|
||||||
val dateTime = sdf.format(Date())
|
val dateTime = sdf.format(Date())
|
||||||
@@ -308,4 +304,22 @@ class ShelfActivity : BaseActivity() {
|
|||||||
handler.removeCallbacks(updateTask)
|
handler.removeCallbacks(updateTask)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
private fun loadEmptyView() {
|
||||||
|
list.clear()
|
||||||
|
searchAdapter.notifyDataSetChanged()
|
||||||
|
binding.include?.let {
|
||||||
|
it.root.visible()
|
||||||
|
it.root.setOnClickListener {
|
||||||
|
pageNo = 1
|
||||||
|
getGoodsList()
|
||||||
|
}
|
||||||
|
it.ivEmptyIcon.setImageResource(R.drawable.ic_empty_gray)
|
||||||
|
}
|
||||||
|
binding.refreshLayout.run {
|
||||||
|
setEnableRefresh(false)
|
||||||
|
setEnableLoadMore(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -45,3 +45,49 @@ fun byteArrayToHexString(bytes: ByteArray): String {
|
|||||||
fun String.hexToBytes(): ByteArray = hexStringToByteArray(this)
|
fun String.hexToBytes(): ByteArray = hexStringToByteArray(this)
|
||||||
fun ByteArray.toHexString2(): String = byteArrayToHexString(this)
|
fun ByteArray.toHexString2(): String = byteArrayToHexString(this)
|
||||||
|
|
||||||
|
fun hexToBinary(hex: String): String {
|
||||||
|
val hexToBinaryMap = mapOf(
|
||||||
|
'0' to "0000", '1' to "0001", '2' to "0010", '3' to "0011",
|
||||||
|
'4' to "0100", '5' to "0101", '6' to "0110", '7' to "0111",
|
||||||
|
'8' to "1000", '9' to "1001", 'A' to "1010", 'B' to "1011",
|
||||||
|
'C' to "1100", 'D' to "1101", 'E' to "1110", 'F' to "1111"
|
||||||
|
)
|
||||||
|
|
||||||
|
return hex.map { char ->
|
||||||
|
hexToBinaryMap[char] ?: throw IllegalArgumentException("非法十六进制字符: $char")
|
||||||
|
}.joinToString("")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun binaryToHex(binary: String): String {
|
||||||
|
// 补齐到4的倍数长度(方便分组)
|
||||||
|
val paddedBinary = binary.padStart(
|
||||||
|
length = ((binary.length + 3) / 4) * 4,
|
||||||
|
padChar = '0'
|
||||||
|
)
|
||||||
|
|
||||||
|
// 每4位二进制对应1位十六进制
|
||||||
|
return paddedBinary.chunked(4).joinToString("") { nibble ->
|
||||||
|
when (nibble) {
|
||||||
|
"0000" -> "0"
|
||||||
|
"0001" -> "1"
|
||||||
|
"0010" -> "2"
|
||||||
|
"0011" -> "3"
|
||||||
|
"0100" -> "4"
|
||||||
|
"0101" -> "5"
|
||||||
|
"0110" -> "6"
|
||||||
|
"0111" -> "7"
|
||||||
|
"1000" -> "8"
|
||||||
|
"1001" -> "9"
|
||||||
|
"1010" -> "A"
|
||||||
|
"1011" -> "B"
|
||||||
|
"1100" -> "C"
|
||||||
|
"1101" -> "D"
|
||||||
|
"1110" -> "E"
|
||||||
|
"1111" -> "F"
|
||||||
|
else -> throw IllegalArgumentException("无效的二进制段: $nibble")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.trimStart('0') // 去除前导零
|
||||||
|
.ifEmpty { "0" } // 处理全零情况
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
package com.shuwei.intelligent.shelves.utils
|
|
||||||
|
|
||||||
import android.widget.Toast
|
|
||||||
import com.shuwei.intelligent.shelves.App
|
|
||||||
//D6DADEDB0302000001000C06
|
|
||||||
object UIUtils {
|
|
||||||
fun toast(strRes: Int) {
|
|
||||||
Toast.makeText(App.getInstance(), strRes, Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun toast(str: String) {
|
|
||||||
Toast.makeText(App.getInstance(), str, Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
@@ -17,4 +17,12 @@
|
|||||||
android:layout_marginEnd="6dp"
|
android:layout_marginEnd="6dp"
|
||||||
tools:listitem="@layout/list_item_shelf"/>
|
tools:listitem="@layout/list_item_shelf"/>
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/include"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
layout="@layout/layout_empty_view"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
@@ -156,37 +156,50 @@
|
|||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
tools:ignore="Autofill,HardcodedText,TextFields" />
|
tools:ignore="Autofill,HardcodedText,TextFields" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
|
||||||
android:id="@+id/refreshLayout"
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
|
|
||||||
<com.scwang.smart.refresh.header.ClassicsHeader
|
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||||
|
android:id="@+id/refreshLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<com.scwang.smart.refresh.header.ClassicsHeader
|
||||||
android:id="@+id/rvSearch"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rvSearch"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:paddingBottom="4dp"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:paddingEnd="12dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
tools:listitem="@layout/list_item_search"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||||
|
app:spanCount="2"
|
||||||
|
tools:itemCount="10"/>
|
||||||
|
|
||||||
|
<com.scwang.smart.refresh.footer.ClassicsFooter
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/include"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:paddingStart="12dp"
|
layout="@layout/layout_empty_view"
|
||||||
android:paddingBottom="4dp"
|
android:visibility="gone"/>
|
||||||
android:layout_marginTop="8dp"
|
</FrameLayout>
|
||||||
android:paddingTop="4dp"
|
|
||||||
android:paddingEnd="12dp"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:overScrollMode="never"
|
|
||||||
tools:listitem="@layout/list_item_search"
|
|
||||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
|
||||||
app:spanCount="2"
|
|
||||||
tools:itemCount="10"/>
|
|
||||||
|
|
||||||
<com.scwang.smart.refresh.footer.ClassicsFooter
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
|
||||||
|
|
||||||
<!-- android:layout_marginTop="48dp"-->
|
<!-- android:layout_marginTop="48dp"-->
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:ignore="MissingDefaultResource,UseCompoundDrawables">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivEmptyIcon"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_empty_gray"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvEmptyContent"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/black999"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:text="暂无数据"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
</LinearLayout>
|
||||||
@@ -159,6 +159,7 @@
|
|||||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||||
android:id="@+id/refreshLayout"
|
android:id="@+id/refreshLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
|
|
||||||
@@ -172,7 +173,6 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:paddingStart="36dp"
|
android:paddingStart="36dp"
|
||||||
android:paddingBottom="12dp"
|
android:paddingBottom="12dp"
|
||||||
android:layout_marginTop="24dp"
|
|
||||||
android:paddingTop="12dp"
|
android:paddingTop="12dp"
|
||||||
android:paddingEnd="36dp"
|
android:paddingEnd="36dp"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:ignore="MissingDefaultResource,UseCompoundDrawables">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivEmptyIcon"
|
||||||
|
android:layout_width="270dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_empty_gray"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvEmptyContent"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/black999"
|
||||||
|
android:layout_marginTop="60dp"
|
||||||
|
android:textSize="60sp"
|
||||||
|
android:text="暂无数据"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
</LinearLayout>
|
||||||
Reference in New Issue
Block a user