优化
This commit is contained in:
@@ -16,7 +16,7 @@ import com.sw.inbound.utils.ext.hideKeyboard
|
|||||||
abstract class BaseDialog(
|
abstract class BaseDialog(
|
||||||
context: Context,
|
context: Context,
|
||||||
var defWidth: Int = 1500.dp,
|
var defWidth: Int = 1500.dp,
|
||||||
var defHeight: Int = 900.dp
|
var defHeight: Int = 800.dp
|
||||||
) : Dialog(context, R.style.DialogTheme) {
|
) : Dialog(context, R.style.DialogTheme) {
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import androidx.core.graphics.toColorInt
|
|||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
import androidx.core.widget.addTextChangedListener
|
import androidx.core.widget.addTextChangedListener
|
||||||
import coil.load
|
import coil.load
|
||||||
|
import coil.transform.RoundedCornersTransformation
|
||||||
import com.shuwei.intelligent.shelves.utils.ext.appendText
|
import com.shuwei.intelligent.shelves.utils.ext.appendText
|
||||||
import com.shuwei.intelligent.shelves.utils.ext.buildSpannableString
|
import com.shuwei.intelligent.shelves.utils.ext.buildSpannableString
|
||||||
import com.sw.inbound.R
|
import com.sw.inbound.R
|
||||||
@@ -415,7 +416,9 @@ class GoodsStoreDialog(
|
|||||||
}
|
}
|
||||||
//只显示原始图片
|
//只显示原始图片
|
||||||
imagePreviewBinding = LayoutImagePreviewBinding.inflate(inflater, binding.flContainer)
|
imagePreviewBinding = LayoutImagePreviewBinding.inflate(inflater, binding.flContainer)
|
||||||
imagePreviewBinding?.imageView?.load(goods.relativeUrl)
|
imagePreviewBinding?.imageView?.load(goods.relativeUrl) {
|
||||||
|
transformations(RoundedCornersTransformation(radius = 10.dp.toFloat()))
|
||||||
|
}
|
||||||
binding.flContainer.let {
|
binding.flContainer.let {
|
||||||
it.setBackgroundResource(R.drawable.bg_white_radius10_stroke2)
|
it.setBackgroundResource(R.drawable.bg_white_radius10_stroke2)
|
||||||
it.updateLayoutParams<LinearLayout.LayoutParams> {
|
it.updateLayoutParams<LinearLayout.LayoutParams> {
|
||||||
|
|||||||
@@ -208,8 +208,11 @@ abstract class BaseViewModel(
|
|||||||
val paramList = if (nameList.isNullOrEmpty()) scoreList!!.map { it.name } else nameList
|
val paramList = if (nameList.isNullOrEmpty()) scoreList!!.map { it.name } else nameList
|
||||||
val response = repository.recognizeGoodsList(paramList)
|
val response = repository.recognizeGoodsList(paramList)
|
||||||
val list = if (parseResponse(response)) response.data?:listOf() else listOf()
|
val list = if (parseResponse(response)) response.data?:listOf() else listOf()
|
||||||
scoreList?.forEachIndexed { index, item ->
|
if (scoreList.isNullOrEmpty().not()) {
|
||||||
list[index].score = ((1 - item.score) * 10000).roundToInt()
|
list.forEach { record ->
|
||||||
|
val item = scoreList.firstOrNull { it.name == record.goodsName }
|
||||||
|
record.score = ((1 - (item?.score?:0.0)) * 10000).roundToInt()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
callback(list)
|
callback(list)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user