修复了多次步骤2到步骤3问题

This commit is contained in:
zxj
2025-08-05 14:23:13 +08:00
parent c6badf2ca7
commit bbf2e605b5
8 changed files with 100 additions and 50 deletions
@@ -1,5 +1,6 @@
package com.sw.dualscreen.view
import android.content.DialogInterface
import android.graphics.Color
import android.graphics.Typeface
import android.graphics.drawable.ColorDrawable
@@ -82,6 +83,7 @@ class CustomBottomSheetDialog(
}
private fun initView() {
binding.viewClose.setOnClickListener { dismiss() }
adapter = createAdapter()
binding.recyclerview.layoutManager = GridLayoutManager(context, 2)
// 添加间距装饰(12dp)
@@ -131,7 +133,14 @@ class CustomBottomSheetDialog(
)
}
override fun onCancel(dialog: DialogInterface) {
Timber.d("onCancel")
viewModel.cleanSearchFoodInfoList()
super.onCancel(dialog)
}
override fun dismiss() {
Timber.d("dismiss")
viewModel.cleanSearchFoodInfoList()
super.dismiss()
}
@@ -95,11 +95,17 @@ public class CustomImageView extends androidx.appcompat.widget.AppCompatImageVie
}
public void setCustomHeightPercent(float percent, boolean isAnimation) {
// if (percent<= 0){
// percent = 0.01f;
// }
setCustomHeight((int) (percent * MAX_HEIGHT), isAnimation);
}
// 用于设置自定义高度的方法
public void setCustomHeight(int height, boolean isAnimation) {
if (height > 0) {
height += 40;
}
ViewGroup.LayoutParams layoutParams = getLayoutParams();
int height1 = layoutParams.height;
if (height1 != height) {