修改了用户热量信息界面

This commit is contained in:
zxj
2025-08-01 18:14:06 +08:00
parent 16554805ad
commit 5ae72cdf04
16 changed files with 147 additions and 84 deletions
@@ -17,6 +17,10 @@ public class CustomImageView extends androidx.appcompat.widget.AppCompatImageVie
private String textToDraw;
private Paint mPaint;
private int mTextSize = dpToPixels(26);
/**
* 最大高度
*/
private static final int MAX_HEIGHT = 280;
private boolean isDrawText = false;
@@ -65,6 +69,10 @@ public class CustomImageView extends androidx.appcompat.widget.AppCompatImageVie
}
}
public void setCustomHeightPercent(float percent, boolean isAnimation) {
setCustomHeight((int) (percent * MAX_HEIGHT), isAnimation);
}
// 用于设置自定义高度的方法
public void setCustomHeight(int height, boolean isAnimation) {
ViewGroup.LayoutParams layoutParams = getLayoutParams();