优化
This commit is contained in:
@@ -424,7 +424,7 @@ class GoodsStoreDialog(
|
||||
|
||||
override fun show() {
|
||||
super.show()
|
||||
if (funcType == 1) {
|
||||
// if (funcType == 1) {
|
||||
takePhotoBinding?.let {
|
||||
cameraUtils.setPreviewController(previewView)
|
||||
cameraUtils.bind()
|
||||
@@ -434,7 +434,7 @@ class GoodsStoreDialog(
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
binding.root.postDelayed({
|
||||
SensorScaleUtils.startScale()
|
||||
}, 2600)
|
||||
@@ -455,7 +455,7 @@ class GoodsStoreDialog(
|
||||
private var imagePreviewBinding: LayoutImagePreviewBinding? = null
|
||||
private fun addChildToContainer() {
|
||||
val inflater = LayoutInflater.from(context)
|
||||
if (funcType == 1) {
|
||||
// if (funcType == 1) {
|
||||
//预览及拍照
|
||||
takePhotoBinding = LayoutTakePhotoBinding.inflate(inflater, binding.flContainer, true)
|
||||
activity?.unBindCamera()
|
||||
@@ -466,7 +466,7 @@ class GoodsStoreDialog(
|
||||
takePhotoBinding?.let {
|
||||
previewView = it.previewView
|
||||
it.flCameraPreview.visible()
|
||||
it.cvImageBg.gone()
|
||||
// it.cvImageBg.gone()
|
||||
// it.btnStartPreview.setOnClickListener { _ ->
|
||||
// it.cvImageBg.gone()
|
||||
// it.flCameraPreview.visible()
|
||||
@@ -475,19 +475,19 @@ class GoodsStoreDialog(
|
||||
// cameraUtils.takePhoto(takePhotoCallback)
|
||||
// }
|
||||
}
|
||||
return
|
||||
}
|
||||
//只显示原始图片
|
||||
imagePreviewBinding = LayoutImagePreviewBinding.inflate(inflater, binding.flContainer)
|
||||
imagePreviewBinding?.imageView?.load(goods.relativeUrl) {
|
||||
transformations(RoundedCornersTransformation(radius = 10.dp.toFloat()))
|
||||
}
|
||||
binding.flContainer.let {
|
||||
it.setBackgroundResource(R.drawable.bg_white_radius10_stroke2)
|
||||
it.updateLayoutParams<LinearLayout.LayoutParams> {
|
||||
width = 488.dp
|
||||
height = 356.dp
|
||||
bottomMargin = 35.dp
|
||||
if(funcType != 1){
|
||||
//只显示原始图片
|
||||
imagePreviewBinding = LayoutImagePreviewBinding.inflate(inflater, binding.flContainer)
|
||||
imagePreviewBinding?.imageView?.load(goods.relativeUrl) {
|
||||
transformations(RoundedCornersTransformation(radius = 10.dp.toFloat()))
|
||||
}
|
||||
binding.flContainer.let {
|
||||
it.setBackgroundResource(R.drawable.bg_white_radius10_stroke2)
|
||||
it.updateLayoutParams<LinearLayout.LayoutParams> {
|
||||
width = 488.dp
|
||||
height = 356.dp
|
||||
bottomMargin = 35.dp
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user