gpt4 book ai didi

java - 全息圆形进度条速度

转载 作者:行者123 更新时间:2023-12-01 06:15:39 25 4
gpt4 key购买 nike

我很难理解 HoloCircularProgressBar ( https://github.com/passsy/android-HoloCircularProgressBar ) 动画的工作原理。当我尝试将 animate(mHoloCircularProgressBar, null, 1f, 1000) 更改为 animate(mHoloCircularProgressBar, null, 1f, 10000) 时,持续时间不会乘以十。相反,动画会变得断断续续,并且仅在值小于 1000 时才平滑。如何减慢 HoloCircularProgress 栏的速度,使其以给定的毫秒值前进?

最佳答案

下面的例子应该对你有帮助。

private void batteryLevel() {

BroadcastReceiver batteryLevelReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
context.unregisterReceiver(this);
int rawlevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
int scale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
float level = -1;
if (rawlevel >= 0 && scale > 0) {
level = (rawlevel * 100) / scale;
}
//batterLevel.setText("Battery Level Remaining: " + level + "%");
animate(pgbTablet, null,level, 10000);
animate(pgbCase, null, level, 10000);
tvTblCharging.setText(""+(int)Math.ceil(level));
tvCaseCharging.setText(""+(int)Math.ceil(level));
}
};
IntentFilter batteryLevelFilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
getContext().registerReceiver(batteryLevelReceiver, batteryLevelFilter);
}

关于java - 全息圆形进度条速度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25468380/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com