增加初始化功能、采样菜品搜索功能优化、布局移动到layout目录
This commit is contained in:
@@ -35,6 +35,7 @@ import com.shuwei.dish.match.R
|
||||
import com.shuwei.dish.match.adapter.TextCellAdapter
|
||||
import com.shuwei.dish.match.databinding.ActivityDeviceConfigBinding
|
||||
import com.shuwei.dish.match.dialog.BottomDialog2
|
||||
import com.shuwei.dish.match.utils.SpTool
|
||||
import com.shuwei.dish.match.utils.ext.clickWithDebounce
|
||||
|
||||
class DeviceConfigActivity : BaseActivity() {
|
||||
@@ -112,6 +113,7 @@ class DeviceConfigActivity : BaseActivity() {
|
||||
}
|
||||
|
||||
binding.rbModeCook.setOnClickListener {
|
||||
SpTool.put(SpTool.LAUNCH_PAGE_TYPE, 0)
|
||||
binding.rbModeCook.isChecked = true
|
||||
binding.rbModeSampling.isChecked = false
|
||||
loadCookSpan(isClicked = true)
|
||||
@@ -120,6 +122,7 @@ class DeviceConfigActivity : BaseActivity() {
|
||||
finish()
|
||||
}
|
||||
binding.rbModeSampling.setOnClickListener {
|
||||
SpTool.put(SpTool.LAUNCH_PAGE_TYPE, 1)
|
||||
binding.rbModeCook.isChecked = false
|
||||
binding.rbModeSampling.isChecked = true
|
||||
loadCookSpan()
|
||||
|
||||
@@ -7,7 +7,6 @@ import android.util.Log
|
||||
import android.view.View
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.aithings.Weigher
|
||||
import com.shuwei.dish.match.R
|
||||
import com.shuwei.dish.match.adapter.DishPartAdapter
|
||||
import com.shuwei.dish.match.base.BaseActivity
|
||||
@@ -157,35 +156,35 @@ class DishSamplingActivity : BaseActivity() {
|
||||
LinearLayoutManager(this@DishSamplingActivity, LinearLayoutManager.VERTICAL, false)
|
||||
adapter = dishAdapter
|
||||
}
|
||||
binding.tvInputDishType.run {
|
||||
clickWithDebounce {
|
||||
BottomDialog(goodsType = 0).show(this@DishSamplingActivity) { item ->
|
||||
val filterResult = list.firstOrNull { it.goodsName == item.goodsName }
|
||||
if (filterResult != null) {
|
||||
toast("不允许重复添加同一食材")
|
||||
return@show
|
||||
}
|
||||
text = item.goodsName
|
||||
tempDishEntity = CookFoodGoodsEntity().apply {
|
||||
goodsId = item.goodsId
|
||||
goodsName = item.goodsName
|
||||
|
||||
relateionType = item.relateionType ?: 0
|
||||
goodsOrRelationCode = item.goodsOrRelationCode
|
||||
binding.ivDishTypeSearch.setOnClickListener {
|
||||
val inputText = binding.etInputDishType.text.toString().trim()
|
||||
BottomDialog(goodsType = 0, defGoodsName = inputText).show(this@DishSamplingActivity) { item ->
|
||||
val filterResult = list.firstOrNull { it.goodsName == item.goodsName }
|
||||
if (filterResult != null) {
|
||||
toast("不允许重复添加同一食材")
|
||||
return@show
|
||||
}
|
||||
binding.etInputDishType.setText(item.goodsName)
|
||||
tempDishEntity = CookFoodGoodsEntity().apply {
|
||||
goodsId = item.goodsId
|
||||
goodsName = item.goodsName
|
||||
|
||||
// TODO: 待定
|
||||
//allEdible = item.allEdible
|
||||
}
|
||||
relateionType = item.relateionType ?: 0
|
||||
goodsOrRelationCode = item.goodsOrRelationCode
|
||||
|
||||
// TODO: 待定
|
||||
//allEdible = item.allEdible
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
binding.ivWeightClear.setOnClickListener {
|
||||
Weigher.tareTwo(AddressUtil.ONE)
|
||||
WeightUtil.tareTwo(AddressUtil.ONE)
|
||||
}
|
||||
WeightUtil.addWeightListener(getWeight = { address, state, weight ->
|
||||
Log.d(TAG, "addViewClickListener: address=$address,state=$state,weight=$weight")
|
||||
if (address == 2) {
|
||||
if (address == AddressUtil.ONE) {
|
||||
tempDishEntity?.useWeight = weight.toDouble()
|
||||
binding.tvDishPartWeight.text = "${weight}"
|
||||
}
|
||||
@@ -200,10 +199,14 @@ class DishSamplingActivity : BaseActivity() {
|
||||
return@setOnClickListener
|
||||
}
|
||||
val realWeight = tempDishEntity!!.useWeight ?: 0.0
|
||||
if (realWeight < 0.toDouble()) {
|
||||
if (realWeight <= 0.toDouble()) {
|
||||
toast("食材用量需要大于0")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if (tempDishEntity?.goodsName != binding.etInputDishType.text.toString().trim()) {
|
||||
toast("所选择的食材名称与输入框内容不一致")
|
||||
return@setOnClickListener
|
||||
}
|
||||
tempDishEntity!!.apply {
|
||||
isSamplingPage = true
|
||||
materialType = dishMaterialType
|
||||
@@ -216,7 +219,7 @@ class DishSamplingActivity : BaseActivity() {
|
||||
list.add(tempDishEntity!!)
|
||||
dishAdapter.notifyDataSetChanged()
|
||||
tempDishEntity = null
|
||||
binding.tvInputDishType.text = ""
|
||||
binding.etInputDishType.setText("")
|
||||
binding.rgSampling.clearCheck()
|
||||
}
|
||||
binding.rgSampling.setOnCheckedChangeListener { group, checkedId ->
|
||||
@@ -236,7 +239,11 @@ class DishSamplingActivity : BaseActivity() {
|
||||
return@clickWithDebounce
|
||||
}
|
||||
val food = FoodRecord()
|
||||
food.foodId = foodId
|
||||
binding.etInputDish.let {
|
||||
if (it.tag!=null && it.tag.toString() == it.text.toString()) {
|
||||
food.foodId = foodId
|
||||
}
|
||||
}
|
||||
food.foodName = showFoodName
|
||||
food.cookMode = 1
|
||||
Log.d(TAG, "goToSubmit: goodsList:${list.toJsonString()}")
|
||||
@@ -262,6 +269,7 @@ class DishSamplingActivity : BaseActivity() {
|
||||
foodName = it.getStringExtra(FoodSearchActivity.FOOD_NAME)
|
||||
binding.etInputDish.run {
|
||||
setText(foodName)
|
||||
tag = foodName
|
||||
setSelection(text.length)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,8 @@ package com.shuwei.dish.match.ui
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.aithings.Weigher
|
||||
import com.shuwei.dish.match.R
|
||||
import com.shuwei.dish.match.adapter.HomeModeAdapter
|
||||
import com.shuwei.dish.match.base.BaseActivity
|
||||
@@ -15,9 +12,8 @@ import com.shuwei.dish.match.databinding.ActivityHomeBinding
|
||||
import com.shuwei.dish.match.db.AppRepository
|
||||
import com.shuwei.dish.match.entity.HomeModeBean
|
||||
import com.shuwei.dish.match.http.HttpUtil
|
||||
import com.shuwei.dish.match.http.UrlConfig
|
||||
import com.shuwei.dish.match.utils.SpTool
|
||||
import com.shuwei.dish.match.utils.WeightUtil
|
||||
import com.shuwei.dish.match.utils.ext.put
|
||||
import com.shuwei.dish.match.utils.ext.startActivity
|
||||
import com.shuwei.dish.match.utils.ext.toast
|
||||
import com.shuwei.dish.match.viewmodel.AppViewModel
|
||||
@@ -31,18 +27,18 @@ class HomeActivity : BaseActivity() {
|
||||
|
||||
private lateinit var binding: ActivityHomeBinding
|
||||
|
||||
private var connect: Boolean = false
|
||||
// private var connect: Boolean = false
|
||||
|
||||
@SuppressLint("HardwareIds")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
statusBarDarkFont(enable = true)
|
||||
initViewModel()
|
||||
// 获取 ANDROID_ID
|
||||
val deviceId =
|
||||
Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID)
|
||||
Log.d(TAG, "onCreate: deviceId=$deviceId")
|
||||
BaseApp.instance?.androidId = deviceId
|
||||
// // 获取 ANDROID_ID
|
||||
// val deviceId =
|
||||
// Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID)
|
||||
// Log.d(TAG, "onCreate: deviceId=$deviceId")
|
||||
// BaseApp.instance?.androidId = deviceId
|
||||
|
||||
binding = ActivityHomeBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
@@ -56,13 +52,13 @@ class HomeActivity : BaseActivity() {
|
||||
}
|
||||
binding.radioGroup?.check(R.id.radioZk)
|
||||
initRecyclerView()
|
||||
getAppToken()
|
||||
WeightUtil.connect { connect ->
|
||||
this.connect = connect
|
||||
}
|
||||
Weigher.init()
|
||||
Weigher.getWeight()
|
||||
Weigher.startContinuousRead()
|
||||
// HttpUtil.getAppToken()
|
||||
// WeightUtil.connect { connect ->
|
||||
// this.connect = connect
|
||||
// }
|
||||
// WeightUtil.init()
|
||||
// WeightUtil.getWeight()
|
||||
// WeightUtil.startContinuousRead()
|
||||
// binding.tvTopText.setOnClickListener {
|
||||
// startActivity<SamplingListActivity>()
|
||||
// }
|
||||
@@ -111,6 +107,7 @@ class HomeActivity : BaseActivity() {
|
||||
modeDesc = "菜品快速制作,记录熟重",
|
||||
modeIconId = R.drawable.ic_mode_cook,
|
||||
onClick = {
|
||||
SpTool.put(SpTool.LAUNCH_PAGE_TYPE, 0)
|
||||
startActivity<SelectDishActivity>()
|
||||
finish()
|
||||
})
|
||||
@@ -121,6 +118,7 @@ class HomeActivity : BaseActivity() {
|
||||
modeDesc = "菜品快速制作,记录熟重",
|
||||
modeIconId = R.drawable.ic_mode_sampling,
|
||||
onClick = {
|
||||
SpTool.put(SpTool.LAUNCH_PAGE_TYPE, 1)
|
||||
goSampling()
|
||||
})
|
||||
)
|
||||
@@ -158,15 +156,5 @@ class HomeActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun getAppToken() {
|
||||
val url = "${UrlConfig.GET_TOKEN}?qrcodeId=${BaseApp.instance?.androidId}"
|
||||
// Log.d(TAG, "getToken: url = $url")
|
||||
HttpUtil.get(url = url, doSuccess = {
|
||||
BaseApp.getSharedPref()?.put("token" to it)
|
||||
BaseApp.instance?.token = it.toString()
|
||||
}) { code, msg ->
|
||||
toast(msg)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
package com.shuwei.dish.match.ui
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.shuwei.dish.match.base.BaseActivity
|
||||
import com.shuwei.dish.match.base.BaseApp
|
||||
import com.shuwei.dish.match.databinding.ActivityInitBinding
|
||||
import com.shuwei.dish.match.db.AppRepository
|
||||
import com.shuwei.dish.match.http.HttpUtil
|
||||
import com.shuwei.dish.match.http.UrlConfig
|
||||
import com.shuwei.dish.match.utils.AppUtil
|
||||
import com.shuwei.dish.match.utils.QRCodeUtil
|
||||
import com.shuwei.dish.match.utils.SpTool
|
||||
import com.shuwei.dish.match.utils.WeightUtil
|
||||
import com.shuwei.dish.match.utils.ext.dp
|
||||
import com.shuwei.dish.match.utils.ext.invisible
|
||||
import com.shuwei.dish.match.utils.ext.startActivity
|
||||
import com.shuwei.dish.match.utils.ext.toJsonString
|
||||
import com.shuwei.dish.match.utils.ext.toObject
|
||||
import com.shuwei.dish.match.utils.ext.toast
|
||||
import com.shuwei.dish.match.utils.ext.visible
|
||||
import com.shuwei.dish.match.viewmodel.AppViewModel
|
||||
import com.shuwei.dish.match.viewmodel.factory.AppFactory
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.flow
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class InitActivity : BaseActivity() {
|
||||
companion object {
|
||||
const val TAG = "InitActivity"
|
||||
}
|
||||
|
||||
private lateinit var binding: ActivityInitBinding
|
||||
private lateinit var appViewModel: AppViewModel
|
||||
|
||||
@SuppressLint("HardwareIds")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
statusBarDarkFont(enable = true)
|
||||
binding = ActivityInitBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
setHeaderBackground(isHomePage = true)
|
||||
|
||||
// 获取 ANDROID_ID
|
||||
val androidId =
|
||||
Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID)
|
||||
BaseApp.deviceId = androidId
|
||||
SpTool.put(SpTool.DEVICE_ID, androidId)
|
||||
// TODO: 以上保存deviceId用于临时使用,后续改为下面注释方式
|
||||
// var deviceId = AppUtil.getUDID(this)
|
||||
// Log.d(TAG, "onCreate: deviceId=$deviceId")
|
||||
//// deviceId = "39a7abdd06b3c7ab"
|
||||
//// deviceId = "3ea47dc0-3cf0-3c2f-909c-265a9a65572e"
|
||||
//
|
||||
// BaseApp.deviceId = deviceId
|
||||
//
|
||||
// SpTool.put(SpTool.DEVICE_ID, deviceId)
|
||||
// val deviceConfigCache = SpTool.getString(SpTool.DEVICE_CONFIG_CACHE)
|
||||
// val checkResult = checkConfigData(deviceConfigCache)
|
||||
// if (checkResult.not()) {
|
||||
// binding.ivQrCode.visible()
|
||||
// binding.btnInit.visible()
|
||||
// //进行初始化操作
|
||||
// initConfig()
|
||||
// return
|
||||
// }
|
||||
binding.ivQrCode.invisible()
|
||||
binding.btnInit.invisible()
|
||||
|
||||
initViewModel()
|
||||
WeightUtil.init()
|
||||
WeightUtil.connect {}
|
||||
WeightUtil.getWeight()
|
||||
WeightUtil.startContinuousRead()
|
||||
HttpUtil.getAppToken()
|
||||
|
||||
countDown()
|
||||
}
|
||||
|
||||
private fun initViewModel() {
|
||||
val db = BaseApp.instance!!.database
|
||||
val factory = AppFactory(AppRepository(db.appDao()))
|
||||
appViewModel = ViewModelProvider(this, factory)[AppViewModel::class.java]
|
||||
}
|
||||
|
||||
private fun startNextPage() {
|
||||
val launchPageType = SpTool.getInt(SpTool.LAUNCH_PAGE_TYPE, -1)
|
||||
when (launchPageType) {
|
||||
0 -> {
|
||||
startActivity<SelectDishActivity>()
|
||||
}
|
||||
|
||||
1 -> {
|
||||
goSampling()
|
||||
}
|
||||
|
||||
else -> {
|
||||
startActivity<HomeActivity>()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun goSampling() {
|
||||
appViewModel.countCookFood(cookMode = 1) {
|
||||
if (it > 0) {
|
||||
startActivity<SamplingListActivity>()
|
||||
finish()
|
||||
return@countCookFood
|
||||
}
|
||||
startActivity<DishSamplingActivity> {
|
||||
putExtra(DishSamplingActivity.PAGE_FROM, DishSamplingActivity.HOME)
|
||||
}
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
private fun countDown() {
|
||||
lifecycleScope.launch {
|
||||
flow {
|
||||
(2 downTo 1).forEach {
|
||||
delay(1000)
|
||||
emit(it)
|
||||
}
|
||||
}.collect {
|
||||
// 倒计时结束执行跳转
|
||||
if (it == 1) {
|
||||
startNextPage()
|
||||
finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun initConfig() {
|
||||
binding.ivQrCode.setImageBitmap(
|
||||
QRCodeUtil.generateQRCode(
|
||||
content = BaseApp.deviceId?:"",
|
||||
size = 200.dp
|
||||
)
|
||||
)
|
||||
binding.btnInit.setOnClickListener {
|
||||
getDeviceConfig()
|
||||
}
|
||||
}
|
||||
|
||||
private fun getDeviceConfig() {
|
||||
val tokenUrl = "${UrlConfig.DEVICE_TOKEN}?qrcodeId=${BaseApp.deviceId}&appVersion=1"
|
||||
HttpUtil.get(url = tokenUrl, doSuccess = { token ->
|
||||
Log.d(TAG, "initConfig: $token")
|
||||
getConfig(token.toString())
|
||||
}, doFailure = { code, msg ->
|
||||
Log.d(TAG, "initConfig: $code,$msg")
|
||||
})
|
||||
}
|
||||
private fun getConfig(token: String) {
|
||||
val deviceConfigUrl = "${UrlConfig.DEVICE_CONFIG}?equipmentCode=${BaseApp.deviceId}&&appVersion=1"
|
||||
HttpUtil.get(url = deviceConfigUrl, header = mutableMapOf(
|
||||
"X-Access-Token" to token
|
||||
), doSuccess = {
|
||||
Log.d(TAG, "getDeviceConfig: $it")
|
||||
val data = it.toJsonString()
|
||||
val checkResult = checkConfigData(data)
|
||||
if (checkResult.not()) {
|
||||
toast("初始化设备失败,请稍后重试")
|
||||
return@get
|
||||
}
|
||||
SpTool.put(SpTool.DEVICE_CONFIG_CACHE, data)
|
||||
startActivity<HomeActivity>()
|
||||
finish()
|
||||
}, doFailure = { code, msg ->
|
||||
Log.d(TAG, "getDeviceConfig: $code,$msg")
|
||||
toast("初始化设备失败,请稍后重试,code=${code},msg=${msg}")
|
||||
})
|
||||
}
|
||||
|
||||
data class DeviceConfigBean(
|
||||
var appPackageUrl:String? = null,
|
||||
var canteenId:String? = null
|
||||
)
|
||||
|
||||
private fun checkConfigData(data: String): Boolean {
|
||||
if (data.isBlank()) {
|
||||
return false
|
||||
}
|
||||
val config = data.toObject<DeviceConfigBean?>()
|
||||
if (config == null) {
|
||||
return false
|
||||
}
|
||||
BaseApp.configUrl = config.appPackageUrl?:""
|
||||
BaseApp.canteenId = config.canteenId?:""
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.recyclerview.widget.ItemTouchHelper
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.aithings.Weigher
|
||||
import com.shuwei.dish.match.R
|
||||
import com.shuwei.dish.match.adapter.DishPartAdapter
|
||||
import com.shuwei.dish.match.base.BaseActivity
|
||||
@@ -75,11 +74,11 @@ class PrepareCookActivity : BaseActivity() {
|
||||
|
||||
private fun addViewClickListener() {
|
||||
binding.ivWeightClear.setOnClickListener {
|
||||
Weigher.tareTwo(AddressUtil.ONE)
|
||||
WeightUtil.tareTwo(AddressUtil.ONE)
|
||||
}
|
||||
WeightUtil.addWeightListener(getWeight = { address, state, weight ->
|
||||
Log.d(TAG, "addViewClickListener: address=$address,state=$state,weight=$weight")
|
||||
if (address == 2) {
|
||||
if (address == AddressUtil.ONE) {
|
||||
binding.tvDishPartWeight.text = "${weight}"
|
||||
}
|
||||
})
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.util.SparseIntArray
|
||||
import android.widget.TextView
|
||||
import androidx.core.util.forEach
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.aithings.Weigher
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.shuwei.dish.match.R
|
||||
import com.shuwei.dish.match.adapter.TextCellAdapter
|
||||
@@ -150,7 +149,7 @@ class SubmitFoodActivity : BaseActivity() {
|
||||
|
||||
private fun addViewListener() {
|
||||
addWeightListener()
|
||||
binding.btnWeightClear.setOnClickListener { Weigher.tareTwo(AddressUtil.TWO) }
|
||||
binding.btnWeightClear.setOnClickListener { WeightUtil.tareTwo(AddressUtil.TWO) }
|
||||
|
||||
binding.btnCook.clickWithDebounce {
|
||||
cook()
|
||||
@@ -167,7 +166,7 @@ class SubmitFoodActivity : BaseActivity() {
|
||||
|
||||
private fun addWeightListener() {
|
||||
WeightUtil.addWeightListener(getWeight = { address, state, weight ->
|
||||
if (address == 1) {
|
||||
if (address == AddressUtil.TWO) {
|
||||
cookFoodEntity.foodWeight = weight.toDouble()
|
||||
binding.tvTotalWeight.text = "${weight / 1000f}"
|
||||
}
|
||||
|
||||
@@ -207,19 +207,23 @@ class DishListFragment : Fragment() {
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun loadEmptyView() {
|
||||
list.clear()
|
||||
dishAdapter.notifyDataSetChanged()
|
||||
if (emptyViewBinding == null) {
|
||||
emptyViewBinding = LayoutEmptyViewBinding.inflate(
|
||||
LayoutInflater.from(requireContext()),
|
||||
binding.rvDishList,
|
||||
false
|
||||
)
|
||||
try {
|
||||
list.clear()
|
||||
dishAdapter.notifyDataSetChanged()
|
||||
if (emptyViewBinding == null) {
|
||||
emptyViewBinding = LayoutEmptyViewBinding.inflate(
|
||||
LayoutInflater.from(requireContext()),
|
||||
binding.rvDishList,
|
||||
false
|
||||
)
|
||||
}
|
||||
emptyViewBinding!!.tvContent.text = "暂无数据"
|
||||
emptyViewBinding!!.tvSubContent.text = "获取菜品数据失败,请检查网络设置或稍后重试"
|
||||
dishAdapter.stateView = emptyViewBinding!!.root
|
||||
//dishAdapter.setStateViewLayout(requireContext(), R.layout-sw800dp.layout_empty_view)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
emptyViewBinding!!.tvContent.text = "暂无数据"
|
||||
emptyViewBinding!!.tvSubContent.text = "获取菜品数据失败,请检查网络设置或稍后重试"
|
||||
dishAdapter.stateView = emptyViewBinding!!.root
|
||||
//dishAdapter.setStateViewLayout(requireContext(), R.layout-sw800dp.layout_empty_view)
|
||||
}
|
||||
|
||||
private fun finishRefresh() {
|
||||
|
||||
Reference in New Issue
Block a user