调整了个人营养数据计算逻辑,修复了摄像头逻辑
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user