调整了个人营养数据计算逻辑,修复了摄像头逻辑

This commit is contained in:
zxj
2025-08-07 10:49:50 +08:00
parent 561a2fc9b2
commit 71ce668e3c
9 changed files with 283 additions and 164 deletions
@@ -15,6 +15,8 @@ import android.view.animation.AlphaAnimation;
import com.sw.dualscreen.R;
import com.sw.plate.utils.AppUtil;
import timber.log.Timber;
public class CustomImageView extends androidx.appcompat.widget.AppCompatImageView {
private AlphaAnimation alphaAnimation;
private String textToDraw;
@@ -95,16 +97,21 @@ 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);
Timber.d("setCustomHeightPercent percent = %s", percent);
if (percent<= 0){
percent = 0f;
}
setCustomHeight((int) (percent * MAX_HEIGHT), false);
}
// 用于设置自定义高度的方法
public void setCustomHeight(int height, boolean isAnimation) {
Timber.d("setCustomHeight height = %s", height);
if (height > 0) {
height += 40;
height += 30;
}
if (height > MAX_HEIGHT){
height = MAX_HEIGHT;
}
ViewGroup.LayoutParams layoutParams = getLayoutParams();
int height1 = layoutParams.height;