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